Marx Max中文
Menu

Is a High MCMC Acceptance Rate Enough? Comparing Three Scales for One Posterior

Abstract: Random-walk Metropolis proposal scales affect finite-chain exploration. Using a one-parameter posterior with an analytic reference, this guide compares traces, acceptance, mean and spread, explains why rejected states must remain and a discarded prefix does not prove convergence, and provides all states, executed code and a rerun package.

High acceptance does not establish adequate posterior exploration. Tiny moves can leave a chain near one region for a long time, while large proposals may often be rejected. Assess the target, trace and estimates together rather than acceptance alone.

The MCMC case deliberately uses an analytically available posterior. It follows the simulated model in the econometrics guide and provides executed settings, every state, acceptance flags, figures and code for independent reruns.

Start with a simple reference target

Data follow y=1+2x+ε with independent standard-normal x and ε and independent observations, seed 42 and n=30. Inference fixes intercept 1 and error SD 1, using slope prior N(0,5²). Only a slope is inferred, not intercept or variance; this is not general Bayesian regression.

The posterior is normal with an analytic mean, SD and quantiles. This reference does not require simulated estimates to match exactly; it helps distinguish finite-sampling variation from inadequate exploration. Real models without analytic targets need other checks.

An example request is:

Keep the same simulated data, prior and target. Start at 0 and run random-walk Metropolis with proposal SD 0.01, 0.35 and 3 for 5,000 transitions each. Record all states and acceptance flags, repeating the current state after rejection. Discard 1,000 states uniformly and compare traces, mean and spread with the analytic posterior. Do not claim convergence from acceptance or pool the settings as one posterior sample.

Proposals change exploration, not the target

The symmetric normal proposal requires only an unnormalized posterior ratio for acceptance. Scale controls proposal distance, not prior or likelihood. Rejection records the current location again; keeping only accepted points removes holding times and changes the represented distribution.

Settings use the same seed for teaching comparison, not independent multiple-chain diagnostics. Acceptance covers all 5,000 transitions; means, SDs and empirical quantiles use the 4,000 retained states after discarding 1,000. Mixing those denominators makes summaries inconsistent with state records.

What this run shows

Scale 0.01 accepts about 97%, but its retained mean of about 1.696 differs from the analytic mean of about 1.853. Scale 3 accepts about 9.6% and often stays put; a closer mean still comes with a different spread. Scale 0.35 has mean and SD closer to the analytic reference, but one run does not prove convergence.

Discarding 1,000 states is a common comparison arrangement here, not automatic warmup or a convergence guarantee. Empirical quantiles may be unreliable under poor exploration; a 2.5%–97.5% table does not establish a reliable posterior interval. Formal work needs appropriately initialized independent chains and diagnostics such as effective sample size; see Stan posterior analysis. This exercise does not present its three correlated settings as those diagnostics.

Rerun the states and continue exploring

The complete package contains self-written Python, 30 simulated rows, 15,000 state rows, summaries, the analytic reference, figures, actual output and dependencies. Extract into a fresh directory, retain references, prepare dependencies following README and run python analyze.py. Analysis is offline and defaults overwrite named results/ files.

Check the completion marker, 5,000 states and 4,000 retained states per scale, and repeated previous states after rejection. Compare numerical results rather than image bytes. Increase iterations with the seed fixed to study exploration under the same target. Changing seed changes both simulated data and proposal RNG: these are different exercises. All results concern this one-parameter simulated target, not real-study posteriors or classroom effectiveness.