int npar=NPARMAX;\r
int nlstate=2; /* Number of live states */\r
int ndeath=1; /* Number of dead states */\r
-int ncovmodel, ncov; /* Total number of covariables including constant a12*1 +b12*x ncovmodel=2 */\r
+int ncovmodel, ncovcol; /* Total number of covariables including constant a12*1 +b12*x ncovmodel=2 */\r
int popbased=0;\r
\r
int *wav; /* Number of waves for this individuual 0 is possible */\r
\r
ij=1;\r
for (i=1; i<=10; i++) {\r
- if((Ndum[i]!=0) && (i<=ncov)){\r
+ if((Ndum[i]!=0) && (i<=ncovcol)){\r
Tvaraff[ij]=i; \r
ij++;\r
}\r
printf("Problem with %s \n",optionfilehtm), exit(0);\r
}\r
\r
- fprintf(fichtm,"<body><ul> <font size=\"6\">Imach, Version 0.71e </font> <hr size=\"2\" color=\"#EC5E5E\"> \r
+ fprintf(fichtm,"<body><ul> <font size=\"6\">Imach, Version 0.8 </font> <hr size=\"2\" color=\"#EC5E5E\"> \r
Title=%s <br>Datafile=%s Firstpass=%d Lastpass=%d Stepm=%d Weight=%d Model=%s<br>\r
\r
Total number of observations=%d <br>\r
double dateprev1, dateprev2,jproj1,mproj1,anproj1,jproj2,mproj2,anproj2;\r
\r
\r
- char version[80]="Imach version 0.71e, March 2002, INED-EUROREVES ";\r
+ char version[80]="Imach version 0.8, March 2002, INED-EUROREVES ";\r
char *alph[]={"a","a","b","c","d","e"}, str[4];\r
\r
\r
}\r
ungetc(c,ficpar);\r
\r
- fscanf(ficpar,"title=%s datafile=%s lastobs=%d firstpass=%d lastpass=%d\nftol=%lf stepm=%d ncov=%d nlstate=%d ndeath=%d maxwav=%d mle=%d weight=%d\nmodel=%s\n",title, datafile, &lastobs, &firstpass,&lastpass,&ftol, &stepm, &ncov, &nlstate,&ndeath, &maxwav, &mle, &weightopt,model);\r
- printf("title=%s datafile=%s lastobs=%d firstpass=%d lastpass=%d\nftol=%e stepm=%d ncov=%d nlstate=%d ndeath=%d maxwav=%d mle=%d weight=%d\nmodel=%s\n", title, datafile, lastobs, firstpass,lastpass,ftol, stepm, ncov, nlstate,ndeath, maxwav, mle, weightopt,model);\r
- fprintf(ficparo,"title=%s datafile=%s lastobs=%d firstpass=%d lastpass=%d\nftol=%e stepm=%d ncov=%d nlstate=%d ndeath=%d maxwav=%d mle=%d weight=%d\nmodel=%s\n", title, datafile, lastobs, firstpass,lastpass,ftol,stepm,ncov,nlstate,ndeath,maxwav, mle, weightopt,model);\r
+ fscanf(ficpar,"title=%s datafile=%s lastobs=%d firstpass=%d lastpass=%d\nftol=%lf stepm=%d ncovcol=%d nlstate=%d ndeath=%d maxwav=%d mle=%d weight=%d\nmodel=%s\n",title, datafile, &lastobs, &firstpass,&lastpass,&ftol, &stepm, &ncovcol, &nlstate,&ndeath, &maxwav, &mle, &weightopt,model);\r
+ printf("title=%s datafile=%s lastobs=%d firstpass=%d lastpass=%d\nftol=%e stepm=%d ncovcol=%d nlstate=%d ndeath=%d maxwav=%d mle=%d weight=%d\nmodel=%s\n", title, datafile, lastobs, firstpass,lastpass,ftol, stepm, ncovcol, nlstate,ndeath, maxwav, mle, weightopt,model);\r
+ fprintf(ficparo,"title=%s datafile=%s lastobs=%d firstpass=%d lastpass=%d\nftol=%e stepm=%d ncovcol=%d nlstate=%d ndeath=%d maxwav=%d mle=%d weight=%d\nmodel=%s\n", title, datafile, lastobs, firstpass,lastpass,ftol,stepm,ncovcol,nlstate,ndeath,maxwav, mle, weightopt,model);\r
while((c=getc(ficpar))=='#' && c!= EOF){\r
ungetc(c,ficpar);\r
fgets(line, MAXLINE, ficpar);\r
cutv(stra, strb,line,' '); moisnais[i]=(double)(atoi(strb)); strcpy(line,stra);\r
\r
cutv(stra, strb,line,' '); weight[i]=(double)(atoi(strb)); strcpy(line,stra);\r
- for (j=ncov;j>=1;j--){\r
+ for (j=ncovcol;j>=1;j--){\r
cutv(stra, strb,line,' '); covar[j][i]=(double)(atoi(strb)); strcpy(line,stra);\r
} \r
num[i]=atol(stra);\r
}\r
else {\r
cutv(strb,stre,strc,'V');\r
- Tvar[i]=ncov+k1;\r
+ Tvar[i]=ncovcol+k1;\r
cutv(strb,strc,strd,'V'); \r
Tprod[k1]=i;\r
Tvard[k1][1]=atoi(strc);\r
Tvar[cptcovn+k2]=Tvard[k1][1];\r
Tvar[cptcovn+k2+1]=Tvard[k1][2]; \r
for (k=1; k<=lastobs;k++) \r
- covar[ncov+k1][k]=covar[atoi(stre)][k]*covar[atoi(strc)][k];\r
+ covar[ncovcol+k1][k]=covar[atoi(stre)][k]*covar[atoi(strc)][k];\r
k1++;\r
k2=k2+2;\r
}\r
}\r
\r
/*--------- results files --------------*/\r
- fprintf(ficres,"title=%s datafile=%s lastobs=%d firstpass=%d lastpass=%d\nftol=%e stepm=%d ncov=%d nlstate=%d ndeath=%d maxwav=%d mle= 0 weight=%d\nmodel=%s\n", title, datafile, lastobs, firstpass,lastpass,ftol, stepm, ncov, nlstate, ndeath, maxwav, weightopt,model);\r
+ fprintf(ficres,"title=%s datafile=%s lastobs=%d firstpass=%d lastpass=%d\nftol=%e stepm=%d ncovcol=%d nlstate=%d ndeath=%d maxwav=%d mle= 0 weight=%d\nmodel=%s\n", title, datafile, lastobs, firstpass,lastpass,ftol, stepm, ncovcol, nlstate, ndeath, maxwav, weightopt,model);\r
\r
\r
jk=1;\r
- fprintf(ficres,"# Parameters\n");\r
- printf("# Parameters\n");\r
+ fprintf(ficres,"# Parameters nlstate*nlstate*ncov a12*1 + b12 * age + ...\n");\r
+ printf("# Parameters nlstate*nlstate*ncov a12*1 + b12 * age + ...\n");\r
for(i=1,jk=1; i <=nlstate; i++){\r
for(k=1; k <=(nlstate+ndeath); k++){\r
if (k != i) \r
ftolhess=ftol; /* Usually correct */\r
hesscov(matcov, p, npar, delti, ftolhess, func);\r
}\r
- fprintf(ficres,"# Scales\n");\r
- printf("# Scales\n");\r
+ fprintf(ficres,"# Scales (for hessian or gradient estimation)\n");\r
+ printf("# Scales (for hessian or gradient estimation)\n");\r
for(i=1,jk=1; i <=nlstate; i++){\r
for(j=1; j <=nlstate+ndeath; j++){\r
if (j!=i) {\r
}\r
\r
k=1;\r
- fprintf(ficres,"# Covariance\n");\r
- printf("# Covariance\n");\r
+ fprintf(ficres,"# Covariance matrix \n# 121 Var(a12)\n# 122 Cov(b12,a12) Var(b12)\n# ...\n# 232 Cov(b23,a12) Cov(b23,b12) ... Var (b23)\n");\r
+ printf("# Covariance matrix \n# 121 Var(a12)\n# 122 Cov(b12,a12) Var(b12)\n# ...\n# 232 Cov(b23,a12) Cov(b23,b12) ... Var (b23)\n");\r
for(i=1;i<=npar;i++){\r
/* if (k>nlstate) k=1;\r
i1=(i-1)/(ncovmodel*nlstate)+1; \r
free_ma3x(param,1,nlstate,1, nlstate+ndeath-1,1,ncovmodel);\r
\r
if(erreur >0)\r
- printf("End of Imach with error %d\n",erreur);\r
+ printf("End of Imach with error or warning %d\n",erreur);\r
else printf("End of Imach\n");\r
/* gettimeofday(&end_time, (struct timezone*)0);*/ /* after time */\r
\r