LOCFIT


Changes

Locfit 2.0 (11/2006)
  1. All R/S-Plus versios use S4-style classes and methods. Support for S3-style classes has been dropped (w/apologies to anyone at CWRU stat. department). Some code has been made tidier (and more efficient?) as a result.
  2. Support for modules, which allow for customization of the local fit. For example, module="allcf" retains all the local coefficients, rather than the default fit and derivatives. New modules can be dynamically loaded into Locfit.
  3. Addition of a local quantile family, e.g. family=quant(0.5) to locally estimate median(Y|x).
  4. Rewritten the panel.locfit function (had caused trouble before?). Should now work equally with trellis (S) and lattice (R).

Matlab version added 6/2006.

Model Formula, smoothing parameters (12/2004)
I'm changing the way that the LOCFIT model formula, and the smoothing parameters, are specified. In particular, the predictor variables should be wrapped in the lp() function. Smoothing parameters, such as alpha and deg, are now given to lp(), instead of directly to locfit.raw().

Note also that the cryptic specification of alpha has been split into three arguments of lp(): nn (the nearest neighbor component); h (the constant component) and adpen (the adaptive penalty). The defaults are nn=0.7,h=0,adpen=0; however, if either h or adpen is provided, then nn defaults to 0.

Some examples:

> fit <- locfit(NOx~lp(E,nn=0.5))      # smooth with 50% nn bandwidth.
> fit <- locfit(NOx~lp(E,h=0.2,deg=1)) # local linear with constant h=0.2
> fit <- locfit(NOx~lp(E,C))           # bivariate smooth.
For now, only a single lp() term (and nothing else) should be given on the RHS.

The old specification will continue to (mostly) work for now, although I don't promise to maintain this in the future.

Evalution Structures (11/2004)
The way that evaluation structures are specified in a LOCFIT call has changed. Each evaluation structure now has an associated generator function. So, for example, the old command

> fit <- locfit(NOx~E,data=ethanol,ev="grid",mg=20,flim=c(0.6,0.8))
would now be specified as
> fit <- locfit(NOx~lp(E),data=ethanol,ev=gr(mg=20,ll=0.6,ur=0.8))

The available generator functions are

Alternatively, a vector/matrix of fit points can be provided.

Function names (12/2004)
knots() has been renamed lfknots(), due to a conflict with the R function of the same name.