Estimate parameters of ARX or AR model using least squares
sys = arx(data,[na
sys = arx(data,[na nb nk],Name,Value)
sys = arx(data,[na nb nk],___,opt)
Specify optional comma-separated pairs of
Name is the argument
Value is the corresponding
Name must appear
inside single quotes (
You can specify several name and value pair
arguments in any order as
For a system with
Default: 0 for all input channels
Specify transport delays as integers denoting delay of a multiple
of the sample time,
For a MIMO system with
Default: 0 for all input/output pairs
Specify integrators in the noise channels.
Adding an integrator creates an ARIX model represented by:
where, is the integrator in the noise channel, e(t).
ARX model that fits the estimation data, returned as a discrete-time
Information about the estimation results and options used is
stored in the
For more information on using
Generate input data based on a specified ARX model, and then use this data to estimate an ARX model.
A = [1 -1.5 0.7]; B = [0 1 0.5]; m0 = idpoly(A,B); u = iddata(,idinput(300,'rbs')); e = iddata(,randn(300,1)); y = sim(m0,[u e]); z = [y,u]; m = arx(z,[2 2 1]);
arxRegul to automatically determine regularization constants and use the values for estimating an FIR model of order 50.
load regularizationExampleData eData; orders = [0 50 0]; [L,R] = arxRegul(eData,orders);
By default, the
TC kernel is used.
Use the returned
R values for regularized ARX model estimation.
opt = arxOptions; opt.Regularization.Lambda = L; opt.Regularization.R = R; model = arx(eData,orders,opt);
The ARX model structure is :
the orders of the ARX model, and
nk is the delay.
— Output at time .
— Number of poles.
— Number of zeroes plus 1.
— Number of input samples that occur before the input affects the output, also called the dead time in the system.
— Previous outputs on which the current output depends.
— Previous and delayed inputs on which the current output depends.
— White-noise disturbance value.
A more compact way to write the difference equation is
q is the delay operator. Specifically,
For time-series data that contains no inputs, one output and
= na, the model has AR structure of order
The AR model structure is
For multiple-input systems,
row vectors where the
ith element corresponds to
the order and delay associated with the
For models with multiple inputs and multiple outputs,
nk contain one row for each output signal.
In the multiple-output
arx minimizes the trace of the prediction
error covariance matrix, or the norm
To transform this to an arbitrary
quadratic norm using a weighting matrix
use the syntax
opt = arxOptions('OutputWeight',inv(lambda)) m = arx(data,orders,opt)
For time-domain data, the signals are shifted such that unmeasured signals are never required in the predictors. Therefore, there is no need to estimate initial conditions.
For frequency-domain data, it might be necessary to adjust the data by initial conditions that support circular convolution.
InitialCondition estimation option
arxOptions) to one the
'zero' — No adjustment.
'estimate' — Perform adjustment
to the data by initial conditions that support circular convolution.
'auto' — Automatically choose
on the data.
QR factorization solves the overdetermined set of linear equations that constitute the least-squares estimation problem.
Without regularization, the ARX model parameters vector θ is estimated by solving the normal equation:
where J is the regressor matrix and y is the measured output. Therefore,
Using regularization adds a regularization term:
where, λ and R are the regularization constants. See
arxOptions for more information on the
When the regression matrix is larger than the
arxOptions, data is segmented
and QR factorization is performed iteratively on these data segments.