Option set for
n4sidOptions object to specify options for estimating
state-space models using the
n4sid function. You can specify options such as
the handling of initial states, stability enforcement, and the weighting prefilter to be used
InitialState — Handling of initial states
'estimate' (default) |
Handling of initial states during estimation, specified as one of the following values:
'zero'— The initial state is set to zero.
'estimate'— The initial state is treated as an independent estimation parameter.
N4Weight — Weighting scheme used for singular-value decomposition by the N4SID algorithm
'auto' (default) |
Weighting scheme used for singular-value decomposition by the N4SID algorithm, specified as one of the following values:
'MOESP'— Uses the MOESP algorithm by Verhaegen .
'CVA'— Uses the Canonical Variate Algorithm by Larimore .
Estimation using frequency-domain data always uses
'SSARX'— A subspace identification method that uses an ARX estimation based algorithm to compute the weighting.
Specifying this option allows unbiased estimates when using data that is collected in closed-loop operation. For more information about the algorithm, see  .
n4sidperforms separate estimations for
'SSARX'and returns the estimation results for the weighting scheme that provides the best fit.
n4sidautomatically selects the algorithm.
N4Horizon — Forward- and backward-prediction horizons used by the
'auto' (default) | vector
[r sy su] |
Forward and backward prediction horizons used by the N4SID algorithm, specified as one of the following values:
A row vector with three elements —
[r sy su], where
ris the maximum forward prediction horizon. The algorithm uses up to
syis the number of past outputs, and
suis the number of past inputs that are used for the predictions. See pages 209 and 210 in  for more information. These numbers can have a substantial influence on the quality of the resulting model, and there are no simple rules for choosing them. Making
N4Horizona k-by-3 matrix means that each row of
N4Horizonis tried, and the value that gives the best (prediction) fit to data is selected. k is the number of guesses of
[r sy su]combinations. If you specify
N4Horizonas a single column,
r = sy = suis used.
'auto'— The software uses an Akaike Information Criterion (AIC) for the selection of
WeightingFilter — Weighting prefilter
 (default) | vector | matrix | cell array | linear system
Weighting prefilter applied to the loss function to be minimized during estimation.
To understand the effect of
WeightingFilter on the loss function, see
Loss Function and Model Quality Metrics.
WeightingFilter as one of the values in the following
|No weighting prefilter is used.|
Specify a row vector or matrix containing frequency values that
define desired passbands. You select a frequency band where the fit between
estimated model and estimation data is optimized. For example, specify
Passbands are expressed in
Specify a single-input-single-output (SISO) linear filter in one of the following ways:
Applicable for frequency-domain data only. Specify a column vector of
weights. This vector must have the same length as the frequency vector of the
InputInterSample — Input-channel intersample behavior
Input-channel intersample behavior for transformations between discrete time and continuous time, specified as
The definitions of the three behavior values are as follows:
'zoh'— Zero-order hold maintains a piecewise-constant input signal between samples.
'foh'— First-order hold maintains a piecewise-linear input signal between samples.
'bl'— Band-limited behavior specifies that the continuous-time input signal has zero power above the Nyquist frequency.
iddata objects have a similar property,
data.InterSample, that contains the same behavior value options.
InputInterSample value is
the estimation data is in an
software uses the
data.InterSample value. When the estimation data
is instead contained in a timetable or a matrix pair, with the
option, the software uses
The software applies the same option value to all channels and all experiments.
OutputWeight — Weighting of prediction errors in multi-output estimations
 (default) |
'noise' | positive semidefinite symmetric matrix
Weighting of prediction errors in multi-output estimations, specified as one of the following values:
'noise'— Minimize , where E represents the prediction error and
Nis the number of data samples. This choice is optimal in a statistical sense and leads to maximum likelihood estimates if nothing is known about the variance of the noise. It uses the inverse of the estimated noise variance as the weighting function.
Positive semidefinite symmetric matrix (
W) — Minimize the trace of the weighted prediction error matrix
E is the matrix of prediction errors, with one column for each output, and W is the positive semidefinite symmetric matrix of size equal to the number of outputs. Use W to specify the relative importance of outputs in multiple-output models, or the reliability of corresponding data.
Nis the number of data samples.
— The software chooses between
'noise'and using the identity matrix for
This option is relevant for only multi-output models.
Advanced — Additional advanced options
structure with field
MaxSize of 250000 (default) | structure
Additional advanced options, specified as a structure with the field
MaxSize specifies the maximum number of
elements in a segment when input-output data is split into segments.
MaxSize must be a positive integer.
Create Default Options Set for State-Space Estimation Using Subspace Method
opt = n4sidOptions;
Specify Options for State-Space Estimation Using Subspace Method
Create an options set for
n4sid using the
'zero' option to initialize the state. Set the
opt = n4sidOptions('InitialState','zero','Display','on');
Alternatively, use dot notation to set the values of
opt = n4sidOptions; opt.InitialState = 'zero'; opt.Display = 'on';
 Larimore, Wallace E. "Canonical variate analysis in identification, filtering and adaptive control." Proceedings of the 29th IEEE Conference on Decision and Control, pp. 596–604, 1990.
 Verhaegen, Michel. "Identification of the deterministic part of MIMO state space models given in innovations form from input-output data." Automatica, Vol. 30, No. 1, 1994, pp. 61–74. https://doi.org/10.1016/0005-1098(94)90229-1
 Ljung, Lennart. System Identification: Theory for the User. Upper Saddle River, NJ: Prentice-Hall PTR, 1999.
 Jansson, Magnus. “Subspace identification and ARX modeling.” 13th IFAC Symposium on System Identification , Rotterdam, The Netherlands, 2003.
Version HistoryIntroduced in R2012a
InputInterSample option allows intersample behavior specification for continuous models estimated from timetables or matrices.
iddata objects contain an
InterSample property that
describes the behavior of the signal between sample points. The
InputInterSample option implements a version of that property in
n4sidOptions so that intersample behavior can be specified also when
estimation data is stored in timetables or matrices.