I would like to create an algorithm that, given an iddata, estimates different armax models with different na, nb, nc, nk, and finally show the compare plot.

I know how to use the armax estimation function, but how can I store the model in a variable in a such that I can compare them later?

  • $\begingroup$ You can perform a n-grid search and create multiple models. for na=2:8 for nb=2:8 for nc=1:4 sys[na,nb,nc]=armax(na,nb,nc) end end end Inside the same loop you can include the performance metrics that you desire. As a rule of thumb you need 2 poles for each spectral peak. MA models perform better for "smoother" spectra. $\endgroup$ – Filipe Pinto Feb 21 '17 at 19:22

What's wrong with just doing sys = armax(data,[na,nb,nc,nk]); as per the Mathworks manual? sys is the variable. You could do sys[i] = ... to store several of them in an array (or perhaps sys{i}).

Then, to compare them, you could use getcov() and compare the covariances of each model. These covariances tell you how "uncertain" the model is.

Another approach might be to look at the model residuals. If the residuals are white (uncorrelated), then the model is good. The relatively energy / power of the residuals will be a measure of how accurate the model matches the data (the smaller the residual, the better the model).


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.