Estimate parameters of AR model from scalar time series in Simulink software returning idpoly object
The AR Estimator block estimates the parameters of an AR model for a scalar time series and returns the model as an idpoly object. A time series is time-domain data consisting of one or more outputs y(t) and no corresponding measured input.
Note: The AR Estimator block will be removed in a future release. There is no replacement for this block.
For information about the default algorithm settings used for model estimation, see arOptions.
Each estimation generates a figure with the following plots:
Actual (measured) output versus the simulated or predicted model output.
Error in simulated model, which is the difference between the measured output and the model output.
The AR model is defined, as follows:
y(t) is the output at time t.
are the parameters to be estimated from the data.
is the number of poles of the system.
are the previous outputs on which the current output depends.
e(t) is white-noise disturbance.
The AR model can be written compactly for a single output y(t) using the following notation:
where and is the backward shift operator defined by .
The following block diagram shows the AR model structure.
The AR Estimator block outputs a sequence of multiple models (idpoly objects), estimated at regular intervals during the simulation. The Data window field in the block parameter dialog box specifies the number of data samples to use for estimation, as the simulation progresses.
The output format depends on whether you specify the Model Name in the block parameter dialog box.
Integer corresponds to the number of parameters (poles) in the AR model.
Number of input data samples that specify the interval after which to estimate a new model.
Sampling time for the model.
Number of past data samples used to estimate each model. A longer data window should be used for higher-order models. Too small a value might cause poor estimation results, and too large a value leads to slower computation.
Name of the model.
Whether you specify the model name determines the output format of the resulting models, as follows:
If you do not specify a model name, the estimated models display in the MATLAB® Command Window in a transfer-function format.
If you specify a model name, the resulting models are output to the MATLAB workspace as a cell array.
Specifies the forward-prediction horizon for computing the response K steps in the future, where K is 1, 5, or 10.
This example shows how you can use the AR Estimator block in a Simulink® model.
Generate sample input and output data.
y = sin([1:300]') + 0.5*randn(300,1); y = iddata(y);
Create a new Simulink model, as follows:
Add the IDDATA Source block and specify y in the Iddata object field of the IDDATA Source block parameter dialog box.
Add the AR Estimator block to the model and accept default block parameter values.
Connect the Output port of the IDDATA Source block to the y port of the AR Estimator block.
Run the estimation.
The estimated models appear in the MATLAB Command Window every 25 samples.