X-Git-Url: https://git.auder.net/?p=valse.git;a=blobdiff_plain;f=pkg%2FR%2FselectVariables.R;fp=pkg%2FR%2FselectVariables.R;h=eb6c5907060287b237220c7c1c59fdf4dace1003;hp=bab45cccee4f7bf1d39aa48dc8f13a33d04eaae9;hb=0ba1b11c49d7b2a0cae493200793c1ba3fb8b8e7;hpb=4c4b3888e07594f0bacdd2b60ffc97aa61600643 diff --git a/pkg/R/selectVariables.R b/pkg/R/selectVariables.R index bab45cc..eb6c590 100644 --- a/pkg/R/selectVariables.R +++ b/pkg/R/selectVariables.R @@ -1,4 +1,4 @@ -#' selectVariables +#' selectVariables #' #' It is a function which construct, for a given lambda, the sets of relevant variables. #' @@ -22,19 +22,19 @@ #' #' @export #' -selectVariables <- function(phiInit, rhoInit, piInit, gamInit, mini, maxi, gamma, +selectVariables <- function(phiInit, rhoInit, piInit, gamInit, mini, maxi, gamma, glambda, X, Y, thresh = 1e-08, eps, ncores = 3, fast) { if (ncores > 1) { cl <- parallel::makeCluster(ncores, outfile = "") - parallel::clusterExport(cl = cl, varlist = c("phiInit", "rhoInit", "gamInit", + parallel::clusterExport(cl = cl, varlist = c("phiInit", "rhoInit", "gamInit", "mini", "maxi", "glambda", "X", "Y", "thresh", "eps"), envir = environment()) } # Computation for a fixed lambda computeCoefs <- function(lambda) { - params <- EMGLLF(phiInit, rhoInit, piInit, gamInit, mini, maxi, gamma, lambda, + params <- EMGLLF(phiInit, rhoInit, piInit, gamInit, mini, maxi, gamma, lambda, X, Y, eps, fast) p <- ncol(X) @@ -65,9 +65,9 @@ selectVariables <- function(phiInit, rhoInit, piInit, gamInit, mini, maxi, gamma } else { lapply(glambda, computeCoefs) } - if (ncores > 1) + if (ncores > 1) parallel::stopCluster(cl) - + print(out) # Suppress models which are computed twice En fait, ca ca fait la comparaison de # tous les parametres On veut juste supprimer ceux qui ont les memes variables