statistics

metropolis hastings algorithm

The basic Markov chain rule: propose a step, accept it with a probability set by the ratio of posteriors.
32 related articles

Description

The Metropolis-Hastings algorithm is a Markov chain Monte Carlo (MCMC) method for sampling from a probability distribution when direct sampling is impossible. It is the workhorse of Bayesian computation, allowing one to generate a sequence of samples that asymptotically follow the target posterior distribution, even when the normalising constant is unknown. This makes it indispensable for parameter estimation and model comparison in complex, high-dimensional problems.

History

The algorithm was introduced by Nicholas Metropolis in 1953 for a specific case, and generalized by W. Keith Hastings in 1970. It gained widespread use in physics and statistics in the 1980s and 1990s with the rise of computational power.

How it works

Starting from an initial point, the algorithm proposes a new point according to a proposal distribution. It then computes the ratio of the posterior densities at the proposed and current points. If the ratio is greater than 1, the proposal is accepted; otherwise, it is accepted with probability equal to the ratio. This acceptance rule ensures that the chain spends more time in high-probability regions, and over many steps, the distribution of visited points converges to the target distribution. The proposal distribution can be tuned to balance exploration and efficiency.

In practice

It is used in particle physics for fitting complex models to data, in cosmology for exploring the parameter space of the universe, and in finance for risk assessment and option pricing.

Fun fact

The algorithm was originally developed to compute the equation of state of a hard-sphere gas, and its inventors used one of the first electronic computers, the MANIAC, at Los Alamos.

Related articles · 32

