[ADMB Users] Matrix functions for ADMB-RE

Mollie Brooks mbrooks at ufl.edu
Fri May 2 03:11:33 PDT 2014

Hi Oliver,

Maybe you can get by with ln_det() and solve() ?
solve(V,x) returns inv(V)*x

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
nLL+=.5*(nobs*log(2*M_PI)+ln_det(varcov)+ diff*solve(varcov,diff));
where diff is the vector of differences between your observed and predicted values.
Come to think of it, someone should contribute a function for this distribution; I’ll put it on my to-do list.

What calculations are you doing? Maybe there’s a workaround.


Mollie Brooks, PhD
Postdoctoral Researcher, Population Ecology Research Group http://www.popecol.org
Institute of Evolutionary Biology & Environmental Studies, University of Zürich

On 2 May 2014, at 11:30, Stirrup, Oliver <oliver.stirrup.13 at ucl.ac.uk> wrote:

> Dear ADMB users,
> 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:
> https://groups.google.com/forum/#!searchin/admb-users/matrix$20random$20effects/admb-users/cVT7VOhbhw0/0VPBJPOsX1YJ
> 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?
> Many thanks
> Oliver
> Oliver Stirrup
> PhD Student
> MRC Clinical Trials Unit at UCL
> Institute of Clinical Trials & Methodology
> e-mail: oliver.stirrup.13 at ucl.ac.uk
> _______________________________________________
> Users mailing list
> Users at admb-project.org
> http://lists.admb-project.org/mailman/listinfo/users

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.admb-project.org/pipermail/users/attachments/20140502/6f7ea755/attachment.html>

More information about the Users mailing list