locfit (version 19980714-2)

plot.locfit: Plot an object of class locfit.

Description

The plot.locfit function generates grids of ploting points, followed by a call to predict.locfit. The returned object is then passed to plot.locfit.1d, plot.locfit.2d or plot.locfit.3d as appropriate.

Usage

plot.locfit(x, xlim, pv, tv, mpv, mtv, deriv, se.fit, tr,
        what, get.data, f3d, ...)

Arguments

x
locfit object.
xlim
Plotting limits. Eg. xlim=c(0,0,1,1) plots over the unit square in two dimensions. Default is bounding box of the data.
pv
Panel variables, to be varied within each panel of a plot. May be specified as a character vector, or variable numbers. There must be one or two panel variables; default is all variables in one or two dimensions; Variable 1 in th
tv
Trellis variables, to be varied from panel to panel of the plot.
mpv
Controls the plot resolution (within panels, for trellis displays). Default is 100 points in one dimension; 40 points (per dimension) in two or more dimensions.
mtv
Number of points for trellis variables; default 6.
deriv
derivative argument, to plot local slopes and curvatures. Default numeric(0). See predict.locfit documentation for more details.
se.fit
Should variability bands be plotted? Default FALSE. This is presently available for one predictor and one dimensional cross sections.
tr
Transformation function to use for plotting. Default is the inverse link function, or the identity function if derivatives are requested.
what
What to plot. See predict.locfit.
get.data
If TRUE, original data is added to the plot. Default: FALSE.
f3d
Force the locfit.3d class on the prediction object, thereby generating a trellis style plot. Default: FALSE, unless a tv argument is provided.
...
Other arguments to plot.locfit.1d, plot.locfit.2d or plot.locfit.3d as appropriate.

See Also

locfit, plot.locfit.1d, plot.locfit.2d, plot.locfit.3d, lines.locfit, predict.locfit

Examples

Run this code
x <- rnorm(100)
y <- dnorm(x)+rnorm(100)/5
plot(locfit(y~x),vband=T)
x <- cbind(rnorm(100),rnorm(100))
plot(locfit(~x),type="persp")

Run the code above in your browser using DataLab