- # on ne garde que les colonnes actives
- # 'active' sera l'ensemble des variables informatives
- active = A1[,lambdaIndex]
- active = active[-(active==0)]
- phi = array(0, dim=c(p,m,k,Size))
- llh = matrix(0, Size, 2) #log-likelihood
- if (length(active) > 0)
- {
- for (j in 1:Size)
- {
- res = EMGrank(Pi[,lambdaIndex], Rho[,,,lambdaIndex], mini, maxi,
- X[,active], Y, tau, Rank[j,], fast)
- llh = rbind(llh,
- c( res$LLF, sum(Rank[j,] * (length(active)- Rank[j,] + m)) ) )
- phi[active,,,] = rbind(phi[active,,,], res$phi)
+ # 'relevant' will be the set of relevant columns
+ selected <- S[[lambdaIndex]]$selected
+ relevant <- c()
+ for (j in 1:p)
+ {
+ if (length(selected[[j]]) > 0)
+ {
+ relevant <- c(relevant, j)