# NOT RUN {
data(CanadianWeather)
# convert functional to MixtComp format
dat <- list(tempav = apply(CanadianWeather$tempav, 2,
function(x) createFunctional(CanadianWeather$time, x)),
precav = apply(CanadianWeather$precav, 2,
function(x) createFunctional(CanadianWeather$time, x)))
# create model with 3 subregressions ans 2 coefficients per regression
model <- list(tempav = list(type = "Func_CS", paramStr = "nSub: 4, nCoeff: 2"),
precav = list(type = "Func_CS", paramStr = "nSub: 4, nCoeff: 2"))
# create algo
algo <- createAlgo()
# run clustering
resLearn <- mixtCompLearn(dat, model, algo, nClass = 2:4, criterion = "ICL", nRun = 3)
summary(resLearn)
plot(resLearn)
getPartition(resLearn)
getTik(resLearn, log = FALSE)
# }
# NOT RUN {
# }
Run the code above in your browser using DataLab