n4sid
Estimate state-space model using N4SID algorithm. N4SID: Numerical algorithm for Subspace State Space System IDentification. If no output arguments are given, the singular values are plotted on the screen in order to estimate the system order.
Inputs
iddata set containing the measurements, i.e. time-domain signals.
The desired order of the resulting state-space system sys. If not specified, n is chosen automatically according to the singular values and tolerances.
Optional pairs of keys and values. 'key1', value1, 'key2', value2
.
Optional struct with keys as field names.
Struct opt can be created directly or
by function options
. opt.key1 = value1, opt.key2 = value2
.
Outputs
Discrete-time state-space model.
Initial state vector. If dat is a multi-experiment dataset, x0 becomes a cell vector containing an initial state vector for each experiment.
Struct containing additional information.
Kalman gain matrix.
State covariance matrix.
Output covariance matrix.
State-output cross-covariance matrix.
Noise variance matrix factor. LL’=Ry.
Option Keys and Values
The desired order of the resulting state-space system sys. s > n > 0.
The number of block rows s in the input and output block Hankel matrices to be processed. s > 0. In the MOESP theory, s should be larger than n, the estimated dimension of state vector.
Specifies the algorithm for computing the triangular factor R, as follows:
Cholesky algorithm applied to the correlation matrix of the input-output data. Default method.
Fast QR algorithm.
QR algorithm applied to the concatenated block Hankel matrices.
Absolute tolerance used for determining an estimate of the system order. If tol >= 0, the estimate is indicated by the index of the last singular value greater than or equal to tol. (Singular values less than tol are considered as zero.) When tol = 0, an internally computed default value, tol = s*eps*SV(1), is used, where SV(1) is the maximal singular value, and eps is the relative machine precision. When tol < 0, the estimate is indicated by the index of the singular value that has the largest logarithmic gap to its successor. Default value is 0.
The tolerance to be used for estimating the rank of matrices. If the user sets rcond > 0, the given value of rcond is used as a lower bound for the reciprocal condition number; an m-by-n matrix whose estimated condition number is less than 1/rcond is considered to be of full rank. If the user sets rcond <= 0, then an implicitly computed, default tolerance, defined by rcond = m*n*eps, is used instead, where eps is the relative machine precision. Default value is 0.
Specifies whether or not the user’s confirmation of the system order estimate is desired, as follows:
User’s confirmation.
No confirmation. Default value.
The desired type of noise input channels.
No error inputs. Default value.
Return sys as a (p-by-m+p) state-space model with both measured input channels u and noise channels e with covariance matrix Ry.
Return sys as a (p-by-m+p) state-space model with both measured input channels u and white noise channels v with identity covariance matrix.
Return sys as a Kalman predictor for simulation.
Algorithm
Uses IB01BD and IB01CD,
Copyright (c) 2020, SLICOT, available under the BSD 3-Clause
(License and Disclaimer).
Source Code: n4sid