Hi all,
I have a mark recapture model that is very similar to the model found on page 105 of the Stan User’s Guide. The model allows me to code for individual effects; However, I am unsure whether I have coded it right to using the bridgesampling package in R to estimate posterior probabilities. According to the paper associated with the bridgesamplingg package, the “models need to be implemented in a way that retains the constants” using target +=. I am not sure how to do this in the model as specified in the manual, which looks like this:
model {for (i in 1:I)
{if (first[i] > 0) {
for (t in (first[i]+1):last[i]) {
1 ~ bernoulli(phi[t-1]);
y[i, t] ~ bernoulli(p[t]);
}
1 ~ bernoulli(chi[last[i]]);
}
}
}
I know this is not a lot to go on, so I apologize in advance.