# Bandwidth value for vector of equal values in kernel density estimation

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

-
Why would you want to use use kernel density estimation when all the values are the same? –  onestop Feb 17 '12 at 17:33
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)$. –  zeferino Feb 17 '12 at 19:35
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}\$