Diff for /imach/src/imach.c between versions 1.272 and 1.273

version 1.272, 2017/06/27 10:22:40 version 1.273, 2017/06/27 11:06:02
Line 1 Line 1
 /* $Id$  /* $Id$
   $State$    $State$
   $Log$    $Log$
     Revision 1.273  2017/06/27 11:06:02  brouard
     Summary: More documentation on projections
   
   Revision 1.272  2017/06/27 10:22:40  brouard    Revision 1.272  2017/06/27 10:22:40  brouard
   Summary: Color of backprojection changed from 6 to 5(yellow)    Summary: Color of backprojection changed from 6 to 5(yellow)
   
Line 6664  void printinghtml(char fileresu[], char Line 6667  void printinghtml(char fileresu[], char
                   int lastpass, int stepm, int weightopt, char model[],\                    int lastpass, int stepm, int weightopt, char model[],\
                   int imx,int jmin, int jmax, double jmeanint,char rfileres[],\                    int imx,int jmin, int jmax, double jmeanint,char rfileres[],\
                   int popforecast, int mobilav, int prevfcast, int mobilavproj, int backcast, int estepm , \                    int popforecast, int mobilav, int prevfcast, int mobilavproj, int backcast, int estepm , \
                   double jprev1, double mprev1,double anprev1, double dateprev1, \                    double jprev1, double mprev1,double anprev1, double dateprev1, double dateproj1, double dateback1, \
                   double jprev2, double mprev2,double anprev2, double dateprev2){                    double jprev2, double mprev2,double anprev2, double dateprev2, double dateproj2, double dateback2){
   int jj1, k1, i1, cpt, k4, nres;    int jj1, k1, i1, cpt, k4, nres;
   
    fprintf(fichtm,"<ul><li><a href='#firstorder'>Result files (first order: no variance)</a>\n \     fprintf(fichtm,"<ul><li><a href='#firstorder'>Result files (first order: no variance)</a>\n \
Line 6819  divided by h: <sub>h</sub>P<sub>ij</sub> Line 6822  divided by h: <sub>h</sub>P<sub>ij</sub>
      if(prevfcast==1){       if(prevfcast==1){
        /* Projection of prevalence up to period (stable) prevalence in each health state */         /* Projection of prevalence up to period (stable) prevalence in each health state */
        for(cpt=1; cpt<=nlstate;cpt++){         for(cpt=1; cpt<=nlstate;cpt++){
          fprintf(fichtm,"<br>\n- Projection of cross-sectional prevalence (estimated with cases observed from %.1f to %.1f and mobil_average=%d) up to period (stable) prevalence in state %d. Or probability to be in state %d being in an observed weighted state (from 1 to %d). <a href=\"%s_%d-%d-%d.svg\">%s_%d-%d-%d.svg</a><br> \           fprintf(fichtm,"<br>\n- Projection of cross-sectional prevalence (estimated with cases observed from %.1f to %.1f and mobil_average=%d), from year %.1f up to year %.1f tending to period (stable) prevalence in state %d. Or probability to be in state %d being in an observed weighted state (from 1 to %d). <a href=\"%s_%d-%d-%d.svg\">%s_%d-%d-%d.svg</a><br> \
 <img src=\"%s_%d-%d-%d.svg\">", dateprev1, dateprev2, mobilavproj, cpt, cpt, nlstate, subdirf2(optionfilefiname,"PROJ_"),cpt,k1,nres,subdirf2(optionfilefiname,"PROJ_"),cpt,k1,nres,subdirf2(optionfilefiname,"PROJ_"),cpt,k1,nres);  <img src=\"%s_%d-%d-%d.svg\">", dateprev1, dateprev2, mobilavproj, dateproj1, dateproj2, cpt, cpt, nlstate, subdirf2(optionfilefiname,"PROJ_"),cpt,k1,nres,subdirf2(optionfilefiname,"PROJ_"),cpt,k1,nres,subdirf2(optionfilefiname,"PROJ_"),cpt,k1,nres);
        }         }
      }       }
      if(backcast==1){       if(backcast==1){
       /* Back projection of prevalence up to stable (mixed) back-prevalence in each health state */        /* Back projection of prevalence up to stable (mixed) back-prevalence in each health state */
        for(cpt=1; cpt<=nlstate;cpt++){         for(cpt=1; cpt<=nlstate;cpt++){
          fprintf(fichtm,"<br>\n- Back projection of cross-sectional prevalence (estimated with cases observed from %.1f to %.1f and mobil_average=%d) up to stable (mixed) back prevalence in state %d. Or probability to have been in an state %d, knowing that the person was in either state (1 or %d) with weights corresponding to observed prevalence  at different ages. <a href=\"%s_%d-%d-%d.svg\">%s_%d-%d-%d.svg</a><br> \           fprintf(fichtm,"<br>\n- Back projection of cross-sectional prevalence (estimated with cases observed from %.1f to %.1f and mobil_average=%d), \
 <img src=\"%s_%d-%d-%d.svg\">", dateprev1, dateprev2, mobilavproj, cpt, cpt, nlstate, subdirf2(optionfilefiname,"PROJB_"),cpt,k1,nres,subdirf2(optionfilefiname,"PROJB_"),cpt,k1,nres,subdirf2(optionfilefiname,"PROJB_"),cpt,k1,nres);   from year %.1f up to year %.1f (probably close to stable [mixed] back prevalence in state %d (randomness in cross-sectional prevalence is not taken into \
    account but can visually be appreciated). Or probability to have been in an state %d, knowing that the person was in either state (1 or %d) \
   with weights corresponding to observed prevalence at different ages. <a href=\"%s_%d-%d-%d.svg\">%s_%d-%d-%d.svg</a><br> \
    <img src=\"%s_%d-%d-%d.svg\">", dateprev1, dateprev2, mobilavproj, dateback1, dateback2, cpt, cpt, nlstate, subdirf2(optionfilefiname,"PROJB_"),cpt,k1,nres,subdirf2(optionfilefiname,"PROJB_"),cpt,k1,nres,subdirf2(optionfilefiname,"PROJB_"),cpt,k1,nres);
        }         }
      }       }
                     
Line 8351  set ter svg size 640, 480\nunset log y\n Line 8357  set ter svg size 640, 480\nunset log y\n
       /* for (yearp=0; yearp<=(anproj2-anproj1);yearp +=stepsize) {  */        /* for (yearp=0; yearp<=(anproj2-anproj1);yearp +=stepsize) {  */
       fprintf(ficresfb,"\n");        fprintf(ficresfb,"\n");
       fprintf(ficresfb,"\n# Back Forecasting at date %.lf/%.lf/%.lf ",jback1,mback1,anback1+yearp);        fprintf(ficresfb,"\n# Back Forecasting at date %.lf/%.lf/%.lf ",jback1,mback1,anback1+yearp);
       printf("\n# Back Forecasting at date %.lf/%.lf/%.lf ",jback1,mback1,anback1+yearp);        /* printf("\n# Back Forecasting at date %.lf/%.lf/%.lf ",jback1,mback1,anback1+yearp); */
       /* for (agec=bage; agec<=agemax-1; agec++){  /\* testing *\/ */        /* for (agec=bage; agec<=agemax-1; agec++){  /\* testing *\/ */
       for (agec=bage; agec<=fage; agec++){  /* testing */        for (agec=bage; agec<=fage; agec++){  /* testing */
         /* We compute bij at age agec over nhstepm, nhstepm decreases when agec increases because of agemax;*/          /* We compute bij at age agec over nhstepm, nhstepm decreases when agec increases because of agemax;*/
Line 10634  int main(int argc, char *argv[]) Line 10640  int main(int argc, char *argv[])
   
   double *epj, vepp;    double *epj, vepp;
   
   double dateprev1, dateprev2,jproj1=1,mproj1=1,anproj1=2000,jproj2=1,mproj2=1,anproj2=2000;    double dateprev1, dateprev2;
   double jback1=1,mback1=1,anback1=2000,jback2=1,mback2=1,anback2=2000;    double jproj1=1,mproj1=1,anproj1=2000,jproj2=1,mproj2=1,anproj2=2000, dateproj1=0, dateproj2=0;
     double jback1=1,mback1=1,anback1=2000,jback2=1,mback2=1,anback2=2000, dateback1=0, dateback2=0;
   
   double **ximort;    double **ximort;
   char *alph[]={"a","a","b","c","d","e"}, str[4]="1234";    char *alph[]={"a","a","b","c","d","e"}, str[4]="1234";
Line 12026  Please run with mle=-1 to get a correct Line 12033  Please run with mle=-1 to get a correct
           fprintf(ficlog,"prevforecast=%d starting-proj-date=%.lf/%.lf/%.lf final-proj-date=%.lf/%.lf/%.lf mobil_average=%d\n",prevfcast,jproj1,mproj1,anproj1,jproj2,mproj2,anproj2,mobilavproj);            fprintf(ficlog,"prevforecast=%d starting-proj-date=%.lf/%.lf/%.lf final-proj-date=%.lf/%.lf/%.lf mobil_average=%d\n",prevfcast,jproj1,mproj1,anproj1,jproj2,mproj2,anproj2,mobilavproj);
           fprintf(ficres,"prevforecast=%d starting-proj-date=%.lf/%.lf/%.lf final-proj-date=%.lf/%.lf/%.lf mobil_average=%d\n",prevfcast,jproj1,mproj1,anproj1,jproj2,mproj2,anproj2,mobilavproj);            fprintf(ficres,"prevforecast=%d starting-proj-date=%.lf/%.lf/%.lf final-proj-date=%.lf/%.lf/%.lf mobil_average=%d\n",prevfcast,jproj1,mproj1,anproj1,jproj2,mproj2,anproj2,mobilavproj);
           /* day and month of proj2 are not used but only year anproj2.*/            /* day and month of proj2 are not used but only year anproj2.*/
             dateproj1=anproj1+(mproj1-1)/12.+(jproj1-1)/365.;
             dateproj2=anproj2+(mproj2-1)/12.+(jproj2-1)/365.;
   
         }          }
         break;          break;
       case 12:        case 12:
Line 12041  Please run with mle=-1 to get a correct Line 12051  Please run with mle=-1 to get a correct
           fprintf(ficlog,"backcast=%d starting-back-date=%.lf/%.lf/%.lf final-back-date=%.lf/%.lf/%.lf mobil_average=%d\n",backcast,jback1,mback1,anback1,jback2,mback2,anback2,mobilavproj);            fprintf(ficlog,"backcast=%d starting-back-date=%.lf/%.lf/%.lf final-back-date=%.lf/%.lf/%.lf mobil_average=%d\n",backcast,jback1,mback1,anback1,jback2,mback2,anback2,mobilavproj);
           fprintf(ficres,"backcast=%d starting-back-date=%.lf/%.lf/%.lf final-back-date=%.lf/%.lf/%.lf mobil_average=%d\n",backcast,jback1,mback1,anback1,jback2,mback2,anback2,mobilavproj);            fprintf(ficres,"backcast=%d starting-back-date=%.lf/%.lf/%.lf final-back-date=%.lf/%.lf/%.lf mobil_average=%d\n",backcast,jback1,mback1,anback1,jback2,mback2,anback2,mobilavproj);
           /* day and month of proj2 are not used but only year anproj2.*/            /* day and month of proj2 are not used but only year anproj2.*/
             dateback1=anback1+(mback1-1)/12.+(jback1-1)/365.;
             dateback2=anback2+(mback2-1)/12.+(jback2-1)/365.;
         }          }
         break;          break;
       case 13:        case 13:
Line 12096  Please run with mle=-1 to get a correct Line 12108  Please run with mle=-1 to get a correct
     }      }
     printinghtml(fileresu,title,datafile, firstpass, lastpass, stepm, weightopt, \      printinghtml(fileresu,title,datafile, firstpass, lastpass, stepm, weightopt, \
                  model,imx,jmin,jmax,jmean,rfileres,popforecast,mobilav,prevfcast,mobilavproj,backcast, estepm, \                   model,imx,jmin,jmax,jmean,rfileres,popforecast,mobilav,prevfcast,mobilavproj,backcast, estepm, \
                  jprev1,mprev1,anprev1,dateprev1,jprev2,mprev2,anprev2,dateprev2);                   jprev1,mprev1,anprev1,dateprev1, dateproj1, dateback1,jprev2,mprev2,anprev2,dateprev2,dateproj2, dateback2);
                                   
     /*------------ free_vector  -------------*/      /*------------ free_vector  -------------*/
     /*  chdir(path); */      /*  chdir(path); */

Removed from v.1.272  
changed lines
  Added in v.1.273


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