--- imach/src/imach.c 2022/07/23 17:44:26 1.324 +++ imach/src/imach.c 2022/07/25 14:27:23 1.325 @@ -1,6 +1,12 @@ -/* $Id: imach.c,v 1.324 2022/07/23 17:44:26 brouard Exp $ +/* $Id: imach.c,v 1.325 2022/07/25 14:27:23 brouard Exp $ $State: Exp $ $Log: imach.c,v $ + Revision 1.325 2022/07/25 14:27:23 brouard + Summary: r30 + + * imach.c (Module): Error cptcovn instead of nsd in bmij (was + coredumped, revealed by Feiuno, thank you. + Revision 1.324 2022/07/23 17:44:26 brouard *** empty log message *** @@ -1051,7 +1057,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, eĢliminating 1 1 if + o There are 2**cptcoveff combinations of (0,1) for cptcoveff variables. Outputting only combinations with people, eĢliminating 1 1 if race White (0 0), Black vs White (1 0), Hispanic (0 1) and 1 1 being meaningless. @@ -1188,7 +1194,7 @@ typedef struct { #define NINTERVMAX 8 #define NLSTATEMAX 8 /**< Maximum number of live states (for func) */ #define NDEATHMAX 8 /**< Maximum number of dead states (for func) */ -#define NCOVMAX 30 /**< Maximum number of covariates, including generated covariates V1*V2 */ +#define NCOVMAX 30 /**< Maximum number of covariates used in the model, including generated covariates V1*V2 or V1*age */ #define codtabm(h,k) (1 & (h-1) >> (k-1))+1 /*#define decodtabm(h,k,cptcoveff)= (h <= (1<> (k-1)) & 1) +1 : -1)*/ #define decodtabm(h,k,cptcoveff) (((h-1) >> (k-1)) & 1) +1 @@ -1212,12 +1218,12 @@ typedef struct { #define ODIRSEPARATOR '\\' #endif -/* $Id: imach.c,v 1.324 2022/07/23 17:44:26 brouard Exp $ */ +/* $Id: imach.c,v 1.325 2022/07/25 14:27:23 brouard Exp $ */ /* $State: Exp $ */ #include "version.h" char version[]=__IMACH_VERSION__; char copyright[]="July 2022,INED-EUROREVES-Institut de longevite-Japan Society for the Promotion of Science (Grant-in-Aid for Scientific Research 25293121), Intel Software 2015-2020, Nihon University 2021-202, INED 2000-2022"; -char fullversion[]="$Revision: 1.324 $ $Date: 2022/07/23 17:44:26 $"; +char fullversion[]="$Revision: 1.325 $ $Date: 2022/07/25 14:27:23 $"; char strstart[80]; char optionfilext[10], optionfilefiname[FILENAMELENGTH]; int erreur=0, nberr=0, nbwarn=0; /* Error number, number of errors number of warnings */ @@ -3138,7 +3144,7 @@ double **pmij(double **ps, double *cov, ps[i][i]=1./(s1+1.); /* Computing other pijs */ for(j=1; j0){ /* V5+V4+V3+V4*V3+V5*age+V2+V1*V2+V1*age+V1, 2 V5 and V1 */ - if(j==Tage[ij]) { /* Product by age To be looked at!!*/ + if(j==Tage[ij]) { /* Product by age To be looked at!!*//* Bug valgrind */ if(ij <=cptcovage) { /* V5+V4+V3+V4*V3+V5*age+V2+V1*V2+V1*age+V1, 2 V5 and V1 */ - if(DummyV[j]==0){ + if(DummyV[j]==0){/* Bug valgrind */ fprintf(ficgp,"+p%d*%d*x",i+j+2+nagesqr-1,Tinvresult[nres][Tvar[j]]);; }else{ /* quantitative */ fprintf(ficgp,"+p%d*%f*x",i+j+2+nagesqr-1,Tqinvresult[nres][Tvar[j]]); /* Tqinvresult in decoderesult */ @@ -11180,7 +11199,7 @@ int hPijx(double *p, int bage, int fage) /* oldm=oldms;savm=savms; */ /* hbxij(p3mat,nhstepm,agedeb,hstepm,p,nlstate,stepm,oldm,savm, k); */ - hbxij(p3mat,nhstepm,agedeb,hstepm,p,prevacurrent,nlstate,stepm, k, nres); + hbxij(p3mat,nhstepm,agedeb,hstepm,p,prevacurrent,nlstate,stepm, k, nres);/* Bug valgrind */ /* hbxij(p3mat,nhstepm,agedeb,hstepm,p,prevacurrent,nlstate,stepm,oldm,savm, dnewm, doldm, dsavm, k); */ fprintf(ficrespijb,"# Cov Agex agex-h hbijx with i,j="); for(i=1; i<=nlstate;i++) @@ -11193,7 +11212,7 @@ int hPijx(double *p, int bage, int fage) /* fprintf(ficrespijb,"%d %3.f %3.f",k, agedeb, agedeb + h*hstepm/YEARM*stepm ); */ for(i=1; i<=nlstate;i++) for(j=1; j<=nlstate+ndeath;j++) - fprintf(ficrespijb," %.5f", p3mat[i][j][h]); + fprintf(ficrespijb," %.5f", p3mat[i][j][h]);/* Bug valgrind */ fprintf(ficrespijb,"\n"); } free_ma3x(p3mat,1,nlstate+ndeath,1, nlstate+ndeath, 0,nhstepm); @@ -11878,7 +11897,8 @@ Please run with mle=-1 to get a correct } mint=matrix(1,maxwav,firstobs,lastobs); anint=matrix(1,maxwav,firstobs,lastobs); - s=imatrix(1,maxwav+1,firstobs,lastobs); /* s[i][j] health state for wave i and individual j */ + s=imatrix(1,maxwav+1,firstobs,lastobs); /* s[i][j] health state for wave i and individual j */ + printf("BUG ncovmodel=%d NCOVMAX=%d 2**ncovmodel=%f BUG\n",ncovmodel,NCOVMAX,pow(2,ncovmodel)); tab=ivector(1,NCOVMAX); ncodemax=ivector(1,NCOVMAX); /* Number of code per covariate; if O and 1 only, 2**ncov; V1+V2+V3+V4=>16 */ ncodemaxwundef=ivector(1,NCOVMAX); /* Number of code per covariate; if - 1 O and 1 only, 2**ncov; V1+V2+V3+V4=>16 */