## parametric method
data(hhi)
cbind(hhi$mean, hhi$median)
(out1 <- bde(freq=hhi$mob,breaks=hhi$breaks, type='weibull'))
## bootKDE
(out1 <- bde(freq=hhi$mob,breaks=hhi$breaks, type='bootkde'))
plot(out1, type='l')
## smooth KDE
mu <- 34.5; s <- 1.5; n <- 1000
y <- rnorm(n,mu,s) #raw data
x <- round(y) #rounded data
xhist <- binning(x, breaks=min(x)-0.5, bw=1)
out <- bde(xhist,type='smkde')
plot(out, type="l")
## histospline
out <- bde(xhist,type='histospline')
plot(out, type="l")
## nprde
out <- bde(xhist,type='lpr')
lines(out, col=2,lwd=2)
Run the code above in your browser using DataLab