# Generate multivariate normal datasets.
n <- c(7, 10)
Theta <- new("RNGMVNORM.Theta", c = 2, d = 2)
a.theta1(Theta, 1) <- c(8, 6)
a.theta1(Theta, 2) <- c(6, 8)
a.theta2(Theta, 1) <- c(8, 2, 2, 4)
a.theta2(Theta, 2) <- c(2, 1, 1, 4)
sim2d <- RNGMIX(model = "RNGMVNORM",
Dataset.name = paste("sim2d_", 1:2, sep = ""),
rseed = -1,
n = n,
Theta = a.Theta(Theta))
# Calculate optimal numbers of bins.
opt.k <- optbins(Dataset = sim2d@Dataset,
Rule = "Knuth equal",
kmin = 1,
kmax = 20)
opt.k
Y <- bins(Dataset = sim2d@Dataset, K = opt.k)
Y
opt.k <- optbins(Dataset = sim2d@Dataset,
Rule = "Knuth unequal",
kmin = 1,
kmax = 20)
opt.k
Y <- bins(Dataset = sim2d@Dataset, K = opt.k)
Y
Run the code above in your browser using DataLab