Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Let $\{s_1,\ldots,s_N\}$ be a collection of N samples. I have performed the kernel density estimation using the classical form: $$ \hat{f}(x) = \frac{1}{Nh}\sum_{i=1}^N K\left(\frac{x-s_i}{h}\right) $$ where $K\left(\frac{x-s_i}{h}\right)$ is computed as a Weibull kernel, with $k=1$ and $\lambda=1$.

My question is: which is the easiest way to compute the bandwidth $h$? I am using the sample standard deviation, but it seems to be too small, i.e., the computed PDF appears too noisy at the end.


share|cite|improve this question

You could probably try to use the "rule-of-thumb" for density estimation based on the sample size and the standard deviation: $$1.06\sigma n^{-\frac{1}{5}}$$

There are several other methods, which do not depend on the chosen kernell. One popular is the cross-validation. You may check the chapter 5 in Wand and Jones "Kernel smoothing" and references therein.

share|cite|improve this answer
Does it work also for other distributions that are different from the Gaussian one? – Eleanore Feb 15 '13 at 10:55
As far as I understand it does not require that the distribution is Gaussian. In that case we are not nonparametric anymore. The assumption is that we use an estimate of the second derivative of the Gaussian density in the bandwidth selection. In other words we can estimate any density (including non Gaussian). – arkadiy Feb 15 '13 at 10:59
Have you checked if this "rule-of-thumb" works for you? – arkadiy Feb 15 '13 at 11:01
Yes I did, and this is what I got: Thus, I cannot understand whether this "noise" on the curve is coming from the bandwidth estimation or not. I guess yes. – Eleanore Feb 15 '13 at 11:08
You might also check R and the package: which has a lot of nonparameric functionality or the simple function density(x). Also your question would probalby fit more discussions on – arkadiy Feb 15 '13 at 11:31

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.