Documentation for Basis Functions
¶
Bersntein Basis Function for NARMAX models.
Bersntein
¶
Bases: BaseBasisFunction
Build Bersntein basis function.
Generate Bernstein basis functions.
This class constructs a new feature matrix consisting of Bernstein basis functions for a given degree. Bernstein polynomials are useful in numerical analysis, curve fitting, and approximation theory due to their smoothness and the ability to approximate any continuous function on a closed interval.
The Bernstein polynomial of degree \(n\) for a variable \(x\) is defined as:
where \(\binom{n}{i}\) is the binomial coefficient, given by:
Bernstein polynomials form a basis for the space of polynomials of degree at most \(n\). They are particularly useful in approximation theory because they can approximate any continuous function on the interval \([0, 1]\) as \(n\) increases.
Be aware that the number of features in the output array scales significantly with the number of inputs, the maximum lag of the input, and the polynomial degree.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
degree | int(max_degree) | The maximum degree of the polynomial features. | 1 |
bias | bool | Whether to include the bias (constant) term in the output feature matrix. deprecated in v.0.5.0 | True |
n | int | The maximum degree of the bersntein polynomial features. deprecated in v.0.5.0 | 1 |
Notes
Be aware that the number of features in the output array scales significantly as the number of inputs, the max lag of the input and output.
References
- Blog: this method is based on the content provided by Alex Shtoff in his blog. The content is easy to follow and every user is referred to is blog to check not only the Bersntein method, but also different topics that Alex discuss there! https://alexshtf.github.io/2024/01/21/Bernstein.html
- Wikipedia: Bernstein polynomial https://en.wikipedia.org/wiki/Bernstein_polynomial
Source code in sysidentpy/basis_function/_bersntein.py
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 |
|
transform(data, max_lag=1, ylag=1, xlag=1, model_type='NARMAX', predefined_regressors=None)
¶
Build Bersntein Basis Functions.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
data | ndarray of floats | The lagged matrix built with respect to each lag and column. | required |
max_lag | int | Maximum lag of list of regressors. | 1 |
ylag | ndarray of int | The range of lags according to user definition. | 1 |
xlag | ndarray of int | The range of lags according to user definition. | 1 |
model_type | str | The type of the model (NARMAX, NAR or NFIR). | 'NARMAX' |
predefined_regressors | Optional[ndarray] | Regressors to be filtered in the transformation. | None |
Returns:
Name | Type | Description |
---|---|---|
X_tr | {ndarray, sparse matrix} of shape (n_samples, n_features) | Transformed array. |
Source code in sysidentpy/basis_function/_bersntein.py
Bilinear Basis Function for NARMAX models.
Bilinear
¶
Bases: BaseBasisFunction
Build Bilinear basis function.
A general bilinear input-output model takes the form
This is a special case of the Polynomial NARMAX model.
Bilinear system theory has been widely studied and it plays an important role in the context of continuous-time systems. This is because, roughly speaking, the set of bilinear systems is dense in the space of continuous-time systems and any continuous causal functional can be arbitrarily well approximated by bilinear systems within any bounded time interval (see for example Fliess and Normand-Cyrot 1982). Moreover, many real continuous-time processes are naturally in bilinear form. A few examples are distillation columns (España and Landau 1978), nuclear and thermal control processes (Mohler 1973).
Sampling the continuous-time bilinear system, however, produces a NARMAX model which is more complex than a discrete-time bilinear model.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
degree | int(max_degree) | The maximum degree of the polynomial features. | 2 |
Notes
Be aware that the number of features in the output array scales significantly as the number of inputs, the max lag of the input and output, and degree increases. High degrees can cause overfitting.
Source code in sysidentpy/basis_function/_bilinear.py
12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 |
|
fit(data, max_lag=1, ylag=1, xlag=1, model_type='NARMAX', predefined_regressors=None)
¶
Build the Bilinear information matrix.
Each columns of the information matrix represents a candidate regressor. The set of candidate regressors are based on xlag, ylag, and degree defined by the user.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
data | ndarray of floats | The lagged matrix built with respect to each lag and column. | required |
max_lag | int | Target data used on training phase. | 1 |
ylag | ndarray of int | The range of lags according to user definition. | 1 |
xlag | ndarray of int | The range of lags according to user definition. | 1 |
model_type | str | The type of the model (NARMAX, NAR or NFIR). | 'NARMAX' |
predefined_regressors | ndarray of int | The index of the selected regressors by the Model Structure Selection algorithm. | None |
Returns:
Type | Description |
---|---|
psi = ndarray of floats | The lagged matrix built in respect with each lag and column. |
Source code in sysidentpy/basis_function/_bilinear.py
54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 |
|
transform(data, max_lag=1, ylag=1, xlag=1, model_type='NARMAX', predefined_regressors=None)
¶
Build Polynomial Basis Functions.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
data | ndarray of floats | The lagged matrix built with respect to each lag and column. | required |
max_lag | int | Maximum lag of list of regressors. | 1 |
ylag | ndarray of int | The range of lags according to user definition. | 1 |
xlag | ndarray of int | The range of lags according to user definition. | 1 |
model_type | str | The type of the model (NARMAX, NAR or NFIR). | 'NARMAX' |
predefined_regressors | Optional[ndarray] | Regressors to be filtered in the transformation. | None |
Returns:
Name | Type | Description |
---|---|---|
X_tr | {ndarray, sparse matrix} of shape (n_samples, n_features) | Transformed array. |
Source code in sysidentpy/basis_function/_bilinear.py
Fourier Basis Function for NARMAX models.
Fourier
¶
Bases: BaseBasisFunction
Build Fourier basis function.
Generate a new feature matrix consisting of all Fourier features with respect to the number of harmonics.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
degree | int(max_degree) | The maximum degree of the polynomial features. | 2 |
Notes
Be aware that the number of features in the output array scales significantly as the number of inputs, the max lag of the input and output.
Source code in sysidentpy/basis_function/_fourier.py
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 |
|
fit(data, max_lag=1, ylag=1, xlag=1, model_type='NARMAX', predefined_regressors=None)
¶
Build the Polynomial information matrix.
Each columns of the information matrix represents a candidate regressor. The set of candidate regressors are based on xlag, ylag, and degree defined by the user.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
data | ndarray of floats | The lagged matrix built with respect to each lag and column. | required |
max_lag | int | Target data used on training phase. | 1 |
ylag | ndarray of int | The range of lags according to user definition. | 1 |
xlag | ndarray of int | The range of lags according to user definition. | 1 |
model_type | str | The type of the model (NARMAX, NAR or NFIR). | 'NARMAX' |
predefined_regressors | ndarray of int | The index of the selected regressors by the Model Structure Selection algorithm. | None |
Returns:
Type | Description |
---|---|
psi = ndarray of floats | The lagged matrix built in respect with each lag and column. |
Source code in sysidentpy/basis_function/_fourier.py
transform(data, max_lag=1, ylag=1, xlag=1, model_type='NARMAX', predefined_regressors=None)
¶
Build Fourier Basis Functions.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
data | ndarray of floats | The lagged matrix built with respect to each lag and column. | required |
max_lag | int | Maximum lag of list of regressors. | 1 |
ylag | ndarray of int | The range of lags according to user definition. | 1 |
xlag | ndarray of int | The range of lags according to user definition. | 1 |
model_type | str | The type of the model (NARMAX, NAR or NFIR). | 'NARMAX' |
predefined_regressors | Optional[ndarray] | Regressors to be filtered in the transformation. | None |
Returns:
Name | Type | Description |
---|---|---|
X_tr | {ndarray, sparse matrix} of shape (n_samples, n_features) | Transformed array. |
Source code in sysidentpy/basis_function/_fourier.py
Legendre Basis Function for NARMAX models.
Legendre
¶
Bases: BaseBasisFunction
Build Legendre basis function expansion.
This class constructs a feature matrix consisting of Legendre polynomial basis functions up to a specified degree. Legendre polynomials, denoted by \(P_n(x)\), are orthogonal polynomials over the interval \([-1, 1]\) with respect to the uniform weight function \(w(x) = 1\). They are widely used in numerical analysis, curve fitting, and approximation theory.
The Legendre polynomial \(P_n(x)\) of degree \(n\) is defined by the following recurrence relation:
where \(P_n(x)\) represents the Legendre polynomial of degree \(n\).
Parameters:
Name | Type | Description | Default |
---|---|---|---|
degree | int | The maximum degree of the Legendre polynomial basis functions to be generated. | 2 |
include_bias | bool | Whether to include the bias (constant) term in the output feature matrix. | True |
ensemble | bool | If True, the original data is concatenated with the polynomial features. | False |
Notes
The number of features in the output matrix increases as the degree of the polynomial increases, which can lead to a high-dimensional feature space. Consider using dimensionality reduction techniques if overfitting becomes an issue.
References
- Wikipedia: Legendre polynomial https://en.wikipedia.org/wiki/Legendre_polynomials
Source code in sysidentpy/basis_function/_legendre.py
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 |
|
transform(data, max_lag=1, ylag=1, xlag=1, model_type='NARMAX', predefined_regressors=None)
¶
Build Bersntein Basis Functions.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
data | ndarray of floats | The lagged matrix built with respect to each lag and column. | required |
max_lag | int | Maximum lag of list of regressors. | 1 |
ylag | ndarray of int | The range of lags according to user definition. | 1 |
xlag | ndarray of int | The range of lags according to user definition. | 1 |
model_type | str | The type of the model (NARMAX, NAR or NFIR). | 'NARMAX' |
predefined_regressors | Optional[ndarray] | Regressors to be filtered in the transformation. | None |
Returns:
Name | Type | Description |
---|---|---|
X_tr | {ndarray, sparse matrix} of shape (n_samples, n_features) | Transformed array. |
Source code in sysidentpy/basis_function/_legendre.py
Polynomial Basis Function for NARMAX models.
Polynomial
¶
Bases: BaseBasisFunction
Build polynomial basis function.
Generate a new feature matrix consisting of all polynomial combinations of the features with degree less than or equal to the specified degree.
where \(p\) is the number of regressors, \(\Theta_i\) are the model parameters, and \(a_i, m, b_i, j\) and \(d_i, l \in \mathbb{N}\) are the exponents of the output, input and noise terms, respectively.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
degree | int(max_degree) | The maximum degree of the polynomial features. | 2 |
Notes
Be aware that the number of features in the output array scales significantly as the number of inputs, the max lag of the input and output, and degree increases. High degrees can cause overfitting.
Source code in sysidentpy/basis_function/_polynomial.py
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 |
|
fit(data, max_lag=1, ylag=1, xlag=1, model_type='NARMAX', predefined_regressors=None)
¶
Build the Polynomial information matrix.
Each columns of the information matrix represents a candidate regressor. The set of candidate regressors are based on xlag, ylag, and degree defined by the user.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
data | ndarray of floats | The lagged matrix built with respect to each lag and column. | required |
max_lag | int | Target data used on training phase. | 1 |
ylag | ndarray of int | The range of lags according to user definition. | 1 |
xlag | ndarray of int | The range of lags according to user definition. | 1 |
model_type | str | The type of the model (NARMAX, NAR or NFIR). | 'NARMAX' |
predefined_regressors | ndarray of int | The index of the selected regressors by the Model Structure Selection algorithm. | None |
Returns:
Type | Description |
---|---|
psi = ndarray of floats | The lagged matrix built in respect with each lag and column. |
Source code in sysidentpy/basis_function/_polynomial.py
transform(data, max_lag=1, ylag=1, xlag=1, model_type='NARMAX', predefined_regressors=None)
¶
Build Polynomial Basis Functions.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
data | ndarray of floats | The lagged matrix built with respect to each lag and column. | required |
max_lag | int | Maximum lag of list of regressors. | 1 |
ylag | ndarray of int | The range of lags according to user definition. | 1 |
xlag | ndarray of int | The range of lags according to user definition. | 1 |
model_type | str | The type of the model (NARMAX, NAR or NFIR). | 'NARMAX' |
predefined_regressors | Optional[ndarray] | Regressors to be filtered in the transformation. | None |
Returns:
Name | Type | Description |
---|---|---|
X_tr | {ndarray, sparse matrix} of shape (n_samples, n_features) | Transformed array. |
Source code in sysidentpy/basis_function/_polynomial.py
Hermite Basis Function for NARMAX models.
Hermite
¶
Bases: BaseBasisFunction
Build Hermite basis function expansion.
This class constructs a feature matrix consisting of Hermite polynomial basis functions up to a specified degree. Hermite polynomials, denoted by \(H_n(x)\), are orthogonal polynomials over the interval \((-\infty, \infty)\) with respect to the weight function \(w(x) = e^{-x^2}\). These polynomials are widely used in probability theory, quantum mechanics, and numerical analysis, particularly in solving the quantum harmonic oscillator and in the field of statistics.
Physicist's Hermite polynomials \(H_n(x)\), often used in physics: $$ H_n(x) = (-1)^n e{x2} \frac{dn}{dxn} e{-x2} $$
The Hermite polynomial \(H_n(x)\) of degree \(n\) can be also defined by the following recurrence relation:
where \(H_n(x)\) represents the Hermite polynomial of degree \(n\).
Parameters:
Name | Type | Description | Default |
---|---|---|---|
degree | int | The maximum degree of the Hermite polynomial basis functions to be generated. | 2 |
include_bias | bool | Whether to include the bias (constant) term in the output feature matrix. | True |
ensemble | bool | If True, the original data is concatenated with the polynomial features. | False |
Notes
The number of features in the output matrix increases as the degree of the polynomial increases, which can lead to a high-dimensional feature space. Consider using dimensionality reduction techniques if overfitting becomes an issue.
References
- Wikipedia: Hermite polynomial https://en.wikipedia.org/wiki/Hermite_polynomials
- Scipy: https://docs.scipy.org/doc/scipy/reference/generated/scipy.special.eval_hermite.html
Source code in sysidentpy/basis_function/_hermite.py
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 |
|
transform(data, max_lag=1, ylag=1, xlag=1, model_type='NARMAX', predefined_regressors=None)
¶
Build Bersntein Basis Functions.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
data | ndarray of floats | The lagged matrix built with respect to each lag and column. | required |
max_lag | int | Maximum lag of list of regressors. | 1 |
ylag | ndarray of int | The range of lags according to user definition. | 1 |
xlag | ndarray of int | The range of lags according to user definition. | 1 |
model_type | str | The type of the model (NARMAX, NAR or NFIR). | 'NARMAX' |
predefined_regressors | Optional[ndarray] | Regressors to be filtered in the transformation. | None |
Returns:
Name | Type | Description |
---|---|---|
X_tr | {ndarray, sparse matrix} of shape (n_samples, n_features) | Transformed array. |
Source code in sysidentpy/basis_function/_hermite.py
Hermite Basis Function for NARMAX models.
HermiteNormalized
¶
Bases: BaseBasisFunction
Build probabilist's Normalized Hermite basis function expansion.
This class constructs a feature matrix consisting of Hermite Normalized polynomial basis functions up to a specified degree. Hermite (normalized) polynomials, denoted by \(H_n(x)\), are orthogonal polynomials over the interval \((-\infty, \infty)\) with respect to the weight function \(w(x) = e^{-x^2}\). These polynomials are widely used in probability theory, quantum mechanics, and numerical analysis, particularly in solving the quantum harmonic oscillator and in the field of statistics.
Probabilist's Hermite polynomials \(He_n(x)\): $$ He_n(x) = (-1)^n e{x2/2} \frac{dn}{dxn} e{-x2/2} $$
where \(He_n(x)\) represents the probabilist's Normalized Hermite polynomial of degree \(n\).
Parameters:
Name | Type | Description | Default |
---|---|---|---|
degree | int | The maximum degree of the Hermite polynomial basis functions to be generated. | 2 |
include_bias | bool | Whether to include the bias (constant) term in the output feature matrix. | True |
ensemble | bool | If True, the original data is concatenated with the polynomial features. | False |
Notes
The number of features in the output matrix increases as the degree of the polynomial increases, which can lead to a high-dimensional feature space. Consider using dimensionality reduction techniques if overfitting becomes an issue.
References
- Wikipedia: Hermite polynomial https://en.wikipedia.org/wiki/Hermite_polynomials
- Scipy: https://docs.scipy.org/doc/scipy/reference/generated/scipy.special.eval_hermitenorm.html
Source code in sysidentpy/basis_function/_hermite_normalized.py
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 |
|
transform(data, max_lag=1, ylag=1, xlag=1, model_type='NARMAX', predefined_regressors=None)
¶
Build Bersntein Basis Functions.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
data | ndarray of floats | The lagged matrix built with respect to each lag and column. | required |
max_lag | int | Maximum lag of list of regressors. | 1 |
ylag | ndarray of int | The range of lags according to user definition. | 1 |
xlag | ndarray of int | The range of lags according to user definition. | 1 |
model_type | str | The type of the model (NARMAX, NAR or NFIR). | 'NARMAX' |
predefined_regressors | Optional[ndarray] | Regressors to be filtered in the transformation. | None |
Returns:
Name | Type | Description |
---|---|---|
X_tr | {ndarray, sparse matrix} of shape (n_samples, n_features) | Transformed array. |
Source code in sysidentpy/basis_function/_hermite_normalized.py
Laguerre Basis Function for NARMAX models.
Laguerre
¶
Bases: BaseBasisFunction
Build Laguerre basis function expansion.
This class constructs a feature matrix consisting of Laguerre polynomial basis functions up to a specified degree. Laguerre polynomials, denoted by \(L_n(x)\), are orthogonal polynomials over the interval \([0, \infty)\) with respect to the weight function \(w(x) = e^{-x}\). These polynomials are commonly used in physics, particularly in quantum mechanics, and in numerical analysis.
The Laguerre polynomial \(L_n(x)\) of degree \(n\) is defined by the following recurrence relation:
where \(L_n(x)\) represents the Laguerre polynomial of degree \(n\).
Parameters:
Name | Type | Description | Default |
---|---|---|---|
degree | int | The maximum degree of the Laguerre polynomial basis functions to be generated. | 2 |
include_bias | bool | Whether to include the bias (constant) term in the output feature matrix. | True |
ensemble | bool | If True, the original data is concatenated with the polynomial features. | False |
Notes
The number of features in the output matrix increases as the degree of the polynomial increases, which can lead to a high-dimensional feature space. Consider using dimensionality reduction techniques if overfitting becomes an issue.
References
- Wikipedia: Laguerre polynomial https://en.wikipedia.org/wiki/Laguerre_polynomials
- Scipy: https://docs.scipy.org/doc/scipy/reference/generated/scipy.special.eval_laguerre.html
- Milton Abramowitz and Irene A. Stegun, eds. Handbook of Mathematical Functions with Formulas, Graphs, and Mathematical Tables. New York: Dover, 1972.
Source code in sysidentpy/basis_function/_laguerre.py
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 |
|
transform(data, max_lag=1, ylag=1, xlag=1, model_type='NARMAX', predefined_regressors=None)
¶
Build Bersntein Basis Functions.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
data | ndarray of floats | The lagged matrix built with respect to each lag and column. | required |
max_lag | int | Maximum lag of list of regressors. | 1 |
ylag | ndarray of int | The range of lags according to user definition. | 1 |
xlag | ndarray of int | The range of lags according to user definition. | 1 |
model_type | str | The type of the model (NARMAX, NAR or NFIR). | 'NARMAX' |
predefined_regressors | Optional[ndarray] | Regressors to be filtered in the transformation. | None |
Returns:
Name | Type | Description |
---|---|---|
X_tr | {ndarray, sparse matrix} of shape (n_samples, n_features) | Transformed array. |