Description Usage Arguments Details Value Author(s) References See Also Examples
Fit a local polynomial regression with automatic smoothing parameter selection. Two methods are available for the selection of the smoothing parameter: bias-corrected Akaike information criterion (aicc); and generalized cross-validation (gcv).
1 2 3 |
x |
a vector or two-column matrix of covariate values. |
y |
a vector of response values. |
degree |
the degree of the local polynomials to be used. It can ben 0, 1 or 2. |
criterion |
the criterion for automatic smoothing parameter selection: “aicc” denotes bias-corrected AIC criterion, “gcv” denotes generalized cross-validation. |
family |
if “gaussian” fitting is by least-squares, and if “symmetric” a re-descending M estimator is used with Tukey's biweight function. |
user.span |
the user-defined parameter which controls the degree of smoothing. |
plot |
if TRUE, the fitted curve or surface will be generated. |
... |
control parameters. |
Fit a local polynomial regression with automatic smoothing parameter selection. The predictor x can either one-dimensional or two-dimensional.
An object of class “loess”.
X.F. Wang wangx6@ccf.org
Cleveland, W. S. (1979) Robust locally weighted regression and smoothing scatterplots. Journal of the American Statistical Association. 74, 829–836.
Hurvich, C.M., Simonoff, J.S., and Tsai, C.L. (1998), Smoothing Parameter Selection in Nonparametric Regression Using an Improved Akaike Information Criterion. Journal of the Royal Statistical Society B. 60, 271–293.
Golub, G., Heath, M. and Wahba, G. (1979). Generalized cross validation as a method for choosing a good ridge parameter. Technometrics. 21, 215–224.
loess
, loess.ancova
, T.L2
, T.aov
, T.var
.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | ## Fit Local Polynomial Regression with Automatic Smoothing Parameter Selection
n1 <- 100
x1 <- runif(n1,min=0, max=3)
sd1 <- 0.2
e1 <- rnorm(n1,sd=sd1)
y1 <- sin(2*x1) + e1
(y1.fit <- loess.as(x1, y1, plot=TRUE))
n2 <- 100
x21 <- runif(n2, min=0, max=3)
x22 <- runif(n2, min=0, max=3)
sd2 <- 0.25
e2 <- rnorm(n2, sd=sd2)
y2 <- sin(2*x21) + sin(2*x22) + 1 + e2
(y2.fit <- loess.as(cbind(x21, x22), y2, plot=TRUE))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.