When Bell-shaped is Far Far Away from Gaussian

THIS SITE IS STILL UNDER CONSTRUCTION. PLEASE COME BACK AFTER THIS NOTICE IS REMOVED. THANKS!

I was surprised to find the density estimation of a constant was also ``bell-shaped'' by default when a friend passed some R code to me to illustrate CLT, but I realized the reason soon.

[notice type=download]Downdload the R code here[/notice]

# png(width = 500, height = 300)
x = rep(0, 1000)
par(mfrow = c(1, 2), mar = c(4, 4, 0.1, 0.1))
plot(density(x), main = "")
plot(density(x), main = "")
rug(jitter(x))
# dev.off()

Note that I added a rug (jittered) to the right plot to tell you the true locations of the data points.

Yihui Xie /
Published in categories R language  tagged with Bell-Shaped Curve  Gaussian  Kernel Density Estimation  R Language