Kernel regression
- Not to be confused with Kernel principal component analysis.
Lua error in package.lua at line 80: module 'strict' not found. Kernel regression is a non-parametric technique in statistics to estimate the conditional expectation of a random variable. The objective is to find a non-linear relation between a pair of random variables X and Y.
In any nonparametric regression, the conditional expectation of a variable relative to a variable may be written:
where is an unknown function.
Contents
Nadaraya-Watson kernel regression
Nadaraya 1964 and Watson 1964 proposed to estimate as a locally weighted average, using a kernel as a weighting function. The Nadaraya-Watson estimator is:
where is a kernel with a bandwidth . The fraction is a weighting term with sum 1.
Derivation
Using the kernel density estimation for the joint distribution f(x,y) and f(x) with a kernel K,
,
we obtain the Nadaraya-Watson estimator.
Priestley-Chao kernel estimator
Gasser-Müller kernel estimator
where
Example
This example is based upon Canadian cross-section wage data consisting of a random sample taken from the 1971 Canadian Census Public Use Tapes for male individuals having common education (grade 13). There are 205 observations in total.
We consider estimating the unknown regression function using Nadaraya-Watson kernel regression via the R np package that uses automatic (data-driven) bandwidth selection; see the np vignette for an introduction to the np package.
The figure below shows the estimated regression function using a second order Gaussian kernel along with asymptotic variability bounds
Script for example
The following commands of the R programming language use the npreg() function to deliver optimal smoothing and to create the figure given above. These commands can be entered at the command prompt via cut and paste.
install.packages("np") library(np) # non parametric library data(cps71) attach(cps71) m <- npreg(logwage~age) plot(m,plot.errors.method="asymptotic", plot.errors.style="band", ylim=c(11,15.2)) points(age,logwage,cex=.25)
Related
According to Salsburg 2002, pp. 290–1, the algorithms used in kernel regression were independently developed and used in fuzzy systems: "Coming up with almost exactly the same computer algorithm, fuzzy systems and kernel density-based regressions appear to have been developed completely independently of one another."
References
- Lua error in package.lua at line 80: module 'strict' not found.
- Lua error in package.lua at line 80: module 'strict' not found.
- Lua error in package.lua at line 80: module 'strict' not found.
- Lua error in package.lua at line 80: module 'strict' not found.
- Lua error in package.lua at line 80: module 'strict' not found.
- Lua error in package.lua at line 80: module 'strict' not found.
- Lua error in package.lua at line 80: module 'strict' not found.
- Lua error in package.lua at line 80: module 'strict' not found.
- Fan, J. (1993) "Local linear regression smoothers and their minimax efficiency" Ann. Statist., 21, pp. 196–216
- Fan, J. and I. Gijbels (1992) Variable bandwidth and local linear regression smoothers, Ann. Statist., 20, pp. 2008–2036
- Fan, J. and I. Gijbels (1996) Local Polynomial Modelling and its Applications, Chapman and Hall
- Li, Q. and J. Racine (2007) Nonparametric Econometrics: Theory and Practice, Princeton University Press
- Li, D., Simar, L. and V. Zelenyuk (2014) "Generalized nonparametric smoothing with mixed discrete and continuous data" Computational Statistics and Data Analysis, 1-21. doi:10.1016/j.csda.2014.06.003
- Pagan, A. and A. Ullah (1999) Nonparametric Econometrics, Cambridge University Press.
- Racine, J. and Q. Li, (2004) "Nonparametric estimation of regression functions with both categorical and continuous data" Journal of Econometrics 119, pp. 99–130
- Park, Byeong U. & Simar, Léopold & Zelenyuk, Valentin, 2008. "Local likelihood estimation of truncated regression and its partial derivatives: Theory and application," Journal of Econometrics, Elsevier, vol. 146(1), pages 185-198, September.
Statistical implementation
kernreg2 y x, bwidth(.5) kercode(3) npoint(500) gen(kernelprediction gridofpoints)
- R: npreg (package np)
- GNU/octave mathematical program package:
External links
- Scale-adaptive kernel regression (with Matlab software).
- Tutorial of Kernel regression using spreadsheet (with Microsoft Excel).
- An online kernel regression demonstration Requires .NET 3.0 or later.
- The np package An R package that provides a variety of nonparametric and semiparametric kernel methods that seamlessly handle a mix of continuous, unordered, and ordered factor data types.