Last chance! 50% off unlimited learning
Sale ends in
crit
function, which
computes the critical value for the confidence bands. The method requires both the weight diagrams l(x), the
derivative l'(x) and (in 2 or more dimensions) the second
derivatives l''(x).
These are implemented exactly for a constant bandwidth; that
is, alpha=c(0,h)
for some h
. For nearest
neighbor bandwidths, the computations are approximate and a warning
is produced.
The theoretical justification for the bands uses normality of the random errors $e_1,\dots,e_n$ in the regression model, and in particular the spherical symmetry of the error vector. For non-normal distributions, and likelihood models, one relies on central limit and related theorems.
Computation uses the product Simpson's rule to evaluate the
multidimensional integrals (The domain of integration, and
hence the region of simultaneous coverage, is determined by
the flim
argument). Expect the integration to be slow in more
than one dimension. The mint
argument controls the
precision.
kappa0(formula, cov=0.95, ...)
"locfit"
object can also
be provided; in this case the formula and other arguments are extracted
from this object.locfit
. Important arguments
include flim
and alpha
.plot.locfit
as the
crit
argument.locfit
, plot.locfit
,
crit
, crit<-
.# compute and plot simultaneous confidence bands
data(ethanol)
fit <- locfit(NOx~E,data=ethanol)
crit(fit) <- kappa0(NOx~E,data=ethanol)
plot(fit,crit=crit,band="local")
Run the code above in your browser using DataLab