Identity function. If ``p`` is the returned series, then ``p(x) == x`` for all values of x. Parameters ---------- domain : {None, array_like}, optional If given, the array must be of the form ``[beg, end]``, where ``beg`` and ``end``
(cls, domain=None, window=None, symbol='x')
| 1078 | |
| 1079 | @classmethod |
| 1080 | def identity(cls, domain=None, window=None, symbol='x'): |
| 1081 | """Identity function. |
| 1082 | |
| 1083 | If ``p`` is the returned series, then ``p(x) == x`` for all |
| 1084 | values of x. |
| 1085 | |
| 1086 | Parameters |
| 1087 | ---------- |
| 1088 | domain : {None, array_like}, optional |
| 1089 | If given, the array must be of the form ``[beg, end]``, where |
| 1090 | ``beg`` and ``end`` are the endpoints of the domain. If None is |
| 1091 | given then the class domain is used. The default is None. |
| 1092 | window : {None, array_like}, optional |
| 1093 | If given, the resulting array must be if the form |
| 1094 | ``[beg, end]``, where ``beg`` and ``end`` are the endpoints of |
| 1095 | the window. If None is given then the class window is used. The |
| 1096 | default is None. |
| 1097 | symbol : str, optional |
| 1098 | Symbol representing the independent variable. Default is 'x'. |
| 1099 | |
| 1100 | Returns |
| 1101 | ------- |
| 1102 | new_series : series |
| 1103 | Series of representing the identity. |
| 1104 | |
| 1105 | """ |
| 1106 | if domain is None: |
| 1107 | domain = cls.domain |
| 1108 | if window is None: |
| 1109 | window = cls.window |
| 1110 | off, scl = pu.mapparms(window, domain) |
| 1111 | coef = cls._line(off, scl) |
| 1112 | return cls(coef, domain, window, symbol) |
| 1113 | |
| 1114 | @classmethod |
| 1115 | def basis(cls, deg, domain=None, window=None, symbol='x'): |