residmin_stat (optim_doc)

### 2.4 Statistics for residual minimization ¶

Function File: `info =` residmin_stat `(f, p, settings)` ¶

  Frontend for computation of statistics for a residual-based minimization.

  settings is a structure whose fields can be set by `optimset`. With settings the computation of certain statistics is requested by setting the fields `ret_<name_of_statistic>` to `true`. The respective statistics will be returned in a structure as fields with name `<name_of_statistic>`. Depending on the requested statistic and on the additional information provided in settings, f and p may be empty. Otherwise, f is the model function of an optimization (the interface of f is described e.g. in `nonlin_residmin`, please see there), and p is a real column vector with parameters resulting from the same optimization.

  Currently, the following statistics (or general information) can be requested (the `ret_` is prepended so that the option name is complete):

  `ret_dfdp`: Jacobian of model function with respect to parameters.

  `ret_covd`: Covariance matrix of data (typically guessed by applying a factor to the covariance matrix of the residuals).

  `ret_covp`: Covariance matrix of final parameters.

  `ret_corp`: Correlation matrix of final parameters.

  See also: curvefit_stat.

#### Further settings ¶

The fields of the settings structure can be set with optimset.

For settings common to all frontends see Options common to all frontends.

#### Additional settings: ¶

`objf_type`

  Type of objective function of the optimization; must be specified in many cases. This determines which backends to use. Currently, there are only backends for the type "wls" (weighted least squares).

`residuals`
`covd`

  Optional information on the result of optimization, residuals and covariance matrix of data, respectively.

`weights`

  Array of weights applied to the residuals in the previous optimization. Dimensions must match those of the residuals.

`dfdp`

  Can be set in the same way and has the same default as in `nonlin_residmin` ( see Frontend nonlin_residmin for non-linear residual minimization), but alternatively may already contain the computed Jacobian of the model function at the final parameters in matrix- or structure-form.

`complex_step_derivative_f`

  Estimate Jacobian of model function with complex step derivative approximation. Use only if you know that your model function is suitable for this. No user function for the Jacobian (`dfdp`) must be specified.

#### Structure based parameter handling ¶

Please see Handling of structures of optimized parameters.

#### Backend information ¶

Please see Functions for optimization of a model function returning an array and choose backend from menu under ‘Statistics backends’.