# Generate and plot univariate normal dataset.
n <- c(998, 263, 1086, 487)
Theta <- list(pdf1 = "n",
theta1.1 = c(688, 265, 30, 934),
theta2.1 = c(72, 54, 34, 28))
normal <- RNGMIX(Dataset.name = "complex1",
rseed = -1,
n = n,
Theta = Theta)
normal
normal@Dataset[[1]][1:20,]
# Estimate number of components, component weights and component parameters.
K <- c(as.integer(1 + log2(sum(n))), # Minimum v follows Sturges rule.
as.integer(2 * sum(n)^0.5)) # Maximum v follows RootN rule.
normalest <- REBMIX(Dataset = normal@Dataset,
Preprocessing = "h",
cmax = 8,
Criterion = "BIC",
pdf = "n",
K = K[1]:K[2])
normalest
BIC(normalest)
logL(normalest)
# Plot finite mixture.
plot(normalest, nrow = 2, what = c("den", "dis"), npts = 1000)
Run the code above in your browser using DataLab