|[ADMB Users] MVN Example?||Chris Gast||3/14/12 2:50 PM|
Does anyone have some code to compute the log-likelihood for a multivariate normal model that they're willing to share? I'm having trouble getting matrix determinants and inverses to work.
I found a link to a previous discussion, indicating such an example would be available in Roa's article "A Likelihood-Based Model of Fish Growth With Multiple Length Frequency Data" in JABES, but I'm having trouble accessing the supplementary material.
If I can get this working (a weighted LMM with autocorrelated residuals and spatially-correlated random effects), I'd be happy to add it to the examples list, since I can't seem to find a MVN likelihood example there either.
|Re: [ADMB Users] MVN Example?||Mollie Brooks||3/14/12 4:39 PM|
I'm doing an MVN model. My procedure section looks like this
for(int i=1; i<=ncoeffs; i++)
for(int p=1; p<=nponds; p++)
The first for loop scales all my coefficients to make it conditioned better.
Then I have observations of a bunch of ponds and each pond is assumed to be independent of the others.
I defined functions calc_predictions() and calc_varcov() to fill in those objects; the code in these is pretty specific to my problem. The important thing fir efficiency is that my covariates are in a design matrix created using model.matrix() in R.
Try using solve() where I have solve2(). If you have a problem with solve, I'll explain the complications of why I used this version.
I hope this helps.
NSF IGERT Fellow
University of Florida
|Re: [ADMB Users] MVN Example?||Chris Gast||3/14/12 4:52 PM|
Thanks, Mollie. For some reason, ADMB can't seem to find the ln_det() function.
test_mat.obj:test_mat.cpp:(.text+0x13af): undefined reference to `ln_det(df1b2matrix&)'
I'll keep playing with it and see if I can figure it out.
|Re: [ADMB Users] MVN Example?||Chris Gast||3/14/12 5:55 PM|
After changing line 1978 in df1b2fun.h to match the correct function header on line 220 of df1b2ludcmp.cpp, I got your syntax working successfully.
I'm not sure who specifically to address regarding making this correction, but hopefully they're reading this thread already....?
Mollie: I'm interested in what complications you experienced with solve(). Is this related to some speed issues which I found noted on previous admb-users posts?
Thanks Mollie (and Jim Ianelli for an off-list reply).
|Re: [ADMB Users] MVN Example?||Rubén Roa||3/15/12 3:30 AM|
Rubén H. Roa-Ureta, Ph. D.