# NOT RUN {
data(acidity)
acidity.obs <- unlist(acidity)
# define the MLE functions for the mean and sd:
MLE.norm.mean <- function(dat) mean(dat)
MLE.norm.sd <- function(dat){
sqrt((length(dat) - 1) / length(dat)) * sd(dat)
}
MLE.norm.list <- list("MLE.norm.mean" = MLE.norm.mean, "MLE.norm.sd" = MLE.norm.sd)
# define the range for parameter values:
norm.bound.list <- list("mean" = c(-Inf, Inf), "sd" = c(0, Inf))
# create 'datMix' object:
acidity.dM <- datMix(acidity.obs, dist = "norm", discrete = FALSE,
MLE.function = MLE.norm.list,
theta.bound.list = norm.bound.list)
# }
# NOT RUN {
set.seed(0)
res <- mix.lrt(acidity.dM, B = 50, quantile = 0.95)
plot(res)
# }
Run the code above in your browser using DataLab