From: Benjamin Auder Date: Wed, 25 Jan 2017 09:50:58 +0000 (+0100) Subject: fix EMGLLF.R line 64: sum(gam,1) in MATLAB is colSums(gam) in R X-Git-Url: https://git.auder.net/variants/Cwda/current/doc/%3C?a=commitdiff_plain;h=87fea89ab747b5b7f4d8ff5de429ea9fe8e6a4b4;p=valse.git fix EMGLLF.R line 64: sum(gam,1) in MATLAB is colSums(gam) in R --- 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 +}