nnr {assist}R Documentation

Nonlinear Non-parametric Regression

Description

Fit a nonlinear nonparametric regression models with spline smoothing based on extended Gauss-Newton/Newton-Raphson and backfitting.

Usage

nnr(formula, func, spar="v", data=list(),
    start=list(),verbose=FALSE,  control=list())

Arguments

formula

a model formula, with the response on the left of a \mbox{\textasciitilde} operator and on the right an expression representing the mean function with a nonparametric function appearing with a symbol, e.g. f.

func

a required formula specifying the spline components necessary to estimate the non-parametric function. On the left of a \mbox{\textasciitilde} operator is the unknow function symbol as well as its arguments, while the right side is a list of two components, an optional nb and a required rk. nb and rk are similar to formula and rk in ssr. A missing nb denotes an empty null space.

spar

a character string specifying a method for choosing the smoothing parameter. "v", "m" and "u" represent GCV, GML and UBR respectively. Default is "v" for GCV.

data

an optional data frame.

start

a list of vectors or expressions which input inital values for the unknown functions. If expressions, the argument(s) inside should be the same as in func. The length of start should be the same as the number of unknown functions. If named, the names of the list should match those in "func". If not named, the order of the list is taken as that appearing in "func".

verbose

an optional logical numerical value. If TRUE, information on the evolution of the iterative algorithm is printed. Default is FALSE.

control

an optional list of control values to be used. See nnr.control for details.

Details

A nonlinear nonparametric model is fitted using the algorithms developed in Ke and Wang (2002).

Value

an object of class nnr is returned, containing fitted values, fitted function values as well as other information used to assess the estimate.

Author(s)

Chunlei Ke chunlei_ke@yahoo.com and Yuedong Wang yuedong@pstat.ucsb.edu.

References

Ke, C. and Wang, Y. (2002). Nonlinear Nonparametric Regression Models. Submitted.

See Also

nnr.control, ssr, print.nnr, summary.nnr, intervals.nnr

Examples

## Not run: 
x<- 1:100/100
y<- exp(sin(2*pi*x))+0.3*rnorm(x)
fit<- nnr(y~exp(f(x)), func=list(f(u)~list(~u, cubic(u))), start=list(0))

## fit a generalized varying coefficient models
data(Arosa)
Arosa$csmonth <- (Arosa$month-0.5)/12
Arosa$csyear <- (Arosa$year-1)/45
ozone.vc.fit <- nnr(thick~f1(csyear)+exp(f2(csyear))*f3(csmonth),
        func=list(f1(x)~list(~I(x-.5),cubic(x)), f2(x)~list(~I(x-.5)-1,cubic(x)),
        f3(x)~list(~sin(2*pi*x)+cos(2*pi*x)-1,lspline(x,type="sine0"))),
        data=Arosa[Arosa$year%%2==1,], spar="m", start=list(f1=mean(thick),f2=0,f3=sin(csmonth)),
        control=list(backfit=1))

## End(Not run)

[Package assist version 3.1.9 Index]