# NOT RUN {
data(shakespeare)
shakespeare.obs <- unlist(shakespeare) - 1
# define the MLE function:
MLE.geom <- function(dat) 1 / (mean(dat) + 1)
Shakespeare.dM <- datMix(shakespeare.obs, dist = "geom", discrete = TRUE,
MLE.function = MLE.geom,
theta.bound.list = list(prob = c(0, 1)))
# estimate the number of components and plot the results:
# }
# NOT RUN {
set.seed(0)
res <- hellinger.boot.disc(Shakespeare.dM, B = 50, ql = 0.025, qu = 0.975)
plot(res, breaks = 100, xlim = c(0, 20))
# }
Run the code above in your browser using DataLab