0
$\begingroup$

I'm trying to understand the logic behind kernel density estimation.

I found the explanation in wikipedia very useful, but I'm not capable yet, of having a full understanding of this method so I want to reproduce the example provided by wikipedia

Could anyone help me to explain kernel method via gaussian kernel by hand?

enter image description here

$\endgroup$

2 Answers 2

1
$\begingroup$

If you want to write down the formula for the density of the resulting estimate, you get simply

$$\Sigma_{i \in I}\ c\cdot\exp(d\cdot(x - x_i)^2)$$,

where $c$ and $d$ are factors that I left out, you can find them on https://en.wikipedia.org/wiki/Gaussian_function. The variance that you should use is, as explained, 2.25. ${x_i, i \in I}$ is the set of the 6 observations, -2.1, -1.3 etcetera. Note that you have to multiply each kernel with $\frac{1}{6}$ to make sure the resulting density integrates to one.

That is all you can do, there are typically no obvious simplifcations for this sum of integrals.

$\endgroup$
0
$\begingroup$

I don't have time to code up a Notebook right now, but I think the right figure from wikipedia should be pretty good at illustrating the idea: just draw a few times from any distribution and mentally arrange the data points on the real line. Then you center a normal distribution at each of these points (these are normal basis functions then), using the same variance for all (you can just pick any value to begin with and then play around to see what it does - that's what the 'bandwidth' parameter is). Then you add up the densities of each of your n normal distributions and plot the resulting function: it looks a like a density function, or continuous histogram, except that it isn't because it doesn't integrate to 1. Then you think about how you could keep the shape and make it integrate to 1 and then look at the formula again and look at what the K - the Kernel function does - and voilà, there you are.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.