Diff for /imach/src/imach.c between versions 1.246 and 1.247

version 1.246, 2016/09/02 08:49:22 version 1.247, 2016/09/02 11:11:21
Line 1 Line 1
 /* $Id$  /* $Id$
   $State$    $State$
   $Log$    $Log$
     Revision 1.247  2016/09/02 11:11:21  brouard
     *** empty log message ***
   
   Revision 1.246  2016/09/02 08:49:22  brouard    Revision 1.246  2016/09/02 08:49:22  brouard
   *** empty log message ***    *** empty log message ***
   
Line 2584  Earliest age to start was %d-%d=%d, ncvl Line 2587  Earliest age to start was %d-%d=%d, ncvl
   /* If we start from prlim again, prlim tends to a constant matrix */    /* If we start from prlim again, prlim tends to a constant matrix */
   
   int i, ii,j,k;    int i, ii,j,k;
     int first=0;
   double *min, *max, *meandiff, maxmax,sumnew=0.;    double *min, *max, *meandiff, maxmax,sumnew=0.;
   /* double **matprod2(); */ /* test */    /* double **matprod2(); */ /* test */
   double **out, cov[NCOVMAX+1], **bmij();    double **out, cov[NCOVMAX+1], **bmij();
Line 2709  Earliest age to start was %d-%d=%d, ncvl Line 2713  Earliest age to start was %d-%d=%d, ncvl
     }      }
   } /* age loop */    } /* age loop */
     /* After some age loop it doesn't converge */      /* After some age loop it doesn't converge */
   printf("Warning: the back stable prevalence at age %d did not converge with the required precision (%g > ftolpl=%g) within %.0f years. Try to lower 'ftolpl'. \n\    if(first){
       first=1;
       printf("Warning: the back stable prevalence at age %d did not converge with the required precision (%g > ftolpl=%g) within %.0f years. Try to lower 'ftolpl'. Others in log file only...\n\
   Oldest age to start was %d-%d=%d, ncvloop=%d, ncvyear=%d\n", (int)age, maxmax, ftolpl, delaymax, (int)age, (int)delaymax, (int)agefin, ncvloop, *ncvyear);
     }
     fprintf(ficlog,"Warning: the back stable prevalence at age %d did not converge with the required precision (%g > ftolpl=%g) within %.0f years. Try to lower 'ftolpl'. \n\
 Oldest age to start was %d-%d=%d, ncvloop=%d, ncvyear=%d\n", (int)age, maxmax, ftolpl, delaymax, (int)age, (int)delaymax, (int)agefin, ncvloop, *ncvyear);  Oldest age to start was %d-%d=%d, ncvloop=%d, ncvyear=%d\n", (int)age, maxmax, ftolpl, delaymax, (int)age, (int)delaymax, (int)agefin, ncvloop, *ncvyear);
   /* Try to lower 'ftol', for example from 1.e-8 to 6.e-9.\n", ftolpl, (int)age, (int)delaymax, (int)agefin, ncvloop, (int)age-(int)agefin); */    /* Try to lower 'ftol', for example from 1.e-8 to 6.e-9.\n", ftolpl, (int)age, (int)delaymax, (int)agefin, ncvloop, (int)age-(int)agefin); */
   free_vector(min,1,nlstate);    free_vector(min,1,nlstate);
Line 3596  double funcone( double *x) Line 3605  double funcone( double *x)
       agebegin=agev[mw[mi][i]][i]; /* Age at beginning of effective wave */        agebegin=agev[mw[mi][i]][i]; /* Age at beginning of effective wave */
       ageend=agev[mw[mi][i]][i] + (dh[mi][i])*stepm/YEARM; /* Age at end of effective wave and at the end of transition */        ageend=agev[mw[mi][i]][i] + (dh[mi][i])*stepm/YEARM; /* Age at end of effective wave and at the end of transition */
       for(d=0; d<dh[mi][i]; d++){  /* Delay between two effective waves */        for(d=0; d<dh[mi][i]; d++){  /* Delay between two effective waves */
         /* for(d=0; d<=0; d++){  /\* Delay between two effective waves Only one matrix to speed up*\/ */
         /*dh[m][i] or dh[mw[mi][i]][i] is the delay between two effective waves m=mw[mi][i]          /*dh[m][i] or dh[mw[mi][i]][i] is the delay between two effective waves m=mw[mi][i]
           and mw[mi+1][i]. dh depends on stepm.*/            and mw[mi+1][i]. dh depends on stepm.*/
         newm=savm;          newm=savm;
         agexact=agev[mw[mi][i]][i]+d*stepm/YEARM;          agexact=agev[mw[mi][i]][i]+d*stepm/YEARM;  /* Here d is needed */
         cov[2]=agexact;          cov[2]=agexact;
         if(nagesqr==1)          if(nagesqr==1)
           cov[3]= agexact*agexact;            cov[3]= agexact*agexact;
Line 9877  int main(int argc, char *argv[]) Line 9887  int main(int argc, char *argv[])
   delti=delti3[1][1];    delti=delti3[1][1];
   /*delti=vector(1,npar); *//* Scale of each paramater (output from hesscov)*/    /*delti=vector(1,npar); *//* Scale of each paramater (output from hesscov)*/
   if(mle==-1){ /* Print a wizard for help writing covariance matrix */    if(mle==-1){ /* Print a wizard for help writing covariance matrix */
   /* We could also provide initial parameters values giving by simple logistic regression 
    * only one way, that is without matrix product. We will have nlstate maximizations */
         /* for(i=1;i<nlstate;i++){ */
         /*        /\*reducing xi for 1 to npar to 1 to ncovmodel; *\/ */
         /*    mlikeli(ficres,p, ncovmodel, ncovmodel, nlstate, ftol, funcnoprod); */
         /* } */
     prwizard(ncovmodel, nlstate, ndeath, model, ficparo);      prwizard(ncovmodel, nlstate, ndeath, model, ficparo);
     printf(" You chose mle=-1, look at file %s for a template of covariance matrix \n",filereso);      printf(" You chose mle=-1, look at file %s for a template of covariance matrix \n",filereso);
     fprintf(ficlog," You chose mle=-1, look at file %s for a template of covariance matrix \n",filereso);      fprintf(ficlog," You chose mle=-1, look at file %s for a template of covariance matrix \n",filereso);
Line 10649  Please run with mle=-1 to get a correct Line 10665  Please run with mle=-1 to get a correct
     printf("\n");      printf("\n");
     if(mle>=1){ /* Could be 1 or 2, Real Maximization */      if(mle>=1){ /* Could be 1 or 2, Real Maximization */
       /* mlikeli uses func not funcone */        /* mlikeli uses func not funcone */
         /* for(i=1;i<nlstate;i++){ */
         /*        /\*reducing xi for 1 to npar to 1 to ncovmodel; *\/ */
         /*    mlikeli(ficres,p, ncovmodel, ncovmodel, nlstate, ftol, funcnoprod); */
         /* } */
       mlikeli(ficres,p, npar, ncovmodel, nlstate, ftol, func);        mlikeli(ficres,p, npar, ncovmodel, nlstate, ftol, func);
     }      }
     if(mle==0) {/* No optimization, will print the likelihoods for the datafile */      if(mle==0) {/* No optimization, will print the likelihoods for the datafile */

Removed from v.1.246  
changed lines
  Added in v.1.247


FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>