# R commands that show a Gibbes sampler constructed from # conditional densities with no proper joint density will # not converge x=NULL y=NULL xi=rexp(1) yi=rexp(1) for (i in 1:1000){ x[i]=rexp(1,yi) xi=x[i] y[i]=rexp(1,xi) yi=y[i] } par(mfrow=c(2,2)) plot(x) hist(x[101:1000]) plot(y) hist(y[101:1000]) #Adjust plotting parameters xq3=quantile(x,.75) yq3=quantile(y,.75) plot(x,ylim=c(0,xq3)) hist(x[x<50]) plot(y,ylim=c(0,yq3)) hist(y[y<50]) #Changing scale plot(log(x)) hist(log(x)) plot(log(y)) hist(log(y))