<div dir="ltr"><div>Hi, Dr. Fournier.</div><div>I changed the subject to "parameterization of Cholesky factor".    Although your parameterization works, I wonder about how you got it, because it is different from the standard method.   What I mean with "standard" method is:</div><div><br></div><div>Cmat  =   1       r     0   </div><div>               r       1      s</div><div>               0       s      1</div><div>where Cmat is a correlation matrix in my TPL.    </div><div><br></div><div>To make sure that "L*trans(L) = Cmat,"  L must be </div><div><br></div><div>L  =     1                        0                           0</div><div>           r               sqrt(1-r*r)                       0</div><div>           0            s/sqrt(1-r*r)         sqrt(1-r*r-s*s)/sqrt(1-r*r)<br></div><div><br></div><div><br></div><div>When I implemented this Cholesky factor (which is what I got from the standard method), I fail to get COR file.   My core question is how you got the following:</div><div><br></div><div>L =        1                               0                                              0<br><br>                             r/sqrt(1+r*r)         1/sqrt(1+r*r)                   0<br> <br>                                0                       s/sqrt(1+s*s)                          1/sqrt(1+s*s)      <br></div><div><br></div><div><br></div><div>Again thank you very much for your help.</div><div>Saang-Yoon<br></div><div><br>On Tuesday, November 11, 2014 12:07:04 PM UTC-5, Saang-Yoon wrote:</div><blockquote class="gmail_quote" style="margin: 0px 0px 0px 0.8ex; padding-left: 1ex; border-left-color: rgb(204, 204, 204); border-left-width: 1px; border-left-style: solid;"><div dir="ltr"><div>Dr. Fournier.   Yes, it runs!!!  GREAT!!!  Thank you very much for your help.</div><div>Saang-Yoon<br></div><div><br>On Tuesday, November 11, 2014 10:36:09 AM UTC-5, dave fournier wrote:</div><blockquote class="gmail_quote" style="margin: 0px 0px 0px 0.8ex; padding-left: 1ex; border-left-color: rgb(204, 204, 204); border-left-width: 1px; border-left-style: solid;">
  
    
  
  <div text="#000000" bgcolor="#FFFFFF">
    <div>On 11/10/2014 09:23 PM, Saang-Yoon
      wrote:<br>
    </div>
    <blockquote type="cite">
      <div dir="ltr">
        <div>Hi, Dr. Fournier and Hans.</div>
        <div>Attached are two TPL files:</div>
        <div>(1)  ssmbr3v3.TPL, which is based on Hans' link below
          (i.e., the page in the ADMB manual).<br>
        </div>
        <div>(2)  ssmbr3v4.TPL, which is based on Dr. Fournier's
          suggestion below.</div>
        <div>Although both files still fail to generate its
          corresponding COR file,  the 1st TPL (i.e., ssmbr3v3.TPL) is
          better than the 2nd TPL (i.e., ssmbr3v4.TPL).    Would you
          mind checking those attached TPL files?    FYI, following are
          the command for run: </div>
        <div><br>
        </div>
        <div>admb -r -s ssmbr3v3.tpl<br>
          ssmbr3v3 -ind simdataall2.dat -ainp ssmbr3v3.pin -phase 3
          -noinit<br>
        </div>
        <div><br>
          admb -r -s ssmbr3v4.tpl<br>
          ssmbr3v4 -ind simdataall2.dat -ainp ssmbr3v4.pin -phase 3
          -noinit</div>
        <div><br>
        </div>
        <div>Again thank you very much.</div>
        <div>Saang-Yoon</div>
      </div>
    </blockquote>
    <br>
    The code for the choleski factor should look more like this.<br>
    I changed both and the model runs fine.<br>
    <br>
    <br>
     dvar_matrix L(1,nages,1,nages);       // Cholesky factor<br>
      L.initialize();<br>
      L(1,1)=1;<br>
      L(2,1)=rp/sqrt(1+rp*rp);<br>
      L(2,2)=1/sqrt(1+rp*rp);<br>
      L(3,2)=sp/sqrt(1+sp*sp);<br>
      L(3,3)=1/sqrt(1+sp*sp);<br>
    <br>
    However the bounds on rp and ro are probably not what you want.<br>
    <br>
    <br>
    <br>
    <br>
    <blockquote type="cite">
      <div dir="ltr">
        <div><br>
        </div>
        <div><br>
          On Thursday, November 6, 2014 10:30:11 AM UTC-5, Hans wrote:</div>
        <blockquote class="gmail_quote" style="margin: 0px 0px 0px 0.8ex; padding-left: 1ex; border-left-color: rgb(204, 204, 204); border-left-width: 1px; border-left-style: solid;">
          <div dir="ltr">See also:
            <div><br>
            </div>
            <div><a onmousedown="this.href='http://www.google.com/url?q\75http%3A%2F%2Fwww.admb-project.org%2Fexamples%2Fadmb-tricks%2Fparameterization%2Fcovariance-matrices%2Fcovariance-matrices\46sa\75D\46sntz\0751\46usg\75AFQjCNE9ls0x33J4XJFpkBhlq4dj9FmeCw';return true;" onclick="this.href='http://www.google.com/url?q\75http%3A%2F%2Fwww.admb-project.org%2Fexamples%2Fadmb-tricks%2Fparameterization%2Fcovariance-matrices%2Fcovariance-matrices\46sa\75D\46sntz\0751\46usg\75AFQjCNE9ls0x33J4XJFpkBhlq4dj9FmeCw';return true;" href="http://www.admb-project.org/examples/admb-tricks/parameterization/covariance-matrices/covariance-matrices" target="_blank">http://www.admb-project.org/<wbr>examples/admb-tricks/<wbr>parameterization/covariance-<wbr>matrices/covariance-matrices</a><br>
            </div>
            <div><br>
            </div>
            <div>Hans</div>
          </div>
          <div><br>
            <div class="gmail_quote">On Thu, Nov 6, 2014 at 4:23 PM,
              dave fournier <span dir="ltr"><<a>da...@otter-rsch.com</a>></span>
              wrote:<br>
              <blockquote class="gmail_quote" style="margin: 0px 0px 0px 0.8ex; padding-left: 1ex; border-left-color: rgb(204, 204, 204); border-left-width: 1px; border-left-style: solid;">
                <div text="#000000" bgcolor="#FFFFFF">
                  <div>On 11/05/2014 05:10 PM, Saang-Yoon wrote:<br>
                    <br>
                    As I said, you should work with the Choleski
                    decomposition of the correlation matrix.<br>
                    <br>
                    In the simple 3x3 case your conditions imply that 
                    it is determined by 2 parameters<br>
                    <br>
                    r and s   with bounds a and b such that  
                    a<=r<=b.  You get a and b by solving<br>
                    <br>
                         0.0<=     r/sqrt(1+r*r)  <=0.7<br>
                     <br>
                    The matrix is<br>
                    <br>
                        1                               0              
                                0<br>
                    <br>
                         r/sqrt(1+r*r)    1/sqrt(1+r*r)                0<br>
                    <br>
                          0                     s/sqrt(1+s*s)   
                    1/sqrt(1+s*s)      <br>
                    <br>
                    <br>
                    <br>
                    <br>
                    <br>
                    <br>
                    <br>
                  </div>
                  <blockquote type="cite">
                    <div dir="ltr">
                      <div>Hi, Dr. Fournier and others.  </div>
                      <div>I made some progress.   Exploring many
                        possibilities, I found that the following
                        assumptions help, but there is still a concern.</div>
                      <div>(Assumption 1) Three age classes are not from
                        the same cohort, and thus age class 1 and 3
                        are presumed to be independent.    Thus I fix
                        the correlation coefficient between age class 1
                        and 3 as zero.  </div>
                      <div>(Assumption 2) If there is a correlation
                        between neighbor age classes (e.g., "1 vs.
                        2", and "2 vs. 3"), the correlation should be
                        positive (i.e. autocorrelation over the
                        years).    Thus I set bounds of correlation
                        between those neighbor classes to be positive:
                        (e.g.,  init_bounded_number corp12(0.0,0.7,3); 
                        )</div>
                      <div><br>
                      </div>
                      <div>Then now I have the resultant COR file (i.e.,
                        convergence was made).  It was good news,
                        but the estimates of correlation coefficients
                        between neighbor age classes are stuck to the
                        uppder bound, 0.7.  If I allow a wide bound
                        (e.g., init_bounded_number corp12(0.0,0.9,3); ),
                        then I failed to get positive definite
                        matrices.  </div>
                      <div><br>
                      </div>
                      <div>admb -r -s ssmbr3v4.tpl <br>
                        ssmbr3v4 -ind simdataall2.dat -ainp ssmbr3v3.pin
                        -phase 1 -noinit </div>
                      <div><br>
                      </div>
                      <div>Any advice would be appreciated.    Best
                        Wishes,</div>
                      <div>Saang-Yoon<br>
                        <br>
                        On Tuesday, November 4, 2014 6:30:56 PM UTC-5,
                        dave fournier wrote:</div>
                      <blockquote class="gmail_quote" style="margin: 0px 0px 0px 0.8ex; padding-left: 1ex; border-left-color: rgb(204, 204, 204); border-left-width: 1px; border-left-style: solid;">
                        <div text="#000000" bgcolor="#FFFFFF">
                          <div>On 11/04/2014 02:58 PM, Saang-Yoon wrote:<br>
                            <br>
                            Hmm.  Well its like this. Pick a number
                            between -infinity and + infinity. Why would
                            you expect that it would need to be
                            positive.<br>
                            <br>
                            or a matrix like<br>
                            <br>
                              1 .9 .9<br>
                            .9 1 -.50<br>
                            .9 -.50 1<br>
                            <br>
                            If you check you will see that just like -1
                            is negative, this matrix is not positive
                            definite.<br>
                            <br>
                            What you should be asking is how does one
                            parameterize the positive definite matrices
                            in a<br>
                            nice way to do nonlinear parameter
                            estimation.  <br>
                            <br>
                            <br>
                            <br>
                          </div>
                          <blockquote type="cite">
                            <div dir="ltr">
                              <div>Hi, Dr. Fournier.   Thank you very
                                much for your reply.   Attached is
                                models that reflect the TPL code.   At
                                the moment, I have no clue about why the
                                covariance matrix is not positive
                                definite.    </div>
                              <div>Saang-Yoon</div>
                              <div><br>
                                On Monday, November 3, 2014 2:58:49 PM
                                UTC-5, dave fournier wrote:</div>
                              <blockquote class="gmail_quote" style="margin: 0px 0px 0px 0.8ex; padding-left: 1ex; border-left-color: rgb(204, 204, 204); border-left-width: 1px; border-left-style: solid;">
                                <div dir="ltr">What makes you think the
                                  covariance matrix will be positive
                                  definite with your parameterization?<br>
                                  <br>
                                  On Sunday, November 2, 2014 5:49:50 PM
                                  UTC-8, Saang-Yoon wrote:
                                  <blockquote class="gmail_quote" style="margin: 0px 0px 0px 0.8ex; padding-left: 1ex; border-left-color: rgb(204, 204, 204); border-left-width: 1px; border-left-style: solid;">
                                    <div dir="ltr">
                                      <div>Hi.   There was no error in
                                        compile-link for the attached
                                        TPL file; i.e., I got its
                                        executable file.    However, I
                                        fail to get convergence
                                        results.     Would you mind
                                        checking the TPL? </div>
                                      <div>Following are commands for
                                        runs.   </div>
                                      <div><br>
                                      </div>
                                      <div>admb -r -s ssmbr3v4.tpl<br>
                                        ssmbr3v4 -ind simdataall2.dat
                                        -ainp ssmbr3v3.pin -phase 1
                                        -noinit</div>
                                      <div>ssmbr3v4 -ind simdataall2.dat
                                        -ainp ssmbr3v3.pin -phase 9
                                        -noinit</div>
                                      <div><br>
                                      </div>
                                      <div>Thank you.</div>
                                      <div>Saang-Yoon<br>
                                      </div>
                                    </div>
                                  </blockquote>
                                </div>
                              </blockquote>
                            </div>
                            -- <br>
                            You received this message because you are
                            subscribed to the Google Groups "admb-users"
                            group.<br>
                            To unsubscribe from this group and stop
                            receiving emails from it, send an email to <a>admb-users+...@googlegroups.<wbr>com</a>.<br>
                            To post to this group, send email to <a>admb-...@googlegroups.com</a>.<br>
                            Visit this group at <a onmousedown="this.href='http://groups.google.com/group/admb-users';return true;" onclick="this.href='http://groups.google.com/group/admb-users';return true;" href="http://groups.google.com/group/admb-users" target="_blank">http://groups.google.com/<wbr>group/admb-users</a>.<br>
                            For more options, visit <a onmousedown="this.href='https://groups.google.com/d/optout';return true;" onclick="this.href='https://groups.google.com/d/optout';return true;" href="https://groups.google.com/d/optout" target="_blank">https://groups.google.com/d/<wbr>optout</a>.<br>
                          </blockquote>
                          <br>
                          <span><font color="#888888"> </font></span></div>
                        <span><font color="#888888"> </font></span></blockquote>
                      <span><font color="#888888"> </font></span></div>
                    <span><font color="#888888"> -- <br>
                        You received this message because you are
                        subscribed to the Google Groups "admb-users"
                        group.<br>
                        To unsubscribe from this group and stop
                        receiving emails from it, send an email to <a>admb-users+...@googlegroups.<wbr>com</a>.<br>
                        To post to this group, send email to <a>admb-...@googlegroups.com</a>.<br>
                        Visit this group at <a onmousedown="this.href='http://groups.google.com/group/admb-users';return true;" onclick="this.href='http://groups.google.com/group/admb-users';return true;" href="http://groups.google.com/group/admb-users" target="_blank">http://groups.google.com/<wbr>group/admb-users</a>.<br>
                        For more options, visit <a onmousedown="this.href='https://groups.google.com/d/optout';return true;" onclick="this.href='https://groups.google.com/d/optout';return true;" href="https://groups.google.com/d/optout" target="_blank">https://groups.google.com/d/<wbr>optout</a>.<br>
                      </font></span></blockquote>
                  <span><font color="#888888"> <br>
                      <br>
                    </font></span></div>
                <span><font color="#888888">
                    -- <br>
                    You received this message because you are subscribed
                    to the Google Groups "admb-users" group.<br>
                    To unsubscribe from this group and stop receiving
                    emails from it, send an email to <a>admb-users+...@googlegroups.<wbr>com</a>.<br>
                    To post to this group, send email to <a>admb-...@googlegroups.com</a>.<br>
                    Visit this group at <a onmousedown="this.href='http://groups.google.com/group/admb-users';return true;" onclick="this.href='http://groups.google.com/group/admb-users';return true;" href="http://groups.google.com/group/admb-users" target="_blank">http://groups.google.com/<wbr>group/admb-users</a>.<br>
                    For more options, visit <a onmousedown="this.href='https://groups.google.com/d/optout';return true;" onclick="this.href='https://groups.google.com/d/optout';return true;" href="https://groups.google.com/d/optout" target="_blank">https://groups.google.com/d/<wbr>optout</a>.<br>
                  </font></span></blockquote>
            </div>
            <br>
          </div>
        </blockquote>
      </div>
      -- <br>
      You received this message because you are subscribed to the Google
      Groups "admb-users" group.<br>
      To unsubscribe from this group and stop receiving emails from it,
      send an email to <a>admb-users+...@googlegroups.<wbr>com</a>.<br>
      To post to this group, send email to <a>admb-...@googlegroups.com</a>.<br>
      Visit this group at <a onmousedown="this.href='http://groups.google.com/group/admb-users';return true;" onclick="this.href='http://groups.google.com/group/admb-users';return true;" href="http://groups.google.com/group/admb-users" target="_blank">http://groups.google.com/<wbr>group/admb-users</a>.<br>
      For more options, visit <a onmousedown="this.href='https://groups.google.com/d/optout';return true;" onclick="this.href='https://groups.google.com/d/optout';return true;" href="https://groups.google.com/d/optout" target="_blank">https://groups.google.com/d/<wbr>optout</a>.<br>
    </blockquote>
    <br>
  </div>

</blockquote></div></blockquote></div>