1 #' Discard models which have the same relevant variables
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 = 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))