2
$\begingroup$

How to define the value of bandwidth when we have a vector where all the values is the same? In this case, IQR and sample variation are both equal zero and Silverman's rule also result in zero.

Using R, we have for $\vec{v} = (1,1)$ the bandwidth of 0.7835

density(c(1,1))$bw

and for $\vec{v} = (10,10)$, the value 7.834955

density(c(10,10))$bw
$\endgroup$
2
  • $\begingroup$ Why would you want to use use kernel density estimation when all the values are the same? $\endgroup$
    – onestop
    Feb 17, 2012 at 17:33
  • $\begingroup$ I use KDE for samples in general. But sometimes it happens to see a sample where all numbers are equal or that most is. For example, for the vector $\vec{x} (70,70,70,70,100)$, $IQR = 0$, and on Silvermans' rule, the bandwidth would be 0 due to $\min(s, IQR)$. $\endgroup$
    – zeferino
    Feb 17, 2012 at 19:35

1 Answer 1

1
$\begingroup$

I found an way to deal with small values of $\sigma$ or $IQR$. I believe that this is what is used in the density function:

if $\sigma$ < $\epsilon$ or $IQR < \epsilon$ than $ bandwidth = 0.9 \bar{x} n^{-0.2} $

For $\vec{x} = (1,1)$, we get 0.7834955 like in

density(c(1,1))$bw

I used $\epsilon = 10^{-6}$

$\endgroup$

Your Answer

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

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