Description Usage Arguments Examples
Plotting methods for fitted nonparametric regression objects.
The plot
command creates a new plot, with the observed data as points and the fitted nonparametric estimator as a line.
The lines
command adds the nonparametric estimate to an existing plot, as a line.
1 2 3 4 5 |
x |
an |
... |
additional arguments to be passed to the plotting function, e.g. |
1 2 3 4 5 6 | m <- function(x) (x^2+1)*sin(2*pi*x*((1-x) + 4*x))
x <- sort(runif(100))
y <- m(x) + rnorm(length(x), sd=0.1)
simdata <- data.frame(x=x,y=y)
plot(local_average(simdata,h=0.02))
lines(local_average(simdata,h=0.04), col=4)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.