fix EMGLLF.R line 64: sum(gam,1) in MATLAB is colSums(gam) in R
authorBenjamin Auder <benjamin.auder@somewhere>
Wed, 25 Jan 2017 09:50:58 +0000 (10:50 +0100)
committerBenjamin Auder <benjamin.auder@somewhere>
Wed, 25 Jan 2017 09:50:58 +0000 (10:50 +0100)
src/test/generate_test_data/helpers/EMGLLF.R

index 94a917d..d1217ff 100644 (file)
@@ -61,7 +61,7 @@ EMGLLF = function(phiInit,rhoInit,piInit,gamInit,mini,maxi,gamma,lambda,X,Y,tau)
     for(r in 1:k){
       b[r] = sum(sum(abs(phi[,,r])))
     }
-    gam2 = sum(gam[1,])  #BIG DOUTE
+    gam2 = colSums(gam)
     a = sum(gam*t(log(Pi)))
     
     #tant que les props sont negatives
@@ -165,4 +165,4 @@ EMGLLF = function(phiInit,rhoInit,piInit,gamInit,mini,maxi,gamma,lambda,X,Y,tau)
     
   Pi = transpose(Pi)
   return(list(phi=phi, rho=rho, Pi=Pi, LLF=LLF, S=S))
-}
\ No newline at end of file
+}