<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><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; ">For the particular model I am trying to implement, my matrix won't be symmetric positive definite. </div></span></span></div><div>In inv(identity_matrix(1,nspp)-B) the matrix B represents interactions among different species in the community. B(i,j) is how species i is affected by species j. So if species j eats species i, it seems likely that B(i,j) would be negative and B(j,i) would be positive, but not of equal magnitudes. So if I'm going to use RE, then I'll have to invert a general df1b2matrix.</div><div><br class="webkit-block-placeholder"></div><div>I guess we can talk more off list about me testing your method.</div><div>thanks,</div><div>Mollie</div><div><br></div><div><div>On 22 Oct 2012, at 4:17 PM, H. Skaug wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div>Mollie,<br><br>Previous email sent prematurely.<br><br>kronecker.cpp contains a function "inv_sym_posdef" which inv()<br>for positive definite matrices. I am not sure if your matrix is pos.def.<br>You are right that a general inv(df1b2matrix) is missing.<br><br><blockquote type="cite">I was told that there is a way to fit the latent states as regular parameters<br></blockquote><blockquote type="cite">instead of RE.<br></blockquote><br>This could be what I am working on now. It would be good if you wanted to<br>test it but I need a bit more time to finish things up.<br><br>Hans<br><br>On Mon, Oct 22, 2012 at 8:42 PM, Mollie Brooks <<a href="mailto:mbrooks@ufl.edu">mbrooks@ufl.edu</a>> wrote:<br><blockquote type="cite">Thanks Hans!<br></blockquote><blockquote type="cite">This will really help the progress of ADMB in the area of state-space models. I'll take a look at it and be an alpha tester.<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">I ran into another issue with the MAR(1) model... Calculating the mean of the stationary distribution involves taking the inverse of a df1b2matrix. mu=inv(identity_matrix(1,n)-B)*A<br></blockquote><blockquote type="cite">error: no matching function for call to ‘inv(df1b2matrix)’<br></blockquote><blockquote type="cite">I was about to add this to Redmine, but had trouble signing in.<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">It seems this function is not defined for RE models. Do you plan to add this function or is there an alternative? I was told that there is a way to fit the latent states as regular parameters instead of RE.<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">cheers,<br></blockquote><blockquote type="cite">Mollie<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">On 22 Oct 2012, at 3:25 PM, H. Skaug wrote:<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite"><blockquote type="cite">Hi Mollie,<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">I am actually working on a library for kronecker products right now,<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">as I see that as the right approach to space time models. It is mostly<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">geared towards sparse matrices, but at least I have kronecker(sparse,dense)<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">which should be good staring point. About vec(A) I think is<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">already in the admb source, but it was lacking for random effects,<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">so I wrote that.<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">I attaching my current code which is in constant development,<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">so you can use it as a template for your own work.<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">Hans<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">On Mon, Oct 22, 2012 at 6:30 PM, Mollie Brooks <<a href="mailto:mbrooks@ufl.edu">mbrooks@ufl.edu</a>> wrote:<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite">Hi ADMB community,<br></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite">I'm working on an MAR(1) model. I need to compute the variance of the<br></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite">stationary distribution using the Vec operator and the Kronecker or direct<br></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite">matrix product.<br></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite">I'm tying to compute equation 17 from the paper "ESTIMATING COMMUNITY<br></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite">STABILITY AND ECOLOGICAL INTERACTIONS FROM TIME-SERIES DATA" by A.R. Ives,<br></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite">B. Dennis, K. L. Cottingham, and S.R. Carpenter (2003)<br></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite">It defines these as follows...<br></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite"><br></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite">"The operation Vec(A) creates a column vector out of any matrix A by<br></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite">stacking columns of A on top of each other, with the first column on the top<br></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite">and the last column on the bottom. The often-handy algebra of the Vec<br></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite">operator is reviewed by Searle (1982)"<br></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite"><br></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite">"The Kronecker or direct matrix product of M and N is formed by scalar<br></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite">multiplying N in turn by each element of M and arranging the results into a<br></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite">large matrix."<br></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite"><br></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite">I was wondering, has anyone in the community written code for these<br></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite">operators, and or coded an MAR(1) model? Would you be willing to share?<br></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite">thanks,<br></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite">Mollie<br></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite"><br></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite">Mollie Brooks<br></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite">Postdoctoral Researcher, Ponciano Lab<br></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite">Biology Department, University of Florida<br></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite"><a href="http://people.biology.ufl.edu/mbrooks">http://people.biology.ufl.edu/mbrooks</a><br></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite"><br></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite"><br></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite"><br></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite">_______________________________________________<br></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite">Users mailing list<br></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite"><a href="mailto:Users@admb-project.org">Users@admb-project.org</a><br></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite"><a href="http://lists.admb-project.org/mailman/listinfo/users">http://lists.admb-project.org/mailman/listinfo/users</a><br></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite"><br></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><kronecker.cpp><br></blockquote></blockquote><blockquote type="cite"><br></blockquote><br></div></blockquote></div><br></body></html>