statset - Create statistics options structure

Syntax

statset
statset(statfun)
options = statset(...)
options = statset(fieldname1,val1,fieldname2,val2,...)
options = statset(oldopts,fieldname1,val1,fieldname2,val2,...)
options = statset(oldopts,newopts)

Description

statset with no input arguments and no output arguments displays all fields of a statistics options structure and their possible values.

statset(statfun) displays fields and default values used by the Statistics Toolbox™ function statfun. Specify statfun using a string name or a function handle.

options = statset(...) creates a statistics options structure options. With no input arguments, all fields of the options structure are set to []. With a specified statfun, function-specific fields are set to default values and the remaining fields are set to []. Function-specific fields set to [] indicate that the function is to use its default value for that parameter.

options = statset(fieldname1,val1,fieldname2,val2,...) creates an options structure in which the named fields have the specified values. Any unspecified values are set to []. Use strings for field names. For fields that are string-valued, the complete string is required for the value. If an invalid string is provided for a value, the default is used.

options = statset(oldopts,fieldname1,val1,fieldname2,val2,...) creates a copy of oldopts with the named parameters changed to the specified values.

options = statset(oldopts,newopts) combines an existing options structure, oldopts, with a new options structure, newopts. Any parameters in newopts with nonempty values overwrite corresponding parameters in oldopts.

Options

The following table lists the fields of a statistics options structure, the parameters they contain, and their possible values.

FieldParameterValues
DerivStep

Relative difference used in finite difference derivative calculations.

A positive scalar, or a vector of positive scalars the same size as the vector of parameters estimated by the Statistics Toolbox function using the options structure.

Display

Amount of information displayed by the algorithm.

  • 'off' — Displays no information.

  • 'final' — Displays the final output.

  • 'iter' — Displays iterative output to the command window for some functions; otherwise displays the final output.

FunValCheck

Check for invalid values, such as NaN or Inf, from the objective function.

  • 'off'

  • 'on'

GradObj

Flags whether or not the objective function returns a gradient vector as a second output.

  • 'off'

  • 'on'

MaxFunEvals

Maximum number of objective function evaluations allowed.

Positive integer.

MaxIter

Maximum number of iterations allowed.

Positive integer.

Robust

Invoke robust fitting option.

  • 'off'

  • 'on'

TolBnd

Parameter bound tolerance.

Positive scalar.

TolFun

Termination tolerance for the objective function value.

Positive scalar.

TolTypeFun

Use TolFun for absolute or relative objective function tolerances.

  • 'abs'

  • 'rel'

TolTypeX

Use TolX for absolute or relative parameter tolerances.

  • 'abs'

  • 'rel'

TolX

Termination tolerance for the parameters.

Positive scalar.

Tune

The tuning constant used in robust fitting to normalize the residuals before applying the weight function. The default value depends upon the weight function. This parameter is required if the weight function is specified as a function handle.

Positive scalar.

WgtFun

A weight function for robust fitting. Valid only when Robust is 'on'. Can also be a function handle that accepts a normalized residual as input and returns the robust weights as output.

  • 'bisquare'

  • 'andrews'

  • 'cauchy'

  • 'fair'

  • 'huber'

  • 'logistic'

  • 'talwar'

  • 'welsch'

Example

Suppose you want to change the default parameter values for the function evfit, which fits an extreme value distribution to data. The defaults parameter values are:

statset('evfit')
ans = 
        Display: 'off'
    MaxFunEvals: []
        MaxIter: []
         TolBnd: []
         TolFun: []
           TolX: 1.0000e-006
        GradObj: []
      DerivStep: []
    FunValCheck: []
         Robust: []
         WgtFun: []
           Tune: []

The only parameters that evfit uses are Display and TolX. To create an options structure with the value of TolX set to 1e-8, enter:

options = statset('TolX',1e-8)
options = 
        Display: []
    MaxFunEvals: []
        MaxIter: []
         TolBnd: []
         TolFun: []
           TolX: 1.0000e-008
        GradObj: []
      DerivStep: []
    FunValCheck: []
         Robust: []
         WgtFun: []
           Tune: []

Pass options to evfit as follows:

mu = 1;
sigma = 1;
data = evrnd(mu,sigma,1,100);

paramhat = evfit(data,[],[],[],options)
paramhat =
    0.9051    1.0193

This call to evfit uses the default value of Display and the value of 1e-8 for TolX.

See Also

statget

  


 © 1984-2008- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS