Nonparametric Regression in R
An Appendix to An R Companion to Applied Regression, Second Edition
John Fox & Sanford Weisberg
last revision: 13 December 2010
Abstract
In traditional parametric regression models, the functional form of the model is specified
before the model is fit to data, and the object is to estimate the parameters of the model. In
nonparametric regression, in contrast, the object is to estimate the regression function directly
without specifying its form explicitly. In this appendix to Fox and Weisberg (2011), we describe
how to fit several kinds of nonparametric-regression models in R, including scatterplot smoothers,
where there is a single predictor; models for multiple regression; additive regression models; and
generalized nonparametric-regression models that are analogs to generalized linear models.
1 Nonparametric Regression Models
The traditional nonlinear regression model (described in the Appendix on nonlinear regression) fits
the model
y = m(x, ) + "
where is a vector of parameters to be estimated, and x is a vector of predictors; the errors "
are assumed to be normally and independently distributed with mean 0 and constant variance 2.
The function m(x, ), relating the average value of the response y to the predictors, is specified in
advance, as it is in a linear regression model.
The general nonparametric regression model is written in a similar manner, but the function m
is left unspecified:
y = m(x) + "
= m(x1, x2, . . . , xp) + "
′
for the p predictors x = (x1, x2, . . . , xp) . Moreover, the object of nonparametric regression is to
estimate the regression function m(x) directly, rather than
R-软件中的非参数回归 来自淘豆网m.daumloan.com转载请标明出处.