#' @param fast TRUE to use compiled C code, FALSE for R code only
#' @param verbose TRUE to show some execution traces
#'
-#' @return a list with several models, defined by phi, rho, pi, llh
+#' @return a list with several models, defined by phi (the regression parameter reparametrized),
+#' rho (the covariance parameter reparametrized), pi (the proportion parameter is the mixture model), llh
+#' (the value of the loglikelihood function for this estimator on the training dataset). The list is given
+#' for several levels of sparsity, given by several regularization parameters computed automatically,
+#' and several ranks (between rank.min and rank.max).
#'
#' @export
constructionModelesLassoRank <- function(S, k, mini, maxi, X, Y, eps, rank.min, rank.max,
for (r in 1:k)
{
# On veut le tableau de toutes les combinaisons de rangs possibles, et des
- # lambdas Dans la première colonne : on répète (rank.max-rank.min)^(k-1) chaque
- # chiffre : ça remplit la colonne Dans la deuxieme : on répète
- # (rank.max-rank.min)^(k-2) chaque chiffre, et on fait ça (rank.max-rank.min)^2
- # fois ... Dans la dernière, on répète chaque chiffre une fois, et on fait ça
+ # lambdas Dans la premiere colonne : on repete (rank.max-rank.min)^(k-1) chaque
+ # chiffre : ca remplit la colonne Dans la deuxieme : on repete
+ # (rank.max-rank.min)^(k-2) chaque chiffre, et on fait ca (rank.max-rank.min)^2
+ # fois ... Dans la derniere, on repete chaque chiffre une fois, et on fait ca
# (rank.min-rank.max)^(k-1) fois.
RankLambda[, r] <- rep(rank.min + rep(0:(deltaRank - 1), deltaRank^(r - 1),
each = deltaRank^(k - r)), each = L)
# For each lambda in the grid we compute the estimators
out <-
if (ncores > 1) {
- parLapply(cl, seq_len(length(S) * Size), computeAtLambda)
+ parallel::parLapply(cl, seq_len(length(S) * Size), computeAtLambda)
} else {
lapply(seq_len(length(S) * Size), computeAtLambda)
}