|
|
| version 1.238, 2016/08/26 14:23:35 | version 1.239, 2016/08/26 15:51:03 |
|---|---|
| Line 1 | Line 1 |
| /* $Id$ | /* $Id$ |
| $State$ | $State$ |
| $Log$ | $Log$ |
| Revision 1.239 2016/08/26 15:51:03 brouard | |
| Summary: Improvement in Powell output in order to copy and paste | |
| Author: | |
| Revision 1.238 2016/08/26 14:23:35 brouard | Revision 1.238 2016/08/26 14:23:35 brouard |
| Summary: Starting tests of 0.99 | Summary: Starting tests of 0.99 |
| Line 2064 void powell(double p[], double **xi, int | Line 2069 void powell(double p[], double **xi, int |
| void linmin(double p[], double xi[], int n, double *fret, | void linmin(double p[], double xi[], int n, double *fret, |
| double (*func)(double []),int *flat); | double (*func)(double []),int *flat); |
| #endif | #endif |
| int i,ibig,j; | int i,ibig,j,jk,k; |
| double del,t,*pt,*ptt,*xit; | double del,t,*pt,*ptt,*xit; |
| double directest; | double directest; |
| double fp,fptt; | double fp,fptt; |
| Line 2096 void powell(double p[], double **xi, int | Line 2101 void powell(double p[], double **xi, int |
| fprintf(ficlog,"\nPowell iter=%d -2*LL=%.12f %ld sec. %ld sec.",*iter,*fret,rcurr_time-rlast_time, rcurr_time-rstart_time); fflush(ficlog); | fprintf(ficlog,"\nPowell iter=%d -2*LL=%.12f %ld sec. %ld sec.",*iter,*fret,rcurr_time-rlast_time, rcurr_time-rstart_time); fflush(ficlog); |
| /* fprintf(ficrespow,"%d %.12f %ld",*iter,*fret,curr_time.tm_sec-start_time.tm_sec); */ | /* fprintf(ficrespow,"%d %.12f %ld",*iter,*fret,curr_time.tm_sec-start_time.tm_sec); */ |
| for (i=1;i<=n;i++) { | for (i=1;i<=n;i++) { |
| printf(" %d %.12f",i, p[i]); | |
| fprintf(ficlog," %d %.12lf",i, p[i]); | |
| fprintf(ficrespow," %.12lf", p[i]); | fprintf(ficrespow," %.12lf", p[i]); |
| } | } |
| fprintf(ficrespow,"\n");fflush(ficrespow); | |
| printf("\n#model= 1 + age "); | |
| fprintf(ficlog,"\n#model= 1 + age "); | |
| if(nagesqr==1){ | |
| printf(" + age*age ",Tvar[j]); | |
| fprintf(ficlog," + age*age ",Tvar[j]); | |
| } | |
| for(j=1;j <=ncovmodel-2;j++){ | |
| if(Typevar[j]==0) { | |
| printf(" + V%d ",Tvar[j]); | |
| fprintf(ficlog," + V%d ",Tvar[j]); | |
| }else if(Typevar[j]==1) { | |
| printf(" + V%d*age ",Tvar[j]); | |
| fprintf(ficlog," + V%d*age ",Tvar[j]); | |
| }else if(Typevar[j]==2) { | |
| printf(" + V%d*V%d ",Tvard[Tposprod[j]][1],Tvard[Tposprod[j]][2]); | |
| fprintf(ficlog," + V%d*V%d ",Tvard[Tposprod[j]][1],Tvard[Tposprod[j]][2]); | |
| } | |
| } | |
| printf("\n"); | printf("\n"); |
| /* printf("12 47.0114589 0.0154322 33.2424412 0.3279905 2.3731903 */ | |
| /* 13 -21.5392400 0.1118147 1.2680506 1.2973408 -1.0663662 */ | |
| fprintf(ficlog,"\n"); | fprintf(ficlog,"\n"); |
| fprintf(ficrespow,"\n");fflush(ficrespow); | for(i=1,jk=1; i <=nlstate; i++){ |
| for(k=1; k <=(nlstate+ndeath); k++){ | |
| if (k != i) { | |
| printf("%d%d ",i,k); | |
| fprintf(ficlog,"%d%d ",i,k); | |
| fprintf(ficres,"%1d%1d ",i,k); | |
| for(j=1; j <=ncovmodel; j++){ | |
| printf("%12.7f ",p[jk]); | |
| fprintf(ficlog,"%12.7f ",p[jk]); | |
| fprintf(ficres,"%12.7f ",p[jk]); | |
| jk++; | |
| } | |
| printf("\n"); | |
| fprintf(ficlog,"\n"); | |
| fprintf(ficres,"\n"); | |
| } | |
| } | |
| } | |
| if(*iter <=3){ | if(*iter <=3){ |
| tml = *localtime(&rcurr_time); | tml = *localtime(&rcurr_time); |
| strcpy(strcurr,asctime(&tml)); | strcpy(strcurr,asctime(&tml)); |