#include <float.h> /* for DBL_EPSILON */
/* #include "machine.h" */
-
/* extern void minfit(int n, double eps, double tol, double **ab, double q[]); */
/* extern void minfit(int n, double eps, double tol, double ab[N][N], double q[]); */
/* control parameters */
if (l == k)
goto Convergence;
/* shift from bottom 2x2 minor */
- /* x = q[l]; y = q[k-l]; g = e[k-1]; h = e[k]; */ /* Error */
+ /* x = q[l]; y = q[k-l]; g = e[k-1]; h = e[k]; */ /* Gegenfurtner Error */
x = q[l]; y = q[k-1]; g = e[k-1]; h = e[k];
f = ((y-z)*(y+z) + (g-h)*(g+h)) / (2.0*h*y);
g = sqrt(f*f+1.0);
int seed; /* added */
- int biter=0;
+ int biter=0; /* added */
double r;
double randbrent( int (*));
double s, sf;
}
}
for (i=1; i<=n; i++)
+ /* Transposing v before golub */
/* for (j=0; j<=i-1; j++) { */
/* for (j=1; j<=i; j++) { */
for (j=1; j<=i-1; j++) {
}
/* for (i=0; i<n; i++) { */
double dni; /* added for compatibility with buckhardt but not brent */
+ /* Q^TVR=Sigma, v is v^t and d is sigma: Computing Sigma^{-2} as Q^TAQ= Sigma^{-2} */
for (i=1; i<=n; i++) {
dni=dn*d[i]; /* added for compatibility with buckhardt but not brent */
if ((dn * d[i]) > large)
printf("Prevalence combination of varying and fixed dummies %d\n",j1);
/* fprintf(ficlog," V%d=%d ",Tvaraff[j1],nbcode[Tvaraff[j1]][codtabm(k,j1)]); */
fprintf(ficlog,"Prevalence combination of varying and fixed dummies %d\n",j1);
-
+ int ierroragemin=0;int ierroragemax=0;
for (i=1; i<=imx; i++) { /* Each individual */
bool=1;
/* for(m=firstpass; m<=lastpass; m++){/\* Other selection (we can limit to certain interviews*\/ */
if ((y2>=dateprev1) && (y2<=dateprev2)) { /* Here is the main selection (fractional years) */
if(agev[m][i]==0) agev[m][i]=iagemax+1;
if(agev[m][i]==1) agev[m][i]=iagemax+2;
- if((int)agev[m][i] <iagemin-AGEMARGE || (int)agev[m][i] >iagemax+4+AGEMARGE){
- printf("Error on individual # %d agev[m][i]=%f <%d-%d or > %d+3+%d m=%d; either change agemin or agemax or fix data\n",i, agev[m][i],iagemin,AGEMARGE, iagemax,AGEMARGE,m);
- exit(1);
+ if((int)agev[m][i] <iagemin-AGEMARGE){
+ ierroragemin++;
+ printf("Error on individual # ...%09ld around line %d agev[m][i]=%f <%d-%d=%d m=%d; decrease 'agemin' or fix data\n",num[i],i, agev[m][i],iagemin,AGEMARGE, iagemin-AGEMARGE,m);
+ }
+ if((int)agev[m][i] >iagemax+4+AGEMARGE){
+ ierroragemax++;
+ printf("Error on individual # ...%09ld around line %d agev[m][i]=%f > %d+3+%d=%d m=%d;increase 'agemax' or fix data\n",num[i],i, agev[m][i],iagemax,AGEMARGE, iagemax+AGEMARGE,m);
}
if (s[m][i]>0 && s[m][i]<=nlstate) {
/*if(i>4620) printf(" i=%d m=%d s[m][i]=%d (int)agev[m][i]=%d weight[i]=%f prop=%f\n",i,m,s[m][i],(int)agev[m][m],weight[i],prop[s[m][i]][(int)agev[m][i]]);*/
} /* end bool */
} /* end wave */
} /* end individual */
+ if(ierroragemin>=1 || ierroragemax>=1){
+ if(ierroragemin>=1)
+ printf("%d error(s) on extreme joung age(s) of persons, check data or decrease agemin=%d\n",ierroragemin,iagemin);
+ if(ierroragemax>=1)
+ printf("%d error(s) on extreme old age(s) of persons, check data or increase agemax=%d\n",ierroragemax,iagemax);
+ exit(1);
+ }
for(i=iagemin; i <= iagemax+3; i++){
for(jk=1,posprop=0; jk <=nlstate ; jk++) {
posprop += prop[jk][i];