fitLoess {spconf} | R Documentation |
Fit a loess curve
Description
Wrapper function for fitting and predicting from loess()
.
Usage
fitLoess(y, x, newx = x, span = 0.5, ...)
Arguments
y |
Dependent variable values |
x |
Independent variable values |
newx |
Values of x to use for prediction. |
span |
Controls the amount of smoothing. Passed to |
... |
Additional arguments passed to |
Value
A vector of the same length of newx
providing the predictions from a loess smooth.
Examples
x <- seq(0, 5, length=50)
y <- cos(4*x) + rnorm(50, sd=0.5)
xplot <- seq(0, 5, length=200)
lfit <- fitLoess(y=y, x=x, newx=xplot, span=0.2)
plot(x, y)
points(xplot, lfit, type="l")
[Package spconf version 1.0.1 Index]