Real* Rho = (Real*)malloc(m*m*k*sizeof(Real));
Real* Pi = (Real*)malloc(k*sizeof(Real));
- for (int ite=0; ite<maxi; ite++)
+ for (int ite=1; ite<=maxi; ite++)
{
copyArray(phi, Phi, p*m*k);
copyArray(rho, Rho, m*m*k);
Real last_llh = *llh;
//llh = -sumLogLLH/n + lambda*sumPen
*llh = -invN * sumLogLLH + lambda * sumPen;
- Real dist = ite==0 ? *llh : (*llh - last_llh) / (1. + fabs(*llh));
+ Real dist = ite==1 ? *llh : (*llh - last_llh) / (1. + fabs(*llh));
//Dist1 = max( abs(phi-Phi) / (1+abs(phi)) )
Real Dist1 = 0.;
free(Pi);
free(Gram2);
free(ps2);
+ free(detRho);
gsl_matrix_free(matrix);
gsl_permutation_free(permutation);
free(XiPhiR);
generateRunSaveTest_EMGLLF = function(n=200, p=15, m=10, k=3, mini=5, maxi=10,
gamma=1., lambda=0.5, tau=1e-6)
{
- testFolder = "../data/"
+ testFolder = "data/"
dir.create(testFolder, showWarnings=FALSE, mode="0755")
params = basicInitParameters(n, p, m, k)