- # Get summary "tableauRecap" from models ; TODO: jusqu'à ligne 114 à mon avis là c'est faux :/
- tableauRecap = t( sapply( models_list, function(models) {
- llh = do.call(rbind, lapply(models, function(model) model$llh))
- LLH = llh[-1,1]
- D = llh[-1,2]
- c(LLH, D, rep(k, length(model)), 1:length(model))
- } ))
- if (verbose)
- print('Model selection')
- tableauRecap = tableauRecap[rowSums(tableauRecap[, 2:4])!=0,]
- tableauRecap = tableauRecap[!is.infinite(tableauRecap[,1]),]
- data = cbind(1:dim(tableauRecap)[1], tableauRecap[,2], tableauRecap[,2], tableauRecap[,1])
+ # Get summary "tableauRecap" from models
+ tableauRecap = do.call( rbind, lapply( seq_along(models_list), function(i) {
+ models <- models_list[[i]]
+ #Pour un groupe de modeles (même k, différents lambda):
+ LLH <- sapply( models, function(model) model$llh )
+ k == length(models[[1]]$pi)
+ # TODO: chuis pas sûr du tout des lignes suivantes...
+ # J'ai l'impression qu'il manque des infos
+ sumPen = sapply( models, function(model)
+ sum( model$pi^gamma * sapply(1:k, function(r) sum(abs(model$phi[,,r]))) ) )
+ data.frame(model=paste(i,".",seq_along(models),sep=""),
+ pen=sumPen/1000, complexity=sumPen, contrast=LLH)
+ } ) )