<html><head><meta http-equiv="Content-Type" content="text/html charset=windows-1252"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;">Hi Oliver,<div><br></div><div>Maybe you can get by with ln_det() and solve() ?</div><div><div>solve(V,x) returns inv(V)*x</div><div><div style="orphans: 2; text-align: -webkit-auto; widows: 2; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><div style="text-align: -webkit-auto; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><div style="text-align: -webkit-auto; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><div style="text-align: -webkit-auto; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><span class="Apple-style-span" style="border-collapse: separate; border-spacing: 0px;"><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"></div></span></div></div></div></div></div></div><div><br></div><div>If by coincidence you’re trying to calculate the negative log-likelihood of a multivariate normal distribution (which appears to require those functions), instead use</div><div><div>nLL+=.5*(nobs*log(2*M_PI)+ln_det(varcov)+ diff*solve(varcov,diff));</div><div>where diff is the vector of differences between your observed and predicted values.</div><div>Come to think of it, someone should contribute a function for this distribution; I’ll put it on my to-do list.</div><div><br></div><div>What calculations are you doing? Maybe there’s a workaround.</div><div><br></div><div>Cheers,</div><div>Mollie</div><div><br></div><div><span style="orphans: 2; widows: 2; text-align: -webkit-auto;">------------------------</span></div><div apple-content-edited="true"><div style="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-text-size-adjust: auto; -webkit-text-stroke-width: 0px; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div style="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-text-size-adjust: auto; -webkit-text-stroke-width: 0px; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div style="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-text-size-adjust: auto; -webkit-text-stroke-width: 0px; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div style="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-text-size-adjust: auto; -webkit-text-stroke-width: 0px; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><span class="Apple-style-span" style="border-collapse: separate; border-spacing: 0px;"><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><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; border-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; "><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">Mollie Brooks, PhD<br>Postdoctoral Researcher, Population Ecology Research Group <a href="http://www.popecol.org">http://www.popecol.org</a><br>Institute of Evolutionary Biology & Environmental Studies, University of Zürich<br><br><br></div></span></div></span></div></div></div></div>
</div>
<br><div><div>On 2 May 2014, at 11:30, Stirrup, Oliver <<a href="mailto:oliver.stirrup.13@ucl.ac.uk">oliver.stirrup.13@ucl.ac.uk</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div lang="EN-GB" link="blue" vlink="purple" style="font-family: Helvetica; font-size: 14px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><div class="WordSection1" style="page: WordSection1;"><div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;">Dear ADMB users,<o:p></o:p></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;"><o:p> </o:p></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;">I would like to fit a model using ADMB-RE for which I require the det() and inv() matrix functions, which do not seem to be implemented for the random effects module. Reading through previous messages in the mailing list archive, it seems that there may be a work-around for this problem:<o:p></o:p></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;"><o:p> </o:p></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;"><a href="https://groups.google.com/forum/#!searchin/admb-users/matrix$20random$20effects/admb-users/cVT7VOhbhw0/0VPBJPOsX1YJ" style="color: purple; text-decoration: underline;">https://groups.google.com/forum/#!searchin/admb-users/matrix$20random$20effects/admb-users/cVT7VOhbhw0/0VPBJPOsX1YJ</a><o:p></o:p></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;"><o:p> </o:p></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;">At present, my knowledge of C++ is rather limited and I am not sure how to proceed in attempting this. Would anyone be happy to provide further guidance?<o:p></o:p></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;"><o:p> </o:p></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;">Many thanks<o:p></o:p></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;"><o:p> </o:p></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;">Oliver<o:p></o:p></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;"><o:p> </o:p></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;"><o:p> </o:p></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;"><b><span style="font-size: 8pt; font-family: Verdana, sans-serif;">Oliver Stirrup<o:p></o:p></span></b></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;"><span style="font-size: 8pt; font-family: Verdana, sans-serif;">PhD Student<o:p></o:p></span></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;"><span style="font-size: 8pt; font-family: Verdana, sans-serif;"> </span></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;"><span style="font-size: 8pt; font-family: Verdana, sans-serif;">MRC Clinical Trials Unit at UCL<o:p></o:p></span></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;"><span style="font-size: 8pt; font-family: Verdana, sans-serif;">Institute of Clinical Trials & Methodology<o:p></o:p></span></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;"><span style="font-size: 8pt; font-family: Verdana, sans-serif;">e-mail:<span class="Apple-converted-space"> </span><a href="x-msg://10/oliver.stirrup.13@ucl.ac.uk" style="color: purple; text-decoration: underline;"><span style="color: blue;">oliver.stirrup.13@ucl.ac.uk</span></a><o:p></o:p></span></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;"><o:p> </o:p></div></div>_______________________________________________<br>Users mailing list<br><a href="mailto:Users@admb-project.org" style="color: purple; text-decoration: underline;">Users@admb-project.org</a><br><a href="http://lists.admb-project.org/mailman/listinfo/users" style="color: purple; text-decoration: underline;">http://lists.admb-project.org/mailman/listinfo/users</a></div></blockquote></div><br></div></body></html>