function obj = n4sidOptions(varargin)
%N4SIDOPTIONS  Creates option set for the N4SID command.
%
%   OPT = n4sidOptions returns the default options for N4SID. 
%
%   OPT = n4sidOptions('Option1',Value1,'Option2',Value2,...) uses
%   name/value pairs to override the default values for 'Option1','Option2',...
% 
%   The supported options are:
%  
%   InitialState  Handling of initial states (X0) during estimation.
%                 Specify as one of the following:
%                    'zero': X0 is fixed to zero values. 
%                'estimate': Initial states are treated as independent
%                            parameters whose values are estimated together
%                            with IDSS model parameters. Default.
%   
%   N4Weight      Type of weighting used in the singular-value
%                 decomposition used by N4SID estimator. Specify as one of
%                 the following: 
%                 'MOESP': Weighting corresponding to the MOESP algorithm
%                          by Verhaegen [1] is used.
%                   'CVA': Weighting corresponding to the Canonical
%                          Variate Analysis by Larimore [2] is used.
%                 'SSARX': An ARX estimation based algorithm computes the
%                          weighting; see [3].
%                  'auto': An automatic choice between 'MOESP', 'CVA' and
%                          'SSARX' is made during estimation. Default.
%                   'all': Estimations are performed using 'MOESP', 'CVA',
%                          and 'SSARX' and the best results returned.
%                 Note: Estimation using frequency domain data always uses
%                 'CVA'.
%
%   N4Horizon     Forward and backward prediction horizons used by N4SID.
%                 Specify as one of the following:
%                 - Row vector with three elements [r sy su], where r is the
%                   maximum forward prediction horizon, sy is the number of
%                   past outputs, and su is the number of past inputs that
%                   are used for the predictions. You can also set N4Horizon
%                   to a matrix with K rows and 3 columns in which case each
%                   row is tried successively, and the value that gives the
%                   best (prediction) fit to data is selected. If you specify
%                   N4Horizon as a single column, r=sy=su is used.
%                 - 'auto': N4Horizon value is calculated automatically
%                   during estimation. Akaike Information Criterion (AIC)
%                   for the selection of sy and su. Default.
%
%   Focus      Choose between 1-step prediction vs. simulation error
%              minimization. Specify as one of:
%              'prediction': Focus on producing good predictors. Default.
%              'simulation': Focus on making a good fit for simulation (with
%                            the current input).
%  
%   WeightingFilter   Weighting prefilter for estimation. Specify as one of:
%                     []: No weighting prefilter applied. Default.
%              Passbands: Row vector or matrix containing frequency values
%                         that define desired passbands. For example:
%                         [wl,wh]
%                         [w1l,w1h ; w2l,w2h ; w3l,w3h ; ...]
%                         where wl and wh represent lower and upper limits
%                         of a passband. For a matrix with several rows
%                         defining frequency passbands, the algorithm uses
%                         union of frequency ranges to define the
%                         estimation passband. Passbands are expressed in
%                         rad/TimeUnit for time domain data and in
%                         frequency units of the data for frequency domain
%                         data.
%            SISO Filter: Any SISO linear filter specified as one of:
%                         * A SISO linear system.
%                         * {A,B,C,D}, which specifies the state-space
%                           matrices of a discrete-time filter.  
%                         * {numerator, denominator}, which specifies the
%                           numerator and denominator of the filter
%                           expressed as a discrete-time transfer function.
%                 Vector: For frequency-domain data only. Specify as a column
%                         vector of weights. This vector must have the same
%                         size as length of the frequency vector of the
%                         data set (= length(Data.Frequency)).
%  
%   EnforceStability  Force the resulting model to be stable. Default: false.
%
%   EstimateCovariance  Specify whether to estimate parameter covariance (true)
%                       or not (false). Default: true.
%
%   Display       View estimation progress ('on'/'off'). Default: 'off'.
%                 You can terminate a running estimation by pressing the
%                 STOP button on the progress viewer window.
%
%   InputInterSample  Intersample behavior of the input signals, which
%                     influences the estimation, simulation and prediction
%                     of continuous-time models.
%   
%   InputOffset   Specifies the offset levels present in the input signals
%                 of the estimation data. Specify as an Nu-element column
%                 vector, where Nu is the number of inputs. For estimations
%                 using multi-experiment data, specify as Nu-by-Ne matrix,
%                 where Ne is the number of experiments. The offset value
%                 InputOffset(i,j) is subtracted from the i:th input signal
%                 of the j:th experiment. Default is [] which implies no
%                 offsets. Available for estimations using time-domain data
%                 only.
%
%   OutputOffset  Specifies the output signal offset levels. Similar
%                 interpretation as InputOffset. The specified values are
%                 subtracted from the output signals before they are use
%                 for estimation.
%
%   OutputWeight  Weighting of prediction errors in multioutput
%                 estimations. Irrelevant is single output case. Specify as:  
%                 'noise': Optimal weighting is automatically computed as
%                          the inverse of the estimated noise variance.
%                          This amounts to minimizing det(E'*E/N) where E
%                          is the matrix of prediction errors and N is
%                          number of samples.
%                  Matrix: Use a positive semi-definite matrix of size
%                          equal to number of outputs. This amounts to
%                          minimizing trace(E'*E*W/N), where W is the
%                          specified matrix.
%                      []: Default. An automatic choice between 'noise' and
%                          eye(Ny) is made depending upon the nature of
%                          data, where Ny = number of outputs.
%
%   Advanced      Structure with field "MaxSize". MaxSize specifies
%                 the size of the largest matrix to be formed by the
%                 estimation algorithm. Specify as a (large) positive number.
%                 Default: 250e3.
%
%  References:
%  [1] Verhaegen, M., "Identification of the deterministic part of MIMO
%      state space models", Automatica, Vol. 30, pp. 61-74, 1994.  
%  [2] Larimore, W.E., "Canonical variate analysis in identification,
%      filtering and adaptive control", In Proc. 29th IEEE Conference on
%      Decision and Control, pp. 596-604, Honolulu, 1990. 
%  [3] Jansson, M., "Subspace identification and ARX modeling", 13'th IFAC
%      Symposium on System Identification, Rotterdam, The Netherlands,
%      2003.
%
%  See also N4SID.

%   Copyright 2010-2019 The MathWorks, Inc.
try
   obj = initOptions(idoptions.n4sid,varargin);
catch E
   throw(E);
end
