From: N. Brouard Date: Thu, 29 Oct 2009 15:33:14 +0000 (+0000) Subject: (Module): Now imach stops if date of birth, at least year of birth, is not given... X-Git-Tag: imach-099s7~459 X-Git-Url: https://henry.ined.fr/git/?a=commitdiff_plain;h=c564c7c6d31cd01e8c167571e0640e5208d9c769;p=.git (Module): Now imach stops if date of birth, at least year of birth, is not given. Some cleaning of the code. --- diff --git a/src/imach.c b/src/imach.c index da7d697..d6ca182 100644 --- a/src/imach.c +++ b/src/imach.c @@ -1,6 +1,9 @@ /* $Id$ $State$ $Log$ + Revision 1.134 2009/10/29 13:18:53 brouard + (Module): Now imach stops if date of birth, at least year of birth, is not given. Some cleaning of the code. + Revision 1.133 2009/07/06 10:21:25 brouard just nforces @@ -3482,6 +3485,13 @@ To be simple, these graphs help to understand the significativity of each parame /* Computing eigen value of matrix of covariance */ lc1=((v1+v2)+sqrt((v1+v2)*(v1+v2) - 4*(v1*v2-cv12*cv12)))/2.; lc2=((v1+v2)-sqrt((v1+v2)*(v1+v2) - 4*(v1*v2-cv12*cv12)))/2.; + if ((lc2 <0) || (lc1 <0) ){ + printf("Error: One eigen value of 2x2 matrix of covariance is negative, lc1=%11.3e, lc2=%11.3e, v1=%11.3e, v2=%11.3e, cv12=%11.3e.\n It means that the matrix was not well estimated (varpij), for i=%2d, j=%2d, age=%4d .\n See files %s and %s. Continuing by making them positive: WRONG RESULTS.\n", lc1, lc2, v1, v2, cv12, i, j, (int)age,fileresprobcov, fileresprobcor); + fprintf(ficlog,"Error: One eigen value of 2x2 matrix of covariance is negative, lc1=%11.3e, lc2=%11.3e, v1=%11.3e, v2=%11.3e, cv12=%11.3e\n", lc1, lc2, v1, v2, cv12);fflush(ficlog); + lc1=fabs(lc1); + lc2=fabs(lc2); + } + /* Eigen vectors */ v11=(1./sqrt(1+(v1-lc1)*(v1-lc1)/cv12/cv12)); /*v21=sqrt(1.-v11*v11); *//* error */