]> henry.ined.fr Git - .git/commitdiff
*** empty log message ***
authorN. Brouard <brouard@ined.fr>
Sat, 24 Oct 2015 07:14:11 +0000 (07:14 +0000)
committerN. Brouard <brouard@ined.fr>
Sat, 24 Oct 2015 07:14:11 +0000 (07:14 +0000)
src/imach.c

index f65abbf5a94867f7c22ab25f9bbc28280db973cc..90edd662b71f42097e108acea803abd8465c85dd 100644 (file)
@@ -1,6 +1,9 @@
 /* $Id$
   $State$
   $Log$
+  Revision 1.205  2015/10/23 15:50:53  brouard
+  Summary: 0.98r3 some clarification for graphs on likelihood contributions
+
   Revision 1.204  2015/10/01 16:20:26  brouard
   Summary: Some new graphs of contribution to likelihood
 
@@ -1957,7 +1960,24 @@ double **prevalim(double **prlim, int nlstate, double x[], double age, double **
 {
   /* Computes the prevalence limit in each live state at age x by left multiplying the unit
      matrix by transitions matrix until convergence is reached with precision ftolpl */
-  
+  /* Wx= Wx-1 Px-1= Wx-2 Px-2 Px-1  = Wx-n Px-n ... Px-2 Px-1 I */
+  /* Wx is row vector: population in state 1, population in state 2, population dead */
+  /* or prevalence in state 1, prevalence in state 2, 0 */
+  /* newm is the matrix after multiplications, its rows are identical at a factor */
+  /* Initial matrix pimij */
+  /* {0.85204250825084937, 0.13044499163996345, 0.017512500109187184, */
+  /* 0.090851990222114765, 0.88271245433047185, 0.026435555447413338, */
+  /*  0,                   0                  , 1} */
+  /*
+   * and after some iteration: */
+  /* {0.45504275246439968, 0.42731458730878791, 0.11764266022681241, */
+  /*  0.45201005341706885, 0.42865420071559901, 0.11933574586733192, */
+  /*  0,                   0                  , 1} */
+  /* And prevalence by suppressing the deaths are close to identical rows in prlim: */
+  /* {0.51571254859325999, 0.4842874514067399, */
+  /*  0.51326036147820708, 0.48673963852179264} */
+  /* If we start from prlim again, prlim tends to a constant matrix */
+
   int i, ii,j,k;
   double min, max, maxmin, maxmax,sumnew=0.;
   /* double **matprod2(); */ /* test */
@@ -2013,13 +2033,13 @@ double **prevalim(double **prlim, int nlstate, double x[], double age, double **
        prlim[i][j]= newm[i][j]/(1-sumnew);
        max=FMAX(max,prlim[i][j]);
        min=FMIN(min,prlim[i][j]);
-        /* printf(" age= %d prevalim i=%d, j=%d, prmlim[%d][%d]=%f, agefin=%d max=%f min=%f\n", (int)age, i, j, i, j, prlim[i][j],(int)agefin, max, min); */
+        printf(" age= %d prevalim i=%d, j=%d, prmlim[%d][%d]=%f, agefin=%d max=%f min=%f\n", (int)age, i, j, i, j, prlim[i][j],(int)agefin, max, min);
       }
       maxmin=(max-min)/(max+min)*2;
       maxmax=FMAX(maxmax,maxmin);
     } /* j loop */
     *ncvyear= (int)age- (int)agefin;
-    /* printf("maxmax=%lf maxmin=%lf ncvloop=%ld, age=%d, agefin=%d ncvyear=%d \n", maxmax, maxmin, ncvloop, (int)age, (int)agefin, *ncvyear); */
+    printf("maxmax=%lf maxmin=%lf ncvloop=%ld, age=%d, agefin=%d ncvyear=%d \n", maxmax, maxmin, ncvloop, (int)age, (int)agefin, *ncvyear);
     if(maxmax < ftolpl){
       /* printf("maxmax=%lf maxmin=%lf ncvloop=%ld, age=%d, agefin=%d ncvyear=%d \n", maxmax, maxmin, ncvloop, (int)age, (int)agefin, *ncvyear); */
       return prlim;