Solved – Only allow positive MCMC-samples: Implications for credible interval

bayesiancredible-intervaljagsmarkov-chain-montecarlo

We calculate a Bayesian model and only expect positive values for our parameters. Our prior is however a uniform prior—we get negative samples from MCMC.

For Bayes-factor calculations we use the Savage-Dickey density ratio. In order to account for the restriction to positive values, we normalize the positive area of prior and posterior distribution so they each have an area of one and calculate the density ratio.

Question: what does this mean for our credible interval? At the moment we use the interval calculated by JAGS. But JAGS doesn't know about our restriction.

I suppose the credible interval changes when discarding all negative samples? How should we calculate the correct credible interval?
Thanks a lot!

Best Answer

You can create the credible interval by

  1. taking only those iterations that satisfy your criteria
  2. calculating quantiles from samples of these iterations

In order to do this, you will need to extract the samples from JAGS.

As @Glen_b mentioned, you could also encode this in the prior. In JAGS, you can do

theta ~ dunif(0.5,1)

or, on the probit scale,

theta <- pnorm(logit_theta,0,1)
logit_theta ~ dnorm(0,1)I(0, )

Now, the intervals calculated from JAGS will have the proper truncation.

With all this being said, you may want to allow for the possibility that $\theta$ is negative. You may expect that the participants will achieve at least chance performance, but they may do worse (perhaps they are using external information that is bad).