Solution (source code)

= Solution
{c}

Use several complementary <Markov chain Monte Carlo convergence diagnostics>, monitoring both $p$ and $\beta$ rather than judging the chain solely by its length:

* <Trace plots> of each parameter and the <log-posterior> against iteration, including early iterations and later windows. Look for initial drift, long flat stretches, abrupt switches and sustained changes in spread. Several <independent> chains started at dispersed points should explore the same region after <burn-in>.
* Plots of cumulative <sample means> and selected <sample quantiles> against iteration. Compare chains and successive long blocks; persistent movement indicates that the estimated <posterior moments> or tails have not stabilized.
* <Autocorrelation function> plots for both parameters after tentative <burn-in>. Slow decay reveals strong serial dependence and a small <effective sample size of a Markov chain>, even when $10^6$ iterations have been generated.
* Overlaid <histograms> or <kernel density estimation> curves from successive retained blocks and from different chains. Their agreement provides evidence of stable marginal <posterior distributions>.
* A <scatter plot> of retained $(p,\beta)$ pairs, colored by time block if helpful. Strong dependence or separate clusters can expose slow joint exploration that marginal plots conceal.

\b[A million iterations and stable-looking plots do not prove convergence.] Agreement across dispersed chains, exploration of all visible modes and adequate <effective sample size of a Markov chain> provide stronger evidence. Estimate the <Monte Carlo standard error> using the chain's <autocorrelation>; the <independent random variables> formula from 3(b)(ii) does not apply directly to these dependent draws.