Estimate Models Using armax
This example shows how to estimate a linear, polynomial model with an ARMAX structure for
a three-input and single-output (MISO) system using the iterative estimation method armax. For a summary of all available estimation commands in the toolbox, see
Model Estimation Commands.
Load a sample data set z8 with three inputs and one output, measured at 1 -second intervals and containing 500 data samples.
load iddata8Use armax to both construct the idpoly model object, and estimate the parameters:
.
Typically, you try different model orders and compare results, ultimately choosing the simplest model that best describes the system dynamics. The following command specifies the estimation data set, z8 , and the orders of the A , B , and C polynomials as na, nb, and nc, respectively. nk of [0 0 0] specifies that there is no input delay for all three input channels.
opt = armaxOptions;
opt.Focus = 'simulation';
opt.SearchOptions.MaxIterations = 50;
opt.SearchOptions.Tolerance = 1e-5;
na = 4;
nb = [3 2 3];
nc = 4;
nk = [0 0 0];
m_armax = armax(z8, [na nb nc nk], opt);Focus, Tolerance, and MaxIter are
estimation options that configure the estimation objective function and the attributes of the
search algorithm. The Focus option specifies whether the model is optimized
for simulation or prediction applications. The Tolerance and
MaxIter search options specify when to stop estimation. For more
information about these properties, see the armaxOptions reference page.
armax is a version of polyest with simplified
syntax for the ARMAX model structure. The armax method both constructs
the idpoly model object and estimates its
parameters.
View information about the resulting model object.
m_armax
m_armax =
Discrete-time ARMAX model: A(z)y(t) = B(z)u(t) + C(z)e(t)
A(z) = 1 - 1.284 z^-1 + 0.3048 z^-2 + 0.2648 z^-3 - 0.05708 z^-4
B1(z) = -0.07547 + 1.087 z^-1 + 0.7166 z^-2
B2(z) = 1.019 + 0.1142 z^-1
B3(z) = -0.06739 + 0.06828 z^-1 + 0.5509 z^-2
C(z) = 1 - 0.06096 z^-1 - 0.1296 z^-2 + 0.02489 z^-3 - 0.04699 z^-4
Sample time: 1 seconds
Parameterization:
Polynomial orders: na=4 nb=[3 2 3] nc=4 nk=[0 0 0]
Number of free coefficients: 16
Use "polydata", "getpvec", "getcov" for parameters and their uncertainties.
Status:
Estimated using ARMAX on time domain data "z8".
Fit to estimation data: 80.86% (simulation focus)
FPE: 2.888, MSE: 0.9868
Model Properties
m_armax is an idpoly model object. The coefficients represent estimated parameters of this polynomial model. You can use present(m_armax) to show additional information about the model, including parameter uncertainties.
View all property values for this model.
get(m_armax)
A: [1 -1.2836 0.3048 0.2648 -0.0571]
B: {[-0.0755 1.0870 0.7166] [1.0188 0.1142] [-0.0674 0.0683 0.5509]}
C: [1 -0.0610 -0.1296 0.0249 -0.0470]
D: 1
F: {[1] [1] [1]}
IntegrateNoise: 0
Variable: 'z^-1'
IODelay: [0 0 0]
Structure: [1×1 pmodel.polynomial]
NoiseVariance: 2.7984
InputDelay: [3×1 double]
OutputDelay: 0
InputName: {3×1 cell}
InputUnit: {3×1 cell}
InputGroup: [1×1 struct]
OutputName: {'y1'}
OutputUnit: {''}
OutputGroup: [1×1 struct]
Notes: [0×1 string]
UserData: []
Name: ''
Ts: 1
TimeUnit: 'seconds'
SamplingGrid: [1×1 struct]
Report: [1×1 idresults.polyest]
The Report model property contains detailed information on the estimation results. To view the properties and values inside Report, use dot notation. For example:
m_armax.Report
ans =
Status: 'Estimated using ARMAX with simulation focus'
Method: 'ARMAX'
InitialCondition: 'zero'
Fit: [1×1 struct]
Parameters: [1×1 struct]
OptionsUsed: [1×1 idoptions.polyest]
RandState: [1×1 struct]
DataUsed: [1×1 struct]
Termination: [1×1 struct]
This action displays the contents of estimation report such as model quality measures (Fit), search termination criterion (Termination), and a record of estimation data (DataUsed) and options (OptionsUsed).