nlsnm: Least Square estimate.

Description Usage Arguments Details Value Note Author(s) References See Also Examples

View source: R/nlsnm.R

Description

Least Square estimate of a nonlinear function, Using Nelder Mead derivative free optimization method.

Usage

1
2
3
  nlsnm(formula, data, start = getInitial(formula, data), delta = NULL, 
  control = nlr.control(tolerance = 1e-04, 
  maxiter = 100 * length(start)), vm = NULL, rm = NULL, ...)

Arguments

formula

nl.form object of the nonlinear function model. See nl.form object.

data

list of data with the response and predictor as name of variable.

start

list of starting value parameter, name of parameters must be represented as names of variable in the list.

control

nlr.control object, include tolerance, maxiter,... see nlr.control.

vm

NULL, optional covariance matrix of residuals, used for nonlinear generalized M-estimate.

rm

optional correlation matrix, used for nonlinear generalized M-estimate. rm is correlation matrix of vm, thus only vm is enough to be given. It can be given by user also but not necessary automatically will be calculated by argument eiginv(t(chol(vm))).

delta

increament of Nelder Mead method, default will be calculated 10% of parameter values, in the case of nonconvergence it can be modified manually to acheive convergence.

...

any other argument passed to formula, robfnc, or optimization function.

Details

Nelder Mead is derivative free optimization method. It is used to minimize the square loss function. This method is very slow and sugest to use with a large maximum number of iterations.

Value

result is object of nl.fitt (nonlinear fitt robust) for homogeneous variance, and nl.fitt.gn for generalized fitt when covariance or correlation matrix is given.

parameters

nonlinear regression parameter estimate of θ.

correlation

of fited model.

form

nl.form object of called nonlinear regression model.

response

computed response.

predictor

computed (right side of formula) at estimated parameter with gradient and hessian attributes.

curvature

list of curvatures, see curvature function.

history

matrix of convergence history, collumns include: convergence index, parameters, minimized objective function, convergence criterion values, or other values. These values will be used in plot function in ploting history.

method

fittmethod object of method used for fitt.

data

list of called data.

sourcefnc

Object of class "callorNULL" source function called for fitt.

Fault

Fault object of error, if no error Fault number = 0 will return back.

if vm is not NULL the nl.fitt.rgn include following extra slots:

vm

covariance matrix, diagonal of variance model predicted values.

rm

cholesky decomposition of vm.

gresponse

transformed of response by rm, include gradinet and hessian attributes.

gpredictor

transformed of predictor by rm, include gradinet and hessian attributes.

Note

This is a slow algorithm, since "nlr" is designed for derivative based, when the gradient does not exist recomend to use this function. When the gradient exists it is strongly recomend to use derivative base methods.

This function call by nlr, for compatibility it is better to call from nlr rather than directly by user.

Author(s)

Maria L. Rizzo

References

Statistical Computing with R, Maria L. Rizzo, 2008, Chopman & Hall/CRC

See Also

nlmest.NLM, nl.form, nlsqr

Examples

1
2
## The function is currently defined as
"nlsnm"

nlr documentation built on July 31, 2019, 5:09 p.m.

Related to nlsnm in nlr...