X-Git-Url: https://git.auder.net/?a=blobdiff_plain;f=pkg%2FR%2FinitSmallEM.R;h=179822fd0b9193d15c15c4ae3389aa25ed63fef4;hb=923ed737d0fa335b858204b813c964432488abbe;hp=ba95586613b86424cfcc9c95c4d97848e79355e8;hpb=96b591b7a76da9780e766ead693eb065281b6d62;p=valse.git diff --git a/pkg/R/initSmallEM.R b/pkg/R/initSmallEM.R index ba95586..179822f 100644 --- a/pkg/R/initSmallEM.R +++ b/pkg/R/initSmallEM.R @@ -8,11 +8,11 @@ #' @export #' @importFrom methods new #' @importFrom stats cutree dist hclust runif -initSmallEM <- function(k, X, Y, fast = TRUE) +initSmallEM <- function(k, X, Y, fast) { - n <- nrow(Y) - m <- ncol(Y) + n <- nrow(X) p <- ncol(X) + m <- ncol(Y) nIte <- 20 Zinit1 <- array(0, dim = c(n, nIte)) betaInit1 <- array(0, dim = c(p, m, k, nIte)) @@ -67,8 +67,7 @@ initSmallEM <- function(k, X, Y, fast = TRUE) init_EMG <- EMGLLF(phiInit1[, , , repet], rhoInit1[, , , repet], piInit1[repet, ], gamInit1[, , repet], miniInit, maxiInit, gamma = 1, lambda = 0, X, Y, eps = 1e-04, fast) - LLFEessai <- init_EMG$LLF - LLFinit1[repet] <- LLFEessai[length(LLFEessai)] + LLFinit1[[repet]] <- init_EMG$llh } b <- which.min(LLFinit1) phiInit <- phiInit1[, , , b]