MATLAB: Does the N4SID function return different state space models for the same data set in System Identification Toolbox 7.4.3 (R2011b) and System Identification Toolbox 8.0 (R2012a)

System Identification Toolbox

I am using the N4SID function to estimate state space models from a data set. The estimated model returned in R2011b and R2012a are different even though the options and order of the model are specified to be the same. I would like to know if it is possible for the N4SID function to return the same model in different MATLAB versions.

Best Answer

The difference in the estimated model returned is due to a bug fix made to the N4SID function in the R2012a release. This changes the algorithm used for calculating the prediction horizon specified by the argument 'N4Horizon'. In order to work around this issue, you can specify the same value for 'N4Horizon' used in R2011b and prior releases when using the N4SID function in R2012a, as shown in the following example:
idss = n4sid(iddata_obj, order, 'N4Horizon', [3 7 7]);