#' rho : parametre de variance renormalisé, calculé par l'EM
#' pi : parametre des proportions renormalisé, calculé par l'EM
#' LLF : log vraisemblance associée à cet échantillon, pour les valeurs estimées des paramètres
-#' S : ... affec : ...
+#' S : ...
+#' affec : ...
#'
#' @export
EMGLLF <- function(phiInit, rhoInit, piInit, gamInit, mini, maxi, gamma, lambda,
X, Y, eps, phi = double(p * m * k), rho = double(m * m * k), pi = double(k),
LLF = double(maxi), S = double(p * m * k), affec = integer(n), n, p, m, k,
PACKAGE = "valse")
+ list(phi = phi, rho = rho, pi = pi, llh = llh, S = S, affec=affec)
}
# R version - slow but easy to read
break
}
- list(phi = phi, rho = rho, pi = pi, llh = llh, S = S)
+ affec = apply(gam, 1, which.max)
+ list(phi = phi, rho = rho, pi = pi, llh = llh, S = S, affec=affec)
}
+++ /dev/null
-m=6
-p=6
-
-covY = array(0,dim = c(m,m,2))
-covY[,,1] = diag(m)
-covY[,,2] = diag(m)
-
-Beta = array(0, dim = c(p, m, 2))
-Beta[1:4,1:4,1] = 3*diag(4)
-Beta[1:4,1:4,2] = -2*diag(4)
-
-#Data = generateXY(200, c(0.5,0.5), rep(0,p), Beta, diag(p), covY)
-#
-#Res = valse(Data$X,Data$Y, fast=FALSE, plot=FALSE, verbose = TRUE, kmax=3, size_coll_mod = 50, selecMod = "DDSE", mini = 50, maxi=100)
-#plot(Res$tableau[,3], -Res$tableau[,4])
--- /dev/null
+m=6
+p=6
+
+covY = array(0,dim = c(m,m,2))
+covY[,,1] = diag(m)
+covY[,,2] = diag(m)
+
+Beta = array(0, dim = c(p, m, 2))
+Beta[1:4,1:4,1] = 3*diag(4)
+Beta[1:4,1:4,2] = -2*diag(4)
+
+Data = generateXY(200, c(0.5,0.5), rep(0,p), Beta, diag(p), covY)
+#
+Res = valse(Data$X,Data$Y, fast=FALSE, plot=FALSE, verbose = TRUE, kmax=3, size_coll_mod = 50, selecMod = "DDSE", mini = 50, maxi=100)
+plot(Res$tableau[,3], -Res$tableau[,4])