|
|
| version 1.102, 2004/09/15 17:31:30 | version 1.103, 2005/09/30 15:54:49 |
|---|---|
| Line 1 | Line 1 |
| /* $Id$ | /* $Id$ |
| $State$ | $State$ |
| $Log$ | $Log$ |
| Revision 1.103 2005/09/30 15:54:49 lievre | |
| (Module): sump fixed, loop imx fixed, and simplifications. | |
| Revision 1.102 2004/09/15 17:31:30 brouard | Revision 1.102 2004/09/15 17:31:30 brouard |
| Add the possibility to read data file including tab characters. | Add the possibility to read data file including tab characters. |
| Line 3921 double gompertz(double x[]) | Line 3924 double gompertz(double x[]) |
| int i,n=0; /* n is the size of the sample */ | int i,n=0; /* n is the size of the sample */ |
| for (i=0;i<=imx-1 ; i++) { | for (i=0;i<=imx-1 ; i++) { |
| sump=sump+weight[i]; | sump=sump+weight[i]; |
| sump=sump+1; | /* sump=sump+1;*/ |
| num=num+1; | num=num+1; |
| } | } |
| /* for (i=1; i<=imx; i++) | /* for (i=0; i<=imx; i++) |
| if (wav[i]>0) printf("i=%d ageex=%lf agecens=%lf agedc=%lf cens=%d %d\n" ,i,ageexmed[i],agecens[i],agedc[i],cens[i],wav[i]);*/ | if (wav[i]>0) printf("i=%d ageex=%lf agecens=%lf agedc=%lf cens=%d %d\n" ,i,ageexmed[i],agecens[i],agedc[i],cens[i],wav[i]);*/ |
| for (i=0;i<=imx-1 ; i++) | for (i=1;i<=imx ; i++) |
| { | { |
| if (cens[i]==1 & wav[i]>1) | if (cens[i]==1 & wav[i]>1) |
| A=-x[1]/(x[2])* | A=-x[1]/(x[2])*(exp(x[2]*(agecens[i]-agegomp))-exp(x[2]*(ageexmed[i]-agegomp))); |
| (exp(x[2]/YEARM*(agecens[i]*12-agegomp*12))-exp(x[2]/YEARM*(ageexmed[i]*12-agegomp*12))); | |
| if (cens[i]==0 & wav[i]>1) | if (cens[i]==0 & wav[i]>1) |
| A=-x[1]/(x[2])* | A=-x[1]/(x[2])*(exp(x[2]*(agedc[i]-agegomp))-exp(x[2]*(ageexmed[i]-agegomp))) |
| (exp(x[2]/YEARM*(agedc[i]*12-agegomp*12))-exp(x[2]/YEARM*(ageexmed[i]*12-agegomp*12))) | +log(x[1]/YEARM)+x[2]*(agedc[i]-agegomp)+log(YEARM); |
| +log(x[1]/YEARM)+x[2]/YEARM*(agedc[i]*12-agegomp*12)+log(YEARM); | |
| if (wav[i]>1 & agecens[i]>15) { | if (wav[i]>1 & agecens[i]>15) { |
| L=L+A*weight[i]; | L=L+A*weight[i]; |