lscv Least Squares Cross Validation Statistic. lscv

Usage:


lscv(x, ..., exact=F)

Description:

The calling sequence for lscv matches those for the locfit or locfit.raw functions. Note that this function is only designed for density estimation in one dimension. The returned object contains the least squares cross validation score for the fit.

The computation of \int \hat f(x)^2 dx is performed numerically. For kernel density estimation, this is unlikely to agree exactly with other LSCV routines, which may perform the integration analytically.

Arguments:

x
model formula (or numeric vector, if exact=T)
...
other arguments to locfit or lscv.exact
exact
By default, the computation is approximate. If exact=TRUE, exact computation using lscv.exact is performed. This uses kernel density estimation with a constant bandwidth.

Value:

A vector consisting of the LSCV statistic and fitted degrees of freedom.

Examples:


# approximate calculation for a kernel density estimate
lscv(~geyser, alpha=cbind(0,1), ev="grid", mg=100, deg=0,
  flim=c(1,6), kern="gauss")
[1] -0.3648199  3.3894323
# same computation, exact
> lscv(geyser,alpha=1,exact=T)
[1] -0.3649103  3.3871090

See Also:

locfit, locfit.raw, lscv.exact lscvplot

Key Words:

locfit
  Locfit Home   Help Index  

Built: Fri Nov 10 18:52:58 EST 2000
Copyright © 2000, Lucent Technologies
Author: Catherine Loader