<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    <div class="moz-cite-prefix">On 13-02-10 01:54 PM, Mollie Brooks
      wrote:<br>
      <br>
      <br>
      Safe mode may initialize variables so that if you are using
      unitialized variables<br>
      you could get different results between the two. In fact it is a
      good test for that.<br>
      It appears that in your case temp_varcov is not initialized.<br>
      <br>
         //CALCULATE VARCOV<br>
              dvar_matrix temp_varcov(2,nobs(p),2,nobs(p));<br>
              <br>
      //  !!!!    right here<br>
      <br>
        <br>
              for(int k=2; k<=2; k++)<br>
              {<br>
                      for(int l=k; l<=nobs(p); l++)//l>=k<br>
                      {<br>
                              for(int b= obsdates(1,p)+1; b<=
      obsdates(k,p); b++)<br>
                              {<br>
                                     
      temp_varcov(k,l)+=sigmaSq*(pow(rho,<br>
                                                             
      tk_minus_b(p,b,k)+<br>
                                                             
      tk_minus_b(p,b,l)));<br>
                              }<br>
                              temp_varcov(l,k)=temp_varcov(k,l);<br>
                      }<br>
              }<br>
      <br>
      <br>
      <br>
      <br>
    </div>
    <blockquote cite="mid:A7A7379C-B350-428F-8839-5A365967D408@ufl.edu"
      type="cite">
      <div><span class="Apple-style-span" style="border-collapse:
          separate; color: rgb(0, 0, 0); font-family: Helvetica;
          font-style: normal; font-variant: normal; font-weight: normal;
          letter-spacing: normal; line-height: normal; orphans: 2;
          text-align: -webkit-auto; text-indent: 0px; text-transform:
          none; white-space: normal; widows: 2; word-spacing: 0px;
          -webkit-border-horizontal-spacing: 0px;
          -webkit-border-vertical-spacing: 0px;
          -webkit-text-decorations-in-effect: none;
          -webkit-text-size-adjust: auto; -webkit-text-stroke-width:
          0px; font-size: medium; "><span class="Apple-style-span"
            style="border-collapse: separate; color: rgb(0, 0, 0);
            font-family: Helvetica; font-style: normal; font-variant:
            normal; font-weight: normal; letter-spacing: normal;
            line-height: normal; orphans: 2; text-indent: 0px;
            text-transform: none; white-space: normal; widows: 2;
            word-spacing: 0px; -webkit-border-horizontal-spacing: 0px;
            -webkit-border-vertical-spacing: 0px;
            -webkit-text-decorations-in-effect: none;
            -webkit-text-size-adjust: auto; -webkit-text-stroke-width:
            0px; font-size: medium; ">
            <div style="word-wrap: break-word; -webkit-nbsp-mode: space;
              -webkit-line-break: after-white-space; ">A collaborator
              proved that the measurement error only variance-covariance
              matrix was positive definite, but didn't get around to the
              process error version. I was hoping they were similar
              enough.</div>
          </span></span>
      </div>
      <div><br class="webkit-block-placeholder">
      </div>
      <div>I don't have a great understanding of what it takes for a
        matrix to be positive definite. I at least can say that as long
        as rho and sigmaSq are positive, then all of the matrix elements
        should be positive. So it's strange that they would ever go
        negative. </div>
      <div><br>
      </div>
      <div>I thought that maybe I had gotten the indices wrong, so I
        tried compiling in safe mode. In safe mode, none of the elements
        go negative and it seems to be positive-definite. I didn't think
        safe-mode to change the behaviour like this. I thought it would
        just give errors.</div>
      <div><br>
      </div>
      <div>thanks,</div>
      <div>Mollie</div>
      <div><br class="webkit-block-placeholder">
      </div>
      <br>
      <div>
        <div>On 10 Feb 2013, at 2:00 PM, dave fournier wrote:</div>
        <br class="Apple-interchange-newline">
        <blockquote type="cite">
          <meta content="text/html; charset=ISO-8859-1"
            http-equiv="Content-Type">
          <div text="#000000" bgcolor="#FFFFFF">
            <div class="moz-cite-prefix">On 13-02-10 10:39 AM, Mollie
              Brooks wrote:<br>
              <br>
              Its pretty complicated, but the first question would be
              why should it be positive definite.<br>
              Without understanding the special structure all I see is a
              way of parameterizing a<br>
              symmetric matrix via a bunch of parameters.  since S_ij =
              S_ji  by<br>
              construction it is symmetric, but why positive definite.<br>
              <br>
              <br>
              <br>
            </div>
            <blockquote
              cite="mid:2D9845BB-D05E-4767-91F3-90CA22EE70F4@ufl.edu"
              type="cite">
              <pre wrap="">Thanks for the response.

I'm attaching the code and a tiny simulated data set. I can send a larger simulated dataset if it helps. I also attached the R code I used to simulate the data. 

The attached pdf contains the formula for the variance covariance matrix as "Process Error". The "Predictions" are temporally autocorrelated latent variables that determine the Bernoulli process of whether or not there is water in the pond.
thanks,
Mollie
</pre>
              <br>
              <fieldset class="mimeAttachmentHeader"></fieldset>
              <br>
              <br>
              <fieldset class="mimeAttachmentHeader"></fieldset>
              <br>
              <pre wrap=""> 

Mollie Brooks
Postdoctoral Researcher, Ponciano Lab
Biology Department, University of Florida
<a moz-do-not-send="true" class="moz-txt-link-freetext" href="http://people.biology.ufl.edu/mbrooks">http://people.biology.ufl.edu/mbrooks</a>


On 10 Feb 2013, at 11:54 AM, dave fournier wrote:

</pre>
              <blockquote type="cite">
                <pre wrap="">Hard to say much that isn't probably wrong without seeing your code etc.
_______________________________________________
Users mailing list
<a moz-do-not-send="true" class="moz-txt-link-abbreviated" href="mailto:Users@admb-project.org">Users@admb-project.org</a>
<a moz-do-not-send="true" class="moz-txt-link-freetext" href="http://lists.admb-project.org/mailman/listinfo/users">http://lists.admb-project.org/mailman/listinfo/users</a>

</pre>
              </blockquote>
            </blockquote>
            <br>
          </div>
        </blockquote>
      </div>
      <br>
    </blockquote>
    <br>
  </body>
</html>