mcmc

Templated Barton and Nackman Trick Problems

I'm trying to implement class using the Barton and Nackman trick to avoid dynamic dispatch. (I'm writing MCMC code where performance matters.) I'm not a C++ expert but the basic trick is working for me elsewhere. However I now have a case where the second derived class needs to be templated. This seems to cause problems. The outline ...

R: MCMClogit confusion

Could anybody explain to me why simulatedCase <- rbinom(100,1,0.5) simDf <- data.frame(CASE = simulatedCase) posterior_m0 <<- MCMClogit(CASE ~ 1, data = simDf, b0 = 0, B0 = 1) always results in a MCMC acceptance ratio of 0? Any explanation would be greatly appreciated! ...

How to define custom distributions in JAGS?

Hi, I am using JAGS for simulating some MCMC distributions. I see the support for a sizeable set of distributions. But, I would like to sample out of a specific distribution that is not defiend in JAGS. Does anyone know how to write our own custom distributions? Thanks! ...