Greetings,
I want to explain variation in population growth rate r of some species. I'd like to treat r as a random variable (give it a distribution), and then model the mean of that distribution in a linear model. I tried to define r to be the ratio of population size at time t+1 and t, and then model the log-transformed r with a linear model. But my model specification seems to have a bug in it because WinBUGS gives me an error "expected right parenthesis". I would welcome any advice. Thank you! (Code provided below.)
Indy
model {
# Specify the priors for all parameters in the model
# Priors on intercepts
a0 ~ dnorm(0,0.01)
b0 ~ dnorm(0,0.01)
#priors on slopes
a1 ~ dnorm(0,0.01)
taulr ~ dgamma(10,1)
# First year
for(i in 1:nsite){
N[i,1] ~ dpois(lambda[i])
log(lambda[i]) <- a0 + a1*elev[i]
}
# Later years
for(i in 1:nsite){
for(t in 1:(nyear-1)){
N[i,t+1] ~ dpois(N[i,t] * r[i,t]) # Express N[i,t+1] in an autoregressive manner
log(r[i,t]) <- logr[i,t]
logr[i,t] ~ dnorm(mulr[i,t], taulr) # model log(r) as a normal random variable with mean modelled by covariates
mulr[i,t] <- b0
}
}
# End model specification
}
-------------------------------------------------------------------
This list is for BUGS users to support each other, ask questions or share ideas.
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
|