Learn R Programming

gamlss.nl (version 4.1-0)

nl: Functions to fit nonlinear additive models in GAMLSS

Description

The function nl.obs generate a nonlinear object which can be used to fit a nonlinear additive model within the gamlss algorithm. The function nl takes the nonlinear object created by nl.obs and returns it with several attributes which are used in the function gamlss.nl() which is doing the actual fitting within the backfitting function additive.fit. The actual fit is done by the R function nlm. The function gamlss.nl() is never used on its own).

Usage

nl.obj(formula, start, data) nl(obj) gamlss.nl(x, y, w, xeval = NULL)

Arguments

formula
a non linear formula or function
start
starting values for the parameters in the formula
data
data where the formula can be interpreted
obj
a non linear object created by nl.obj
x
the nl object from nl
y
iterative y variable
w
iterative weights
xeval
used in prediction if implemented

Value

The function nl.obs returns a non linear object by using the Jim Lindsey's function finterp found in the R package rmutil.The function nl returns a vector with values zero to be included in the design matrix but with attributes useful in the fitting the non linear model.

Details

The function gamlss.nl() is an internal function of GAMLSS allowing the use of the nlm function to be used within the backfitting cycle of gamlss, and should be not used on its own.

References

http://popgen.unimaas.nl/~jlindsey/index.html: Jim Lindsey web page

Rigby, R. A. and Stasinopoulos D. M. (2005). Generalized additive models for location, scale and shape,(with discussion), Appl. Statist., 54, part 3, pp 507-554. Stasinopoulos D. M., Rigby R.A. and Akantziliotou C. (2003) Instructions on how to use the GAMLSS package in R. Accompanying documentation in the current GAMLSS help files, (see also http://www.gamlss.com/).

See Also

nlgamlss

Examples

Run this code
data(la)
nlo<-nl.obj(formula=~bflow*(1-(1-exp(p1))*exp(-p2/bflow)), start=c(-.9, 90), data=la)
mod1<-gamlss(PET60~nl(nlo)-1, data=la ) 

Run the code above in your browser using DataLab