Diff for /imach/src/imach.c between versions 1.363 and 1.364

version 1.363, 2024/06/28 09:31:55 version 1.364, 2024/06/28 12:27:05
Line 1 Line 1
 /* $Id$  /* $Id$
   $State$    $State$
   $Log$    $Log$
     Revision 1.364  2024/06/28 12:27:05  brouard
     * imach.c (Module): fixing some bugs in gnuplot and quantitative variables, but not completely solved
   
   Revision 1.363  2024/06/28 09:31:55  brouard    Revision 1.363  2024/06/28 09:31:55  brouard
   Summary: Adding log lines too    Summary: Adding log lines too
   
Line 1248  Important routines Line 1251  Important routines
 - Tricode which tests the modality of dummy variables (in order to warn with wrong or empty modalities)  - Tricode which tests the modality of dummy variables (in order to warn with wrong or empty modalities)
   and returns the number of efficient covariates cptcoveff and modalities nbcode[Tvar[k]][1]= 0 and nbcode[Tvar[k]][2]= 1 usually.    and returns the number of efficient covariates cptcoveff and modalities nbcode[Tvar[k]][1]= 0 and nbcode[Tvar[k]][2]= 1 usually.
 - printinghtml which outputs results like life expectancy in and from a state for a combination of modalities of dummy variables  - printinghtml which outputs results like life expectancy in and from a state for a combination of modalities of dummy variables
   o There are 2**cptcoveff combinations of (0,1) for cptcoveff variables. Outputting only combinations with people, eĢliminating 1 1 if    o There are 2**cptcoveff combinations of (0,1) for cptcoveff variables. Outputting only combinations with people, eliminating 1 1 if
     race White (0 0), Black vs White (1 0), Hispanic (0 1) and 1 1 being meaningless.      race White (0 0), Black vs White (1 0), Hispanic (0 1) and 1 1 being meaningless.
   
   
Line 3023  static void print2() /* print a line of Line 3026  static void print2() /* print a line of
    /* printf("%10d    %10d%14.7g",nl, nf, fx); */     /* printf("%10d    %10d%14.7g",nl, nf, fx); */
   /* printf ( "\n" ); */    /* printf ( "\n" ); */
   printf ( "  Linear searches      %d", nl );    printf ( "  Linear searches      %d", nl );
     fprintf (ficlog, "  Linear searches      %d", nl );
   /* printf ( "  Linear searches      %d\n", nl ); */    /* printf ( "  Linear searches      %d\n", nl ); */
   /* printf ( "  Function evaluations %d\n", nf ); */    /* printf ( "  Function evaluations %d\n", nf ); */
   /* printf ( "  Function value FX = %g\n", fx ); */    /* printf ( "  Function value FX = %g\n", fx ); */
Line 3038  static void print2() /* print a line of Line 3042  static void print2() /* print a line of
    {     {
      /* for(i=1;i<=n;i++)printf("%14.7g",x[i-1]); */       /* for(i=1;i<=n;i++)printf("%14.7g",x[i-1]); */
      for(i=1;i<=n;i++){       for(i=1;i<=n;i++){
        printf("%14.7g",x[i]);         printf(" %14.7g",x[i]);
        fprintf(ficlog,"%14.7g",x[i]);         fprintf(ficlog," %14.7g",x[i]);
      }       }
      /* r8vec_print ( n, x, "  X:" ); */       /* r8vec_print ( n, x, "  X:" ); */
    }     }
Line 6613  void mlikeli(FILE *ficres,double p[], in Line 6617  void mlikeli(FILE *ficres,double p[], in
 #else  /* FLATSUP */  #else  /* FLATSUP */
 /*  powell(p,xi,npar,ftol,&iter,&fret,func);*/  /*  powell(p,xi,npar,ftol,&iter,&fret,func);*/
 /*   praxis ( t0, h0, n, prin, x, beale_f ); */  /*   praxis ( t0, h0, n, prin, x, beale_f ); */
   /* int prin=1; */   int prin=4;
   /* double h0=0.25; */    /* double h0=0.25; */
   /* double macheps; */    /* double macheps; */
   /* double fmin; */    /* double fmin; */
Line 10787  set ter svg size 640, 480\nunset log y\n Line 10791  set ter svg size 640, 480\nunset log y\n
               /* vlv= nbcode[Tvaraff[k]][lv]; /\* Value of the modality of Tvaraff[k] *\/ */                /* vlv= nbcode[Tvaraff[k]][lv]; /\* Value of the modality of Tvaraff[k] *\/ */
               /* vlv= nbcode[Tvaraff[k]][codtabm(k1,TnsdVar[Tvaraff[k]])]; */                /* vlv= nbcode[Tvaraff[k]][codtabm(k1,TnsdVar[Tvaraff[k]])]; */
               kl++;                kl++;
                 /* Problem with quantitative variables TinvDoQresult[nres] */
               /* sprintf(gplotcondition+strlen(gplotcondition),"$%d==%d && $%d==%d " ,kl,Tvaraff[k], kl+1, nbcode[Tvaraff[k]][lv]); */                /* sprintf(gplotcondition+strlen(gplotcondition),"$%d==%d && $%d==%d " ,kl,Tvaraff[k], kl+1, nbcode[Tvaraff[k]][lv]); */
               sprintf(gplotcondition+strlen(gplotcondition),"$%d==%d && $%d==%d " ,kl,lv, kl+1, vlv );                sprintf(gplotcondition+strlen(gplotcondition),"$%d==%d && $%d==%lg " ,kl,lv, kl+1, vlv );/* Solved but quantitative must be shifted */
               kl++;                kl++;
               if(k <cptcovs && cptcovs>1)                if(k <cptcovs && cptcovs>1)
                 sprintf(gplotcondition+strlen(gplotcondition)," && ");                  sprintf(gplotcondition+strlen(gplotcondition)," && ");
Line 10802  set ter svg size 640, 480\nunset log y\n Line 10807  set ter svg size 640, 480\nunset log y\n
               fprintf(ficgp,"%s ? $%d/(1.-$%d) : 1/0):%d t 'p.%d' with line lc variable", gplotcondition, \                fprintf(ficgp,"%s ? $%d/(1.-$%d) : 1/0):%d t 'p.%d' with line lc variable", gplotcondition, \
                       ioffset+(cpt-1)*(nlstate+1)+1+(i-1),  ioffset+1+(i-1)+(nlstate+1)*nlstate,iyearc, cpt );                        ioffset+(cpt-1)*(nlstate+1)+1+(i-1),  ioffset+1+(i-1)+(nlstate+1)*nlstate,iyearc, cpt );
               fprintf(ficgp,",\\\n '' ");                fprintf(ficgp,",\\\n '' ");
               fprintf(ficgp," u %d:(",iagec);                 fprintf(ficgp," u %d:(",iagec); /* Below iyearc should be increades if quantitative variable in the reult line */
                 /* $7==6 && $8==2.47 ) && (($9-$10) == 1953 ) ? $12/(1.-$24) : 1/0):7 with labels center not */
                 /* but was  && $7==6 && $8==2 ) && (($7-$8) == 1953 ) ? $12/(1.-$24) : 1/0):7 with labels center not */
               fprintf(ficgp,"%s && (($%d-$%d) == %d ) ? $%d/(1.-$%d) : 1/0):%d with labels center not ", gplotcondition, \                fprintf(ficgp,"%s && (($%d-$%d) == %d ) ? $%d/(1.-$%d) : 1/0):%d with labels center not ", gplotcondition, \
                       iyearc, iagec, offyear,                           \                        iyearc, iagec, offyear,                           \
                       ioffset+(cpt-1)*(nlstate+1)+1+(i-1),  ioffset+1+(i-1)+(nlstate+1)*nlstate, iyearc );                        ioffset+(cpt-1)*(nlstate+1)+1+(i-1),  ioffset+1+(i-1)+(nlstate+1)*nlstate, iyearc );
Line 15879  Interval (in months) between two waves: Line 15886  Interval (in months) between two waves:
 #else  #else
       free_ivector(flatdir,1,npar);         free_ivector(flatdir,1,npar); 
 #endif  /* LINMINORIGINAL*/  #endif  /* LINMINORIGINAL*/
       #endif /* POWELL */   
     hesscov(matcov, hess, p, NDIM, delti, 1e-4, gompertz);       hesscov(matcov, hess, p, NDIM, delti, 1e-4, gompertz); 
   
     for(i=1; i <=NDIM; i++)      for(i=1; i <=NDIM; i++)

Removed from v.1.363  
changed lines
  Added in v.1.364


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