The Gelman-Rubin statistic for our chains is good. Anything below 1.1 or 1.2 is usually considered decent, so this is a great result: our chains mix well, and none of them got stuck anywhere.


This statistic and others like it can be extended to answer questions like "how many samples should we discard at the start?" and "how many samples do we need to answer a particular question?" in an objective way.

We can do something even better by cheating: we know the exact posterior, so we can just directly compare it to the chains we have.

Code
Output

The Gelman-Rubin statistic for our chains is good. Anything below 1.1 or 1.2 is usually considered decent, so this is a great result: our chains mix well, and none of them got stuck anywhere.


This statistic and others like it can be extended to answer questions like "how many samples should we discard at the start?" and "how many samples do we need to answer a particular question?" in an objective way.

We can do something even better by cheating: we know the exact posterior, so we can just directly compare it to the chains we have.

Code
Output