[ADMB Users] Matrix functions for ADMB-RE

Stirrup, Oliver oliver.stirrup.13 at ucl.ac.uk
Fri May 2 04:27:33 PDT 2014

Hi Mollie

Thank you for getting back to me quickly. I am trying to fit a model in which the likelihood is multivariate normal conditional on the realization of a set of non-normally distributed random variables, hence the need to approximate the likelihood using the ADMB-RE functionality. More specifically, I am trying to model an unbalanced longitudinal dataset (i.e. different numbers of observations per individual) using a Gaussian process structure with independent t-distributed errors for each observation. I have successfully fit models in which the residual error is normally distributed, allowing a marginal MVN likelihood to be used.

If the ln_det() and solve() functions work for ADMB-RE, then this should solve my problem, but I am still running into trouble. If I rewrite the TPL file for the model using these functions then compilation still fails, with error:

undefined reference to 'ln_det(df1b2matrix&)'

Have you successfully used these functions using ADMB-RE?

Best wishes


Oliver Stirrup
PhD Student

MRC Clinical Trials Unit at UCL
Institute of Clinical Trials & Methodology

e-mail:                          oliver.stirrup.13 at ucl.ac.uk

From: Mollie Brooks [mailto:mbrooks at ufl.edu]
Sent: 02 May 2014 11:12
To: Stirrup, Oliver; ADMB Users
Subject: Re: [ADMB Users] Matrix functions for ADMB-RE

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<mailto: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:


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 Stirrup
PhD Student

MRC Clinical Trials Unit at UCL
Institute of Clinical Trials & Methodology
e-mail: oliver.stirrup.13 at ucl.ac.uk<x-msg://10/oliver.stirrup.13@ucl.ac.uk>

Users mailing list
Users at admb-project.org<mailto:Users at admb-project.org>

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

More information about the Users mailing list