Chaos in Chemistry: How Information Loss Reveals Kolmogorov-Sinai Entropy
Write down a recipe, then check it an hour later: if the proportions are off by even a gram, the taste is gone. Chemical reactions in open systems behave much the same way: the slightest difference in initial concentrations grows over time into completely different states.
Galaxies2026-07-283 minarXiv:2607.26125express
How Galactic Bars Change the Dance of Black Holes
A galaxy collision is like a slow dance in which two partners gradually draw closer. Hidden at the center of each is a supermassive black hole — an invisible flywheel with a mass of millions or billions of suns.
Galaxies2026-07-222 minarXiv:2607.20006express
How Dancing Galaxies Reveal Their Masses
Two galaxies (our Milky Way and its satellite, the Large Magellanic Cloud) slowly circle each other. Their gravitational pull stirs the distant outskirts of the Milky Way, like a pebble thrown into a pond makes the water ripple.
Sentinel with a Map: Hunting Free-Floating Planets
Two hundred million stars. In the heart of the Galaxy, where the future survey by the Nancy Grace Roman telescope will aim, about 250 times during its mission the light of one of them will flicker at an invisible touch.
eess.SY2026-07-151 minarXiv:2607.13513express
Smart Shower: Taming an Unpredictable System
You're standing in the shower: you turn the tap, and the water is either freezing or scalding. The pipes have a mind of their own — the pressure jumps unpredictably. The new controller learns on the go: it doesn't know the plumbing layout, but within minutes it adapts and gently guides the temperature to comfort, without breaching safety limits.
eess.SY2026-07-141 minarXiv:2607.12343express
How a Smart Algorithm Learns Not to Crash
A driver on a slippery road doesn't know exactly how the car will respond to the steering wheel, and learns on the go, leaving room for error. A smart control algorithm behaves in a similar way.
math.OC2026-07-141 minarXiv:2607.12775express
Smart Acceleration: Teaching the Power Grid to Think Faster
Power systems with solar panels and wind turbines are like a chess game: cloud cover and load changes are the opponent's moves, impossible to foresee. To maintain balance, operators used to run through dozens of scenarios (uncertainty) — that took too much time and computing power.
Digital Polisher: How a Neural Network Unveils the Secrets of Binary Gravitational Lenses
Gravitational microlensing is a fascinating cosmic effect predicted by Einstein and developed by Zwicky. A massive body passing between us and a distant star bends its light like a lens, creating characteristic magnifications and distortions.
Galaxies2026-07-063 minarXiv:2607.05510
Flattened Darkness: Stellar Streams Outline Invisible Halos
Dark matter — the invisible foundation of cosmic architecture — makes up 85% of all mass, yet eludes direct observation. In the 1920s, Edwin Hubble discovered the expansion of the universe and the realm of galaxies; by the 1930s, Fritz Zwicky suspected hidden mass in their clusters.
Quantum Physics2026-07-031 minarXiv:2607.03622express
Quantum Dance of Dust Grains in a Magnetic Trap
A magnetic field holds a tiny particle in mid-air, like an invisible dance partner. A special tuning of the field creates a trap with two "positions." In the ordinary world, a dancer occupies only one, but in the quantum world — both at once. Physicists have learned to achieve this for dust grains weighing trillionths of a gram.
Genes Speak Different Languages — A Neural Network Found a Common One
60 mice, 1,980 samples, 234 lung cancer patients. Behind each number lie thousands of genes. Their activity is measured to understand the disease. But the data aren’t uniform: for one patient, you assess a protein level (a continuous number), make a diagnosis (yes/no), and determine the tumor subtype (a category).
Symphony of White Dwarfs: How a Neural Network Learns to Hear LISA's Gravitational Music
The Universe is not silent: it is filled with a continuous gravitational-wave hum. In a decade, the LISA space observatory will tune its "ears" to the millihertz range, and the richest source will be our Galaxy — tens of thousands of white dwarf pairs whirling in a frantic dance.
q-bio.QM2026-06-211 minarXiv:2606.22448express
How a cell quickly assembles DNA copies
A cell is like a library where thousands of books are copied every day. Molecular machines, polymerases and ribosomes, slide along a template chain and assemble a copy, link by link. These machines have several states: they can slow down, make mistakes, or switch. Previously, calculating such a process took hours.
High Energy2026-05-251 minarXiv:2605.25980express
Why Black Holes Dance Differently
Pairs of black holes dance in three different styles before merging. The first is a neat waltz: the objects swirl in the same direction, like partners facing the same way. Such pairs are born from binary stars and often have unequal masses. The second is chaotic disco: spins are scattered, masses nearly equal.
Physics and Society2026-05-241 minarXiv:2605.25248express
Communities by Size: When Networks Assemble Like a Puzzle
A social network is like a city: there are giant neighborhoods and tiny alleys. When an algorithm looks for tight-knit groups, it often picks out a couple of huge clusters and many small fragments. But the client (say, a municipality) needs districts of roughly equal size to distribute clinics or schools evenly.
High Energy2026-05-212 minarXiv:2605.23083express
Why Black Holes in a Pair Look So Alike
In space, merging black hole pairs are common, and often one is noticeably more massive than the other. This mass difference isn't just a number: it's a key to their shared history. Astrophysicists studied the stable mass transfer channel — a process where matter flows smoothly from one star to another without disrupting the system.
Instrumentation2026-05-172 minarXiv:2605.17546express
How to Assemble a Galaxy in One Step
An artist paints a portrait stroke by stroke, and then someone offers them a flash camera — one click, and it's done. That's roughly the shift from multi-step models to one-step models in generating images of galaxies. Typical neural networks for image synthesis work like a watercolorist: they apply a layer, blur it, add details.
Medical Physics2026-05-122 minarXiv:2605.11637express
How to Spot a Detail Without Overexposing
An X-ray tomograph is like a carpenter who examines a log from all sides to see where the void is inside. It takes dozens of flat shadow images, rotating the source and detector around the object. Then a 'reconstruction' program glues these shadows into a 3D model. The quickest reconstructor is the FBP algorithm (filtered back projection).
Statistical Mech2026-05-092 minarXiv:2605.09148express
How to Tune a Molecular Motor Without Losing Your Mind
Imagine a factory where hundreds of tiny assembly lines run nonstop. Each line is a molecular motor that converts chemical fuel into motion. To make the motor go faster or in the right direction, an engineer tweaks the settings — the shape of parts, the strength of interactions.
Windows into the Same Mechanism: How Thousands of Neighbors Reveal Hidden Links
Seven snapshots of the sky after the eruption of Mount Pinatubo. Each snapshot is a map of concentrations for dozens of substances. The question is simple: which substance turns into which? But how do you infer a causal chain from seven frames when you have more variables than time points? M-CaStLe looks at the map differently.
General Relativity2026-04-272 minarXiv:2604.24330express
A Gravitational Call a Minute Before the Merger
A huge pond, with ripples spreading from two heavy stones circling each other. The stones draw closer, the ripples become more frequent and stronger, and soon the stones will collide. Gravitational waves are like those ripples, but not on water — in the very fabric of spacetime.
cs.ET2026-04-181 minarXiv:2604.17109express
The Machine That Doesn't Get in Its Own Way
An orchestra where each musician plays their own part but hears only the neighbor. One wrong note, and a wave of errors rolls through the hall. That's how Ising machines work — special devices for solving problems where you need to find the best option among many.
q-bio.QM2026-04-182 minarXiv:2604.18634express
The Heart as a Map: Topology Reveals Hidden Patterns in Cardiac Rhythm
Each heartbeat can be drawn as a point on a sheet of paper. Thousands of these points merge into a cloud. The Mapper algorithm turns this cloud into a network: it connects points that behave similarly and colors them according to blood flow strength. The result is not just a pile of numbers but a colored map showing which parts of the heart work in sync and which are out of step.
Materials2026-03-221 minarXiv:2603.21207express
How a Seven-Metal Alloy Develops a Memory
A seven-metal alloy is like a team where every player is pulling the blanket their own way. Atoms of iron, cobalt, nickel, aluminum, titanium, tantalum, and vanadium can either fall into a strict pattern or scatter into random positions. This determines whether the material will be as strong as steel or as light as aluminum.
How to Tune a Silicon Detector for Accurate Particle Counting
In a particle accelerator, nuclei shatter into fragments like a porcelain cup dropped on the floor. Each fragment flies through silicon wafers, which register the impact and its strength. But to distinguish a real signal from random noise, you need a threshold: below it, readings are considered interference.
Atomic Physics2026-03-101 minarXiv:2603.09350express
How to Count Atoms More Precisely
An electron in an atom is like a note on a string: it has a set of allowed energies, and the physicist's task is to find these notes. Usually, the space around the nucleus is divided into small pieces and the behavior of the electron in each piece is calculated. The finer the pieces, the more accurate the answer.
Instrumentation2026-03-041 minarXiv:2603.04535express
Neural Network Clears the Gravitational Lens from Ancient Light
Light born at the moment of the Big Bang has traveled to us for almost 14 billion years. But along the way, it passed through the gravitational fields of galaxies and clumps of dark matter, which bent its rays. To an observer, this looks like an image stretched and smudged by an old window pane.
Disordered Systems2026-01-031 minarXiv:2601.01243express
Electricity in Disordered Materials: Electron Hopping
In disordered materials, such as organic semiconductors or inks made from two-dimensional materials, electrons don't move smoothly like water through a pipe. Instead, they hop from one spot to another, like a ball bouncing across a rough surface. This kind of motion is called hopping transport.
High Energy2026-01-011 minarXiv:2601.00500express
How to Catch a Pulsar That Spins Too Fast
A pulsar is a dead star that spins and emits radio pulses like a lighthouse. If a pulsar has a companion, they whirl around a common center of gravity.
stat.ME2023-11-193 minarXiv:2311.11445
Hidden Ocean Regimes: How to Catch Non-Integer Delays
The ocean doesn't always stick to the same schedule. Sometimes the warm El Niño current strengthens, sometimes it weakens, and each regime dictates its own reaction speed to the past. These hidden regimes are like shifts in currents that remember their path with different depths.
stat.ME2023-06-082 minarXiv:2306.04966
Hybrid Spectral Analysis: How a Bayesian Method Combines the Precision of Parametrics with the Flexibility of Nonparametrics
A rough sketch of a portrait: a few confident lines define the shape, but the details are not yet refined. That is how a parametric model, such as vector autoregression (VAR), describes a time series: it captures the main structure, but if the real data deviate from its assumptions, the portrait comes out distorted.
stat.ME2017-06-182 minarXiv:1706.05661
An Orchestra Where Every Instrument Enters on Its Own Schedule
An orchestra plays a complex piece, and each group of instruments enters on its own schedule. The violins might slow down while the woodwinds keep the same tempo, and the percussion might suddenly burst into a roll. The conductor hears everything at once, but pinpointing the exact moment when the flutes, not the cellos, changed rhythm is nearly impossible.