Description Usage Arguments Value Examples
Kernel density estimation for classified data
1 2 3 4 5 6 7 8 9 10 |
xclass |
classified values; matrix with two columns: lower and upper value |
burnin |
burn-in sample size |
samples |
sampling iteration size |
boundary |
TRUE for positive only data (no positive density for negative values) |
bw |
bandwidth selector method, defaults to "nrd0" see |
evalpoints |
number of evaluation grid points |
adjust |
as in |
dFunc |
character optional density (with "d", "p" and "q" functions) function name for parametric estimation such as "norm" "gamma" or "lnorm" |
The function returns a list object with the following objects (besides all input objects):
|
kde object containing the corrected density estimate |
|
Vector Grid on which density is evaluated |
|
Matrix with Estimated Density for each iteration |
|
Matrix of true latent values X estimates |
1 2 3 4 5 6 | x=rlnorm(500, meanlog = 8, sdlog = 1)
classes <- c(0,500,1000,1500,2000,2500,3000,4000,5000,6000,8000,10000,15000,Inf)
xclass <- cut(x,breaks=classes)
xclass <- cbind(classes[as.numeric(xclass)], classes[as.numeric(xclass) + 1])
densityEst <- dclass(xclass=xclass, burnin=20, samples=50, evalpoints=1000)
plot(densityEst$Mestimates~densityEst$gridx ,lwd=2, type = "l")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.