It's asking a lot for 1000 samples to perfectly describe a distribution, even if they were generated directly from the posterior. For a fairer test, let's compare apples to apples and samples to samples:

  • First, we have the Metropolis-Hastings samples, pooled together.
  • Then, we have a sample of the same number of points, only using a direct sample from the posterior. This is basically the best-case scenario for Metropolis: if we only generate 10,000 samples, we can't possibly get better estimates for our distribution than what 10,000 samples from that distribution would tell you.
  • Finally we have the true values for the distribution.

All in all, a pretty good result!

plot

It's asking a lot for 1000 samples to perfectly describe a distribution, even if they were generated directly from the posterior. For a fairer test, let's compare apples to apples and samples to samples:

  • First, we have the Metropolis-Hastings samples, pooled together.
  • Then, we have a sample of the same number of points, only using a direct sample from the posterior. This is basically the best-case scenario for Metropolis: if we only generate 10,000 samples, we can't possibly get better estimates for our distribution than what 10,000 samples from that distribution would tell you.
  • Finally we have the true values for the distribution.

All in all, a pretty good result!

plot