data("weibull")
n <- nrow(weibull)
## Number of classes or nearest neighbours to be processed.
K <- c(as.integer(1 + log2(sum(n))), ## Minimum v follows the Sturges rule.
as.integer(10 * log10(n))) ## Maximum v follows the log10 rule.
## Estimate number of components, component weights and component parameters.
weibullest <- REBMIX(Dataset = list(weibull),
Preprocessing = "Parzen window",
D = 0.025,
cmax = 4,
Criterion = "BIC",
Variables = "continuous",
pdf = "Weibull",
K = K[1]:K[2],
Restraints = "loose")
## Plot finite mixture.
plot(weibullest, what = c("density", "distribution", "c", "IC", "logL", "D"),
nrow = 3, ncol = 2, npts = 1000)
## Bootstrap finite mixture.
weibullboot <- boot(x = weibullest, Bootstrap = "nonparametric")
weibullboot
Run the code above in your browser using DataLab