Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.
μ-α(x+μ) and ν-α(x+ν)
with α a positive coefficient. Or the reciprocal,
-μ+(μ-x)/α and -ν+(ν-x)/α
for… reversibility reasons. In that case, the acceptance probability is simply the Jacobian of the transform to the proposal, just as in reversible jump MCMC.
Returning to the curio, the originator of the question had spotted some discrepancy between the target and the MCMC sample, as the moments did not fit well enough. For a similar toy model, a balanced Normal mixture, and an artificial flip consisting of
x’=±1-x/2 or x’=±2-2x
implemented by
u=runif(5) if(u[1]<.5){ mhp=mh[t-1]+2*u[2]-1 mh[t]=ifelse(u[3]<gnorm(mhp)/gnorm(mh[t-1]),mhp,mh[t-1]) }else{ dx=1+(u[4]<.5) mhp=ifelse(dx==1, ifelse(mh[t-1]<0,1,-1)-mh[t-1]/2, 2*ifelse(mh[t-1]<0,-1,1)-2*mh[t-1]) mh[t]=ifelse(u[5]<dx*gnorm(mhp)/gnorm(mh[t-1])/(3-dx),mhp,mh[t-1])
I could not spot said discrepancy beyond Monte Carlo variability.
R-bloggers.com offers daily e-mail updates about R news and tutorials about learning R and many other topics. Click here if you're looking to post or find an R/data-science job.
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.