Note: This page has been translated by MathWorks. Please click here

To view all translated materals including this page, select Japan from the country navigator on the bottom of this page.

To view all translated materals including this page, select Japan from the country navigator on the bottom of this page.

Estimate input-output and time-series polynomial model coefficients

Estimators

Use the Recursive Polynomial Model Estimator block to estimate discrete-time input-output polynomial and time-series models.

These model structures are:

AR —

*A*(*q*)*y*(*t*) =*e*(*t*)ARMA —

*A*(*q*)*y*(*t*) =*C*(*q*)*e*(*t*)ARX —

*A*(*q*)*y*(*t*) =*B*(*q*)*u*(*t*–*nk*)+*e*(*t*)ARMAX —

*A*(*q*)*y*(*t*) =*B*(*q*)*u*(*t*–*nk*)+*C*(*q*)*e*(*t*)OE — $$y(t)=\frac{B(q)}{F(q)}u(t-{n}_{k})+e(t)$$

BJ — $$y(t)=\frac{B(q)}{F(q)}u(t-{n}_{k})+\text{}\frac{C(q)}{D(q)}e(t)$$

*q* is the time-shift operator and *nk* is
the delay. *u*(*t*) is the input, *y*(*t*)
is the output, and *e*(*t*) is the
error. For MISO models, there are as many *B*(*q*)
polynomials as the number of inputs. The orders of these models are:

*na*— 1+*a*_{1}*q*^{-1}+*a*_{2}*q*^{-2}+...+*a*_{na}*q*^{-na}*nb*—*b*_{1}+*b*_{2}*q*^{-1}+*b*_{3}*q*^{-2}+...+*b*_{nb}*q*^{-(nb-1)}*nc*— 1+*c*_{1}*q*^{-1}+*c*_{2}*q*^{-2}+...+*c*_{nc}*q*^{-nc}*nd*— 1+*d*_{1}*q*^{-1}+*d*_{2}*q*^{-2}+...+*d*_{nd}*q*^{-nd}*nf*— 1+*f*_{1}*q*^{-1}+*f*_{2}*q*^{-2}+...+*f*_{nf}*q*^{-nf}

The orders *na*, *nb*, *nc*, *nd*, *nf* and
delay, *nk*, are known a priori and fixed. These
are provided through the **Model Parameters** tab
of the block dialog. *u*(*t*) and *y*(*t*)
are provided through the Inputs and Outputs inports, respectively.
The block estimates the A(q), B(q), C(q), D(q) and F(q) coefficients
and outputs them in the Parameters outport. This outport provides
a bus signal with the following elements:

A — Vector containing [1

*a*(_{1}*t*) ...*a*(_{na}*t*)].B — Vector containing [

`zeros(1,nk)`

*b*(_{1}*t*) ...*b*(_{nb}*t*)]. For MISO data,*B*is a matrix where the*i*-th row parameters correspond to the*i*-th input.C — Vector containing [1

*c*(_{1}*t*) ...*c*(_{nc}*t*)].D — Vector containing [1

*d*(_{1}*t*) ...*d*(_{nd}*t*)].F — Vector containing [1

*f*(_{1}*t*) ...*f*(_{nf}*t*)].

For example, suppose you want to estimate the coefficients for the following SISO ARMAX model:

*y*(*t*)+*a _{1}*

*y*, *u*, *na*, *nb*, *nc*, *nd*, *nf*,
and *nk* are known quantities that you provide to
the block. The block estimates the *A*, *B*, *C*, *D*,
and *F* parameter values. Estimated *C*, *D*,
and *F* polynomials are enforced to be stable, that
is, having roots in the unit disk. Estimated *A* and *B* polynomials
can be unstable.

For a given time step, *t*, specify *y* and *u* as
inputs to the Output and Inputs inports, respectively. Specify the *na*, *nb*, *nc*,
and *nk* values in the **Model Parameters** tab
of the block dialog. The block estimates the *A*, *B*, *C*, *D* and *F* parameter
values and outputs these estimated values using the Parameters outport.

Estimated model structure, specified as one of the following:

`ARX`

— SISO or MISO ARX model.`ARMAX`

— SISO ARMAX model.`OE`

— SISO OE model.`BJ`

— SISO BJ model.`AR`

— Time-series AR model.`ARMA`

— Time-series ARMA model.

**Initial Estimate**Initial guess of the values of the parameters to be estimated, specified as one of the following options:

**Default:**`'None'`

Block sample time, specified as -1 or a positive scalar.

The default value is -1. The block inherits its sample time based on the context of the block within the model.

**Estimation Method**Recursive estimation algorithm, specified as one of the following (each option can change the block dialog):

`Forgetting Factor`

— (Default) Forgetting factor algorithmIf you select this option, you must specify the

**Forgetting Factor**,*λ*, as a scalar in the (0 1] range.*λ*specifies the measurement window relevant for parameter estimation. Suppose the system remains approximately constant over*T*samples. You can choose_{0}*λ*such that:$${T}_{0}=\frac{1}{1-\lambda}$$

Setting

*λ*= 1 corresponds to “no forgetting” and estimating constant coefficients. Setting*λ*< 1 implies that past measurements are less significant for parameter estimation and can be “forgotten.” Set*λ*< 1 to estimate time-varying coefficients. Typical choices of*λ*are in the [0.98 0.995] range.The default value is 1.

`Kalman Filter`

— Kalman filter algorithmIf you select this option, you must specify the

**Noise Covariance Matrix**as one of the following:Real nonnegative scalar,

*α*— Covariance matrix is an*N*-by-*N*diagonal matrix, with*α*as the diagonal elements.Vector of real nonnegative scalars, [

*α*_{1},...,*α*_{N}] — Covariance matrix is an*N*-by-*N*diagonal matrix, with [*α*_{1},...,*α*_{N}] as the diagonal elements.*N*-by-*N*symmetric positive semidefinite matrix.

*N*is the number of parameters to be estimated.0 values in the noise covariance matrix correspond to estimating constant coefficients. Values larger than 0 correspond to time-varying parameters. Large values correspond to rapidly changing parameters.

The default value is 1.

`Normalized Gradient`

— Normalized gradient adaptation algorithmIf you select this option, you must specify the following:

**Adaptation Gain**— Adaptation gain,*γ*, specified as a real positive scalar.*γ*is directly proportional to the relative information content in the measurements. That is, when your measurements are trustworthy, specify a large value for*γ*.The default value is 1.

**Normalization Bias**— Bias in adaptation gain scaling,*Bias*, specified as a real nonnegative scalar. The normalized gradient algorithm scales the adaptation gain at each step by the square of the two-norm of the gradient vector. If the gradient is close to zero, this can cause jumps in the estimated parameters.*Bias*is the term introduced in the denominator to prevent these jumps. Increase*Bias*if you observe jumps in estimated parameters.The default value is

`eps`

.

`Gradient`

— Unnormalized gradient adaptation algorithmIf you select this option, you must specify the

**Adaptation Gain**,*γ*, as a real, positive scalar.*γ*is directly proportional to the relative information content in the measurements. That is, when your measurements are trustworthy, specify a large value for*γ*, and vice versa.The default value is 1.

For more information about these algorithms, see Recursive Algorithms for Online Parameter Estimation.

**Output estimation error**Add Error outport to the block. Use this signal to validate the estimation.

For a given time step,

*t*, the estimation error is calculated as:$$e(t)=y(t)-yest(t).$$

- On
Add Error outport.

- Off
(Default) Do not add Error outport.

**Output parameter covariance matrix**Add Covariance outport to the block. Use this signal to examine parameter estimation uncertainty.

This option is available only when

**Estimation Method**is either`Forgetting Factor`

or`Kalman Filter`

.The software computes parameter covariance

`P`

assuming that the residuals,*e*(*t*), are white noise, and the variance of these residuals is 1. The interpretation of`P`

depends on the estimation method:`Forgetting Factor`

—*R*_{2}`/2`

*`P`

is approximately equal to the covariance matrix of the estimated parameters, where*R*is the true variance of the residuals._{2}`Kalman Filter`

—*R**_{2}`P`

is the covariance matrix of the estimated parameters, and*R*/_{1}*R*is the covariance matrix of the parameter changes. Where,_{2}*R*is the covariance matrix that you specify in_{1}**Parameter Covariance Matrix**.

- On
Add Covariance outport.

- Off
(Default) Do not add Covariance outport.

**Add enable port**Add Enable inport to the block. Use this input signal to specify a control signal that enables or disables parameter estimation. The block estimates the parameter values for each time step that parameter estimation is enabled. If you disable parameter estimation at a given step,

*t*, then the software does not update the parameters for that time step. Instead, the block outputs the last estimated parameter values. Use this option, for example, to disable parameter estimation when the system enters a mode where the parameter values do not vary with time.- On
Add Enable inport.

- Off
(Default) Do not add Enable inport.

**External reset**Option to reset estimated parameters and parameter covariance matrix using specified initial values.

Suppose you reset the block at a time step,

*t*. If the block is enabled at*t*, the software uses the initial parameter values specified in**Initial Estimate**to estimate the parameter values. In other words, at*t*, the block performs a parameter update using the initial estimate and the current values of the inports. The block outputs these updated parameter value estimates using the Parameters outport.If the block is disabled at

*t*and you reset the block, the block outputs the values specified in**Initial Estimate**.Use this option, for example, when you reset the input because it did not excite the system as needed, resulting in poor estimation results.

Specify this option as one of the following:

`None`

— (Default) Estimated parameters and covariance matrix values are not reset.`Rising`

— Triggers reset when the control signal rises from a negative or zero value to a positive value. If the initial value is negative, rising to zero triggers reset.`Falling`

— Triggers reset when the control signal falls from a positive or a zero value to a negative value. If the initial value is positive, falling to zero triggers reset.`Either`

— Triggers reset when the control signal is either rising or falling.`Level`

— Triggers reset in either of these cases:Control signal is nonzero at the current time step

Control signal changes from nonzero at the previous time step to zero at the current time step

`Level hold`

— Triggers reset when the control signal is nonzero at the current time step.

When you choose any option other than

`None`

, the software adds a Reset inport to the block. You provide the reset control input signal to this inport.

Port Name | Port Type (In/Out) | Description |
---|---|---|

Inputs | In | u(t), specified as a
real scalar or vector. The port is available when the Model
Structure is `ARX` , `ARMAX` , `BJ` or `OE` . |

Output | In | y(t), specified as a
real scalar signal. |

Parameters | Out |
Estimated polynomial coefficients, returned as a bus. The bus
contains an element each for the `AR` `ARX` `ARMA` `ARMAX` `OE` `BJ`
Each bus element contains a vector of the associated polynomial
coefficients. For example, the A element contains [1
t)
...
a(_{na}t)].Estimated |

Enable (Optional) | In | Control signal to enable parameter estimation, specified as a scalar. |

Reset (Optional) | In | Control signal to reset parameter estimation, specified as a scalar. |

InitialParameters (Optional) | In | Initial guess of the values of the parameters to be estimated, specified as a bus. |

InitialCovariance (Optional) | In | Initial covariance of parameters, specified as a real nonnegative scalar, vector of real nonnegative scalars, or positive semi-definite matrix. |

Error (Optional) | Out | Estimation error, returned as a scalar. |

Covariance (Optional) | Out |
Covariance `Forgetting Factor` —*R*_{2}`/2` *`P` is approximately equal to the covariance matrix of the estimated parameters, where*R*is the true variance of the residuals. The block outputs the residuals in the_{2}**Error**port.`Kalman Filter` —*R**_{2}`P` is the covariance matrix of the estimated parameters, and*R*/_{1}*R*is the covariance matrix of the parameter changes. Where,_{2}*R*is the covariance matrix that you specify in_{1}**Parameter Covariance Matrix**.
This port is not available when |

Double-precision floating point

Single-precision floating point

The Inputs and Output inports must have matching data types.

[1] Ljung, L. *System Identification:
Theory for the User*. Upper Saddle River, NJ: Prentice-Hall
PTR, 1999, pp. 363–369.

Was this topic helpful?