Bridging physics and statistics with a century-old model
In a new report from the Oskar Klein Centre at Fysikum, Stockholm University, researchers Marcus Högås and Edvard Mörtsell show how classic Ising formulas can replace brute-force statistics when dealing with a very common problem: binary (“yes/no”) uncertainties in data. They package the result as two practical “recipes” that any scientist can plug into their existing analysis.

Marcus presenting his research during the OKC day.
The Ising model was created over a century ago to describe how tiny magnets flip up or down. Today, the Ising model is among the most thoroughly explored systems in statistical mechanics: a staple of every course in the field and still a focus of active research – and, as it turns out, a powerful shortcut for modern data analysis.
An open-source Python implementation is available here.
When data can flip between two states
In science, nothing is ever measured with perfect precision. On top of ordinary measurement errors, researchers often face simple yes-or-no questions that affect the result:
- Does this star belong to group A or group B?
- Is this sensor reading trustworthy or contaminated?
- Is this data point signal – or background noise?
Each of these binary choices can nudge the final answer. And researchers almost never work with a single data point. With one data point there are two possibilities; with two, four; with three, eight – and so on. By the time you reach just 100 data points, there are already more than a nonillion (10^30) possible configurations.
“It's impossible to explore all possible configurations using standard methods, even for the biggest supercomputers. It’s like trying to explore a maze that splits into more paths than there are stars in the Universe — you’ll never get through,” says Marcus Högås, a theoretical physicist and cosmologist at the Oskar Klein Centre.
A physics model in disguise
Högås and Mörtsell first ran into this problem in a completely different project. The breakthrough came when they realised that the hopeless-looking combinatorics is mathematically identical to the Ising model in physics – the same framework used to describe how tiny magnets flip up or down.
“Once we saw that connection, the case of independent data points – the ‘paramagnet’ – became surprisingly simple to solve,” says Edvard Mörtsell.
The harder part was to handle situations where data points are connected, so that a change in one tends to pull others along, like neighbouring magnets influencing each other. That required some heavy mathematical work behind the scenes, even though the final formula turned out “beautifully simple”.

A flowchart depicting when the Ising model is applicable.
Two simple recipes for real data
In the published report, the Ising analogy is turned into two practical recipes:
- Independent data (“paramagnet”) – When each data point behaves on its own, the on/off uncertainty for every point can be handled with a single, very fast formula.
- Correlated data (“ferromagnet”) – When data points are linked, a mean-field approach borrowed from the Ising model lets each yes/no variable feel both an external influence and an average “pull” from its neighbours.
Together, these recipes cover the range from completely independent data to strongly connected systems – all without having to explore an impossible number of configurations.
From thermometers to the expanding Universe
To test the method, the team began with a simple thought experiment: a box full of thermometers, each measuring the same temperature — but some of them are secretly calibrated a little too high or a little too low. If you ignore this hidden “up or down” shift, your analysis can look extremely precise on paper, yet still land on the wrong temperature. By taking those up/down shifts into account, the new method produces error bars that reflect what the data truly allow.
Next, they applied the method to one of the most debated issues in cosmology: the cosmic distance ladder used to infer how fast the Universe is expanding. In particular, they examined a known “mass step” effect, where certain supernovae appear slightly brighter if they live in more massive galaxies. Their new approach confirms that this effect needs careful treatment, but in the example they studied it does not dramatically change the inferred expansion rate.
Beyond cosmology – and open code
Although the first applications are cosmological, the underlying idea is much broader. Many fields deal with binary uncertainties: medical tests that may or may not be contaminated, sensor readings that could be faulty, climate data points that might be signal or noise. Instead of making hard cuts – keeping or discarding data points – the new method lets researchers smoothly average over the possibilities in a way that is both fast and statistically well-founded.
“We hope people will use this as a small extra step in their existing workflows, rather than having to rewrite everything from scratch,” says Högås. The open-source Python implementation is designed so it can be dropped into many different types of analyses, from engineering to climate modelling or medicine – anywhere that yes/no choices play a central role.
All of the code and example notebooks are freely available online, so that others can explore the method, reproduce the results and adapt the recipes to their own problems.
For Högås and Mörtsell, the work is also a reminder that ideas can travel. A century-old model of tiny magnets, developed for fundamental physics, now doubles as a powerful tool for modern data analysis – building a bridge between disciplines that may help many different sciences navigate their own uncertain yes/no questions.
Last updated: 2026-01-30
Source: Department of Physics,Department of Meteorology