From b64b89d64448c742b0cc6267704828606df94efd Mon Sep 17 00:00:00 2001 From: "N. Brouard" Date: Fri, 28 Jun 2024 12:27:05 +0000 Subject: [PATCH] * imach.c (Module): fixing some bugs in gnuplot and quantitative variables, but not completely solved --- src/imach.c | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/src/imach.c b/src/imach.c index da3ba35..5e0cd85 100644 --- a/src/imach.c +++ b/src/imach.c @@ -1,6 +1,9 @@ /* $Id$ $State$ $Log$ + Revision 1.363 2024/06/28 09:31:55 brouard + Summary: Adding log lines too + Revision 1.362 2024/06/28 08:00:31 brouard Summary: 0.99s6 @@ -1245,7 +1248,7 @@ Important routines - 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. - 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, é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. @@ -3020,6 +3023,7 @@ static void print2() /* print a line of traces */ /* printf("%10d %10d%14.7g",nl, nf, fx); */ /* printf ( "\n" ); */ printf ( " Linear searches %d", nl ); + fprintf (ficlog, " Linear searches %d", nl ); /* printf ( " Linear searches %d\n", nl ); */ /* printf ( " Function evaluations %d\n", nf ); */ /* printf ( " Function value FX = %g\n", fx ); */ @@ -3035,8 +3039,8 @@ static void print2() /* print a line of traces */ { /* for(i=1;i<=n;i++)printf("%14.7g",x[i-1]); */ for(i=1;i<=n;i++){ - printf("%14.7g",x[i]); - fprintf(ficlog,"%14.7g",x[i]); + printf(" %14.7g",x[i]); + fprintf(ficlog," %14.7g",x[i]); } /* r8vec_print ( n, x, " X:" ); */ } @@ -6610,7 +6614,7 @@ void mlikeli(FILE *ficres,double p[], int npar, int ncovmodel, int nlstate, doub #else /* FLATSUP */ /* powell(p,xi,npar,ftol,&iter,&fret,func);*/ /* praxis ( t0, h0, n, prin, x, beale_f ); */ - /* int prin=1; */ + int prin=4; /* double h0=0.25; */ /* double macheps; */ /* double fmin; */ @@ -10784,8 +10788,9 @@ set ter svg size 640, 480\nunset log y\nplot [%.f:%.f] ", ageminpar, agemaxpar) /* vlv= nbcode[Tvaraff[k]][lv]; /\* Value of the modality of Tvaraff[k] *\/ */ /* vlv= nbcode[Tvaraff[k]][codtabm(k1,TnsdVar[Tvaraff[k]])]; */ 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,lv, kl+1, vlv ); + sprintf(gplotcondition+strlen(gplotcondition),"$%d==%d && $%d==%lg " ,kl,lv, kl+1, vlv );/* Solved but quantitative must be shifted */ kl++; if(k 1) sprintf(gplotcondition+strlen(gplotcondition)," && "); @@ -10799,7 +10804,9 @@ set ter svg size 640, 480\nunset log y\nplot [%.f:%.f] ", ageminpar, agemaxpar) 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 ); 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, \ iyearc, iagec, offyear, \ ioffset+(cpt-1)*(nlstate+1)+1+(i-1), ioffset+1+(i-1)+(nlstate+1)*nlstate, iyearc ); @@ -15876,7 +15883,7 @@ Interval (in months) between two waves: Min=%d Max=%d Mean=%.2lf
\n",\ #else free_ivector(flatdir,1,npar); #endif /* LINMINORIGINAL*/ - +#endif /* POWELL */ hesscov(matcov, hess, p, NDIM, delti, 1e-4, gompertz); for(i=1; i <=NDIM; i++) -- 2.43.0