|
47 | 47 | X = np.c_[u0[max_delay:], u1[max_delay:]] |
48 | 48 |
|
49 | 49 | # %% |
50 | | -# Build term libriary |
| 50 | +# Build term library |
51 | 51 | # ------------------- |
52 | 52 | # To build a reduced polynomial NARX model, it is normally have two steps: |
53 | 53 | # |
|
56 | 56 | # |
57 | 57 | # #. Learn the coefficients of the terms. |
58 | 58 | # |
59 | | -# To search the structure of the model, the candidate term libriary should be |
| 59 | +# To search the structure of the model, the candidate term library should be |
60 | 60 | # constructed by the following two steps. |
61 | 61 | # |
62 | 62 | # #. Time-shifted variables: the raw input-output data, i.e., :math:`u_0(k)`, |
63 | 63 | # :math:`u_1(k)`, and :math:`y(k)`, are converted into :math:`u_0(k-1)`, |
64 | 64 | # :math:`u_1(k-2)`, etc. |
65 | 65 | # |
66 | | -# #. Nonlinear terms: the time-shifted variables are onverted to nonlinear terms |
| 66 | +# #. Nonlinear terms: the time-shifted variables are converted to nonlinear terms |
67 | 67 | # via polynomial basis functions, e.g., :math:`u_0(k-1)^2`, |
68 | 68 | # :math:`u_0(k-1)u_0(k-3)`, etc. |
69 | 69 | # |
|
124 | 124 | # %% |
125 | 125 | # Build NARX model |
126 | 126 | # ---------------- |
127 | | -# As the reduced polynomial NARX is a linear function of the nonlinear tems, |
128 | | -# the coefficient of each term can be easily estimated by oridnary least squares. |
| 127 | +# As the reduced polynomial NARX is a linear function of the nonlinear terms, |
| 128 | +# the coefficient of each term can be easily estimated by ordinary least squares. |
129 | 129 | # In the printed NARX model, it is found that :class:`FastCan` selects the correct |
130 | 130 | # terms and the coefficients are close to the true values. |
131 | 131 |
|
|
143 | 143 |
|
144 | 144 | print_narx(narx_model) |
145 | 145 | # %% |
146 | | -# Automaticated NARX modelling workflow |
| 146 | +# Automated NARX modelling workflow |
147 | 147 | # ------------------------------------- |
148 | | -# We provide :meth:`narx.make_narx` to automaticate the workflow above. |
| 148 | +# We provide :meth:`narx.make_narx` to automate the workflow above. |
149 | 149 |
|
150 | 150 | from fastcan.narx import make_narx |
151 | 151 |
|
|
0 commit comments