# Comparing multiple $\tt armax$ models

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?

• 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. – 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.