From 87fea89ab747b5b7f4d8ff5de429ea9fe8e6a4b4 Mon Sep 17 00:00:00 2001 From: Benjamin Auder <benjamin.auder@somewhere> Date: Wed, 25 Jan 2017 10:50:58 +0100 Subject: [PATCH] fix EMGLLF.R line 64: sum(gam,1) in MATLAB is colSums(gam) in R --- src/test/generate_test_data/helpers/EMGLLF.R | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/test/generate_test_data/helpers/EMGLLF.R b/src/test/generate_test_data/helpers/EMGLLF.R index 94a917d..d1217ff 100644 --- a/src/test/generate_test_data/helpers/EMGLLF.R +++ b/src/test/generate_test_data/helpers/EMGLLF.R @@ -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 +} -- 2.44.0