Sorry but partially observed nodes are not permitted in JAGS.
Martyn
On Mon, 2014-10-13 at 15:42 +0200, Achaz von Hardenberg wrote:
> Hi,
>
> I am trying to replicate in JAGS on my own data the OPEN BUGS code for a Pagel’s lambda model (you can find it here: http://link.springer.com/content/esm/art:10.1186/1471-2148-12-102/file/MediaObjects/12862_2012_2257_MOESM1_ESM.pdf) in the supple. materials of this paper: http://link.springer.com/article/10.1186%2F1471-2148-12-102
>
> My model looks like this:
>
> bovids.jg<-function(){
> #Linear regression and multivariate normal likelihood
> for (i in 1:Nspec) {
> mu[i] <- alpha+beta*GS[i]
> }
> Lf[1:Nspec]~dmnorm(mu[],TAU[,])
> #Priors
> alpha ~ dnorm(0,1.0E-06)
> beta ~ dnorm(0,1.0E-06)
> lambda ~ dunif(0,1)
> tau ~ dgamma(1,1)
> sigma <- 1/sqrt(tau)
> #Tree sampling and lambda computation
> for (k in 1:Ntree) {
> p[k] <- 1/Ntree
> }
> K~dcat(p[])
> #LAMBDA is a matrix with off-diagonal lambda value and 1 in the diagonal
> Mlam <- lambda*multiVCV[,,K]+(1-lambda)*ID
> TAU <- tau*inverse(Mlam)
> }
>
> It works fine, as long I do not have missing values in the dependent variable (Lf). In which case I get the following error message:
>
> Error in jags.model(model.file, data = data, inits = init.values, n.chains = n.chains, :
> RUNTIME ERROR:
> Compilation error on line 6.
> Lf[1:97] has missing values
>
> Should JAGS not take care on his own of the missing values?
>
> Thanks a lot to anybody can help me!
>
> best regards,
>
> Achaz von Hardenberg
>
> -------------------------------------------------------------------
> This list is for discussion of modelling issues and the BUGS software.
> For help with crashes and error messages, first mail [log in to unmask]
> To mail the BUGS list, mail to [log in to unmask]
> Before mailing, please check the archive at www.jiscmail.ac.uk/lists/bugs.html
> Please do not mail attachments to the list.
> To leave the BUGS list, send LEAVE BUGS to [log in to unmask]
> If this fails, mail [log in to unmask], NOT the whole list
-------------------------------------------------------------------
This list is for discussion of modelling issues and the BUGS software.
For help with crashes and error messages, first mail [log in to unmask]
To mail the BUGS list, mail to [log in to unmask]
Before mailing, please check the archive at www.jiscmail.ac.uk/lists/bugs.html
Please do not mail attachments to the list.
To leave the BUGS list, send LEAVE BUGS to [log in to unmask]
If this fails, mail [log in to unmask], NOT the whole list
|