-EMGLLF = function(phiInit,rhoInit,piInit,gamInit,mini,maxi,gamma,lambda,X,Y,tau)
+EMGLLF_R = function(phiInit,rhoInit,piInit,gamInit,mini,maxi,gamma,lambda,X,Y,tau)
{
#matrix dimensions
n = dim(X)[1]
Gam = matrix(0, n,k)
EPS = 1E-15
- while(ite <= mini || (ite<= maxi && (dist>= tau || dist2 >= sqrt(tau))))
+ while(ite <= mini || (ite <= maxi && (dist >= tau || dist2 >= sqrt(tau))))
{
Phi = phi
Rho = rho
#helper to always have matrices as arg (TODO: put this elsewhere? improve?)
+# --> Yes, we should use by-columns storage everywhere... [later!]
matricize <- function(X)
{
if (!is.matrix(X))
}
require(MASS)
-EMGrank = function(Pi, Rho, mini, maxi, X, Y, tau, rank)
+EMGrank_R = function(Pi, Rho, mini, maxi, X, Y, tau, rank)
{
#matrix dimensions
n = dim(X)[1]
write.table(as.integer(c(n,p,m,k)), paste(testFolder,"dimensions",sep=""),
row.names=F, col.names=F)
- res = EMGLLF(params$phiInit,params$rhoInit,params$piInit,params$gamInit,mini,maxi,
+ res = EMGLLF_R(params$phiInit,params$rhoInit,params$piInit,params$gamInit,mini,maxi,
gamma,lambda,xy$X,xy$Y,tau)
#save outputs
write.table(as.integer(c(n,p,m,k)), paste(testFolder,"dimensions",sep=""),
row.names=F, col.names=F)
- res = EMGrank(pi,rho,mini,maxi,xy$X,xy$Y,tau,rank)
+ res = EMGrank_R(pi,rho,mini,maxi,xy$X,xy$Y,tau,rank)
#save output
write.table(as.double(res$phi), paste(testFolder,"phi",sep=""), row.names=F,col.names=F)