A density known up to a constant
The topic Monte Carlo methods turned an expectation into an average of independent samples, with an error of about . Its samplers need either a formula for the inverse CDF or a proposal close to the target, and rejection and importance sampling both degrade quickly as the dimension grows. The topic ended with the hard case: a density known only up to a constant.
In Bayesian statistics this case is the rule. Take the coin with unknown bias from the topic Bayesian inference: 7 heads in 10 tosses and a uniform prior. Bayes' formula gives the posterior as prior times likelihood, divided by the evidence:
Here happens to have a formula: the posterior is with mean , and that lets us check every answer below. Replace the uniform prior by one without a conjugate partner, or the coin by a logistic regression with a hundred weights, and becomes an integral over a hundred dimensions that nobody can compute. The unnormalized density stays cheap: one factor per observation.
What can we do with alone? We can compare two points. The constant cancels in a ratio:
We know how many times more probable one point is than another, but not how probable either of them is.
The topic Markov chains supplies the other half. By the ergodic theorem, one long run of an irreducible chain spends in each state a share of time equal to its stationary probability, and averages along the run converge to expectations under . Read backwards: if we build a chain whose stationary distribution is , running it produces samples from . This is Markov chain Monte Carlo (MCMC). The whole topic is about building such a chain from ratios of .