# \donttest{
#--- EXAMPLE 1 ------------------------------------------
sig <- diag (2)
cen <- rep (1, 2)
x <- rbind(MASS::mvrnorm(108, cen * 0, sig),
MASS::mvrnorm(162, cen * 5, sig * 6 - 2),
MASS::mvrnorm(30, cen * 2.5, sig * 50))
ctl <- ctlcurves(x, k = 1:4)
ctl
## ctl-curves
plot(ctl) ## --> selecting k = 2, alpha = 0.08
## the selected model
plot(tclust(x, k = 2, alpha = 0.08, restr.fact = 7))
#--- EXAMPLE 2 ------------------------------------------
data(geyser2)
ctl <- ctlcurves(geyser2, k = 1:5)
ctl
## ctl-curves
plot(ctl) ## --> selecting k = 3, alpha = 0.08
## the selected model
plot(tclust(geyser2, k = 3, alpha = 0.08, restr.fact = 5))
#--- EXAMPLE 3 ------------------------------------------
data(swissbank)
ctl <- ctlcurves(swissbank, k = 1:5, alpha = seq (0, 0.3, by = 0.025))
ctl
## ctl-curves
plot(ctl) ## --> selecting k = 2, alpha = 0.1
## the selected model
plot(tclust(swissbank, k = 2, alpha = 0.1, restr.fact = 50))
# }
Run the code above in your browser using DataLab