Density estimation: why go nonparametric?
This post belongs to a series of study notes I first published in 2011, at the start of my PhD. I revised it in 2026: the mathematics was checked and corrected and the text rewritten.
This series starts with some basic ideas about density estimation and nonparametric regression. Estimating a probability density function (pdf) without assuming a parametric family is one of the simplest nonparametric problems, and it is also a building block for nonparametric regression.
The linear model and its limits
Consider the usual linear regression problem. We have explanatory variables \(X = (X_1, \ldots, X_d)^\top\) and a response \(Y\) related by
\[ Y = X^\top \beta + \varepsilon, \tag{1}\]
where \(\varepsilon\) is independent of \(X\) and \(\mathbb{E}[\varepsilon] = 0\). Equivalently, Equation 1 says that the conditional expectation of \(Y\) given \(X\) is linear:
\[ \mathbb{E}[Y \mid X] = \beta_1 X_1 + \cdots + \beta_d X_d = X^\top \beta. \tag{2}\]
For many problems Equation 2 is too rigid. The nonparametric approach replaces it with
\[ \mathbb{E}[Y \mid X] = m(X), \]
where \(m(\cdot)\) is an unknown regression function about which we only assume some smoothness.
An example
Let \(X = (X_1, X_2)\) and suppose the true model is
\[ \mathbb{E}[Y \mid X] = \beta_1 X_1 + \beta_2 X_2 + \beta_3 X_2^2. \tag{3}\]
Given a sample, you must estimate \(\mathbb{E}[Y \mid X]\) as accurately as possible, and you get one attempt: you cannot change the model after seeing that it fits badly. If you knew Equation 3, you would simply fit it. In practice you rarely know the form of \(m(\cdot)\), only that it is reasonably smooth. Estimating \(m\) under that weak assumption is nonparametric regression, and we will come back to it later.
The next posts build the tools from the simplest case: estimating the density \(f\) of a single random variable, starting with the histogram.
References
Further reading: Härdle et al. (2004); Wasserman (2006).
Series: Density estimation · Next: Histograms I