How to Improve the computation speed for 'ARMAX' function?

2 次查看(过去 30 天)
Hi, I'm currently using ARMAX function to compute a model. I would like to compute all possible model at once in the code (3000 models at once) but I guess it's too much and the computing time took so long. Is there a way to improve my computation speed? Here's the code for the armax function that I used.
na = 1:10; %polinom output
nb = 1:10; %polinom input
nc = 1:5; %polinom noise
nk = 0:5;
order = struc(na,nb,nc,nk);
models = cell(size(order,1),1);
for od = 1:size(order,1) %ARIMAX MODEL
models{od} = armax(dataest,[order(od,:)],'IntegrateNoise', true);
end
Please help me, to improve my computation speed since I'm still at lost on how to improve the speed through efficiency of my code. Thank you!

回答(1 个)

Rajiv Singh
Rajiv Singh 2020-6-9
编辑:Rajiv Singh 2020-6-9
If you have access to Parallel Computing Toolbox, you could consider replacing the for-loop with a "parfor" loop. Other things to consider:
  • If parameter uncertainty is not needed, you can turn it off using armaxOptions:EstimateCovariance flag.
  • Try reducing armaxOptions:SearchOptions:MaximumIterations.
  • Try a different estimation technique, like n4sid which is faster. You can convert the resulting model into polynomial (armax) form using IDPOLY() command. Example:
sys = idpoly(n4sid(data, 2));
But this will be hard to do for ARIMAX case. For that, you can replace data with diff(data) and fit a regular model (no noise integrators) to it. Example:
data2 = diff(data); % remove integration effects from data
sys = idpoly(n4sid(data2,2));
sys.D = [1 -1] % add the integrator back

Community Treasure Hunt

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

Start Hunting!

Translated by