- varlist=c("A1","Size","Pi","Rho","mini","maxi","X","Y","tau",
- "Rank","m","phi","ncores","verbose") )
- }
-
- computeAtLambda <- function(lambdaIndex)
- {
- if (ncores > 1)
- require("valse") #workers start with an empty environment
-
- # 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)
+ varlist=c("A1","Size","Pi","Rho","mini","maxi","X","Y","eps",
+ "Rank","m","phi","ncores","verbose") )
+ }
+
+ computeAtLambda <- function(index)
+ {
+ lambdaIndex = RankLambda[index,k+1]
+ rankIndex = RankLambda[index,1:k]
+ if (ncores > 1)
+ require("valse") #workers start with an empty environment
+
+ # '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)