function obj = spectrumestOptions(varargin)
%SPECTRUMESTOPTIONS  Creates option set for the SPECTRUMEST command.
%
%   OPT = spectrumestOptions returns the default options for SPECTRUMEST. 
%
%   OPT = spectrumestOptions('Option1',Value1,'Option2',Value2,...) uses
%   name/value pairs to override the default values for 'Option1','Option2',...
%
%   The supported options are:
%
%   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.
%                 Vector: Specify as a column vector of weights, of length
%                         matching that of the estimation data.                      
%                  'inv': Use 1./sqrt(H) as the weighting where H is the spectrum
%                         data.
%              'invsqrt': Similar to 'inv' but uses 1./H^(0.25) as the weighting.
%
%   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. Specify as 'auto' (default),
%                     'zoh','foh','bl'.
%
%   SearchMethod  The numerical search method to be used for iterative
%                 refinement. One of:
%                    'gn': Subspace Gauss-Newton least squares search
%                    'lm': Levenberg-Marquardt least squares search
%                   'gna': Subspace Gauss-Newton search with an adaptive
%                          cut-off of singular values. 
%                  'grad': Steepest descent least squares search
%                  'auto': A combination of the above schemes is tried at
%                          each iteration and the descent direction leading
%                          to the most reduction in estimation cost is used.
%                          Default.
%             'lsqnonlin': The trust region reflective algorithm provided
%                          by the Optimization Toolbox. 
%              'fmincon':  Constrained nonlinear solvers. Use
%                          SearchOptions.Algorithm to pick a solver (default
%                          solver: 'sqp').
%
%   SearchOptions Options associated with the search algorithm. The
%                 option set is dependent on the choice of SearchMethod.
%                 Commonly used options:
%                 Tolerance: Search termination tolerance. Specify as a
%                            positive number. Default: 0.01. Not available
%                            for 'lsqnonlin', 'fmincon' (use 'FunctionTolerance' instead).
%             MaxIterations: Maximum number of iterations allowed. Default:
%                            100 for 'fmincon', 20 for others.
%         FunctionTolerance: Similar to Tolerance. Available for
%                            'lsqnonlin' (default 1e-5) and 'fmincon'
%                            (default: 1e-6).
%             StepTolerance: Termination tolerance on parameter value
%                            change. Available for 'lsqnonlin' and 'fmincon'.
%                            Default: 1e-6.
%                 Algorithm: Available for 'fmincon' only. Set to one of:
%                            - 'sqp' (default)
%                            - 'trust-region-reflective'
%                            - 'interior-point' (requires Optimization Toolbox)
%                            - 'active-set' (requires Optimization Toolbox)            
%                 Refer to the "spectrumestOptions" documentation for
%                 information on all available search options.
% 
%   Advanced      Structure with field "MaxSize". Value of MaxSize specifies the size of the
%                 largest matrix formed during the estimation. Default value: 250000
%
%   See also SPECTRUMEST.

%   Copyright 2022 The MathWorks, Inc.

try
   obj = initOptions(idoptions.spectrumest,varargin);
catch E
   throw(E);
end
