Can we control the maximum iterations and tolerance when calling 'arx'?

3 views (last 30 days)
When using the command 'arx', what are the default values for "maximum number of iterations" and "tolerance"? How do we change the values of these settings to improve the fit?

Accepted Answer

MathWorks Support Team
MathWorks Support Team on 8 May 2023
The "arx" function uses a non-iterative (linear least squares) solution approach. Hence numerical search-related options such as "Maximum iterations" and "Tolerance" do not apply to it.
In order to iteratively improve the results of an "arx" model, you can use the "polyest" or "pem" commands, along with the option-set created using the "polyestOptions" command, as demonstrated in the examples below:
Example 1 (Cold Start): Use an iterative approach to determine "arx" coefficients
na = 2;
nb = 2;
nk = 1;
nc = 0;
nd = 0;
nf = 0;
opt = polyestOptions;
opt.SearchOptions.MaxIterations = 100;
opt.Display = 'on';
model = polyest(data, [na nb nc nd nf nk], opt)
Note that nc=nd=nf=0 so that the resulting model has "arx" structure.
Example 2 (Warm Start): Run an iterative minimizer on the results obtained by "arx"
model1 = arx(data, [na nb nk]);
opt = polyestOptions;
opt.SearchMethod = 'lm';
opt.SearchOptions.MaxIterations = 100;
model2 = polyest(data, model1, opt);
Note that if the model obtained by using the "arx" command is not good, it is unlikely that the use of an iterative minimizer (as shown in the examples above) would make a significant difference. In this case, it is suggested to try other model structures such as "armax" or "oe".

More Answers (0)

Products


Release

R2020b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!