1 #' Discard models which have the same relevant variables - for EMGLLF
3 #' @param B1 array of relevant coefficients (of size p*m*length(gridlambda))
4 #' @param B2 array of irrelevant coefficients (of size p*m*length(gridlambda))
5 #' @param glambda grid of regularization parameters (vector)
6 #' @param rho covariance matrix (of size m*m*K*size(gridLambda))
7 #' @param pi weight parameters (of size K*size(gridLambda))
9 #' @return a list with update B1, B2, glambda, rho and pi, and ind the vector of indices
10 #' of selected models.
12 discardSimilarModels_EMGLLF = function(B1,B2,glambda,rho,pi)
15 for (j in 1:length(glambda))
19 if(B1[,,l] == B1[,,ll])
25 glambda = glambda[-ind]
30 return (list("B1"=B1,"B2"=B2,"glambda"=glambda,"rho"=rho,"pi"=pi,"ind"=ind))
33 #' Discard models which have the same relevant variables
34 #' - for Lasso-rank procedure (focus on columns)
36 #' @param B1 array of relevant coefficients (of size p*m*length(gridlambda))
37 #' @param rho covariance matrix
38 #' @param pi weight parameters
40 #' @return a list with B1, in, rho, pi
42 discardSimilarModels_EMGrank = function(B1,rho,pi)
46 B2 = array(0,dim=c(dim_B1[1],dim_B1[2],dim_B1[3]))
48 glambda = rep(0,sizeLambda)
50 suppressmodel = discardSimilarModels_EMGLLF(B1,B2,glambda,rho,pi)
51 return (list("B1" = suppressmodel$B1, "ind" = suppressmodel$ind,
52 "rho" = suppressmodel$rho, "pi" = suppressmodel$pi))