Kernel density estimation coefficient

300 Views Asked by At

I have a hard time understanding the meaning of coefficient $\frac{1}{nh}$ in KDE formula: $$\hat f_h(x) = \frac{1}{nh}\sum_{i=1}^nK\left(\frac{x-X_i}{h}\right),$$ where kernel is: $$K(y)=\frac{1}{\sqrt{2\pi}}exp(-\frac{y^2}{2})$$

What is the meaning/goal of this coefficient? I have a feeling that $\frac{1}{n}$ is something like uniform weights, but what's the point of $\frac{1}{h}$?

Thank you.

1

There are 1 best solutions below

3
On BEST ANSWER

I always interpreted the formula as consisting of two parts. Given a kernel $K$ (in your case Gaussian but others are possible) you can define a rescaled version, say $\dot{K}$, as \begin{align} \dot{K}(x) = \frac{1}{h}K\left(\frac{x}{h}\right). \end{align} As you see changing $h$ therefore effectively changes the width of the kernel (and $\dot{K}$ is still a proper density function). If your kernel $K$ has a finite support, say $[-1,1]$, changing $h$ will change which points get zero weight (as you change the support of $\dot{K}$) and which points get a positive weight. As the Gaussian kernel is supported on $\mathbb{R}$ there is no hard cut-off in this case (so the effect is maybe less clear). The second part of the formula is a simple average. With $\dot{K}$ we can rewrite $\hat{f}_h(x)$ as \begin{align} \hat{f}_h(x) &= \frac{1}{n} \sum_{i=1}^n \dot{K}(x - X_i)\\ &= \frac{1}{n} \sum_{i=1}^n \frac{1}{h}K\left(\frac{x - X_i}{h}\right)\\ &= \frac{1}{nh} \sum_{i=1}^n K\left(\frac{x - X_i}{h}\right). \end{align} As you see the $(nh)^{-1}$ part is partly due to averaging $\dot{K}$ at the points $x-X_i$, and partly due to the bandwidth $h$ which will determine the weight that points far away from $x$ receive.