convexpr2nlform: Convert 'expression' to 'nl.form'

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

View source: R/convexpr2nlform.R

Description

Convert two sided (or one sided) expression formula to nl.form object using derive3 from MASS library.

Usage

1
convexpr2nlform(form, namesdata=NULL, start, inv = NULL, name="User Defined",...)

Arguments

form

Must be one sided expression (defined by ~formula) or two sided (response~predictor), nonlinear regression function, include parameters, response and predictor variables.

namesdata

optional character vector of name of data include independent and possibly dependent in two sided fomula.

start

list of parameters, for which the gradinet and hessian will be computed.

name

A character name for the model

inv

inverse of the nonlinear functin model

...

Ane extra argument pass to nl.form

Details

nlr package is gradient based algorithm, is based nl.form object in which gradient and hessian is available. If a nonlinear regression model formula is one sided or two sided formula and its gradient and hessian exist, the convexpr2nlform convert it to nl.form object by calling derive3 from MASS library. Although the existence of derivative is strong assumption but using advance programs can acheive high precision computing.

Value

nl.form object of the nonlinear regression function.

formula:

formula one sided or two sided with gradinet and hessian as attribute.

formtype:

="formula"

p:

=length(start) is number of parameters.

name:

="User Defined"

par:

=start parameters.

dependent

character vector of name of dependent variable.

independent:

character vector of name of independent variable.

origin:

=form

Note

If the derivatives does not exist in nlr function eplicitly the derivative option must set to derivative free. The namesdata is not functional in this version, implemented for further development. The name of parameters will be constructed from start arguments and the name of independent and dependent variables will be derived from the rest of variables embeded in the form expression.

Author(s)

Hossein Riazoshams, May 2014. Email: riazihosein@gmail.com URL http://www.riazoshams.com/nlr/

References

Rizo ML 2008 Statistical Computing with R The R Series. Chapman & Hall/CRC The R Series.

See Also

nl.form, nlr

Examples

1
2
3
## The function is currently defined as
nlf=convexpr2nlform(yr ~ (a)*(exp(-b*xr)-exp(-c*xr)), start = list(a=.05,b=4.39,c=21.6))
nlf

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

Related to convexpr2nlform in nlr...