statistics

least squares fitting

Fitting by minimising the sum of squared residuals — the special case of maximum likelihood when errors are Gaussian and equal.
22 related articles

Description

Least squares fitting is a mathematical procedure for finding the best-fitting curve or line through a set of data points. The 'best' fit is defined as the one that minimizes the sum of the squares of the vertical distances (residuals) between the data points and the fitted curve. This approach is ubiquitous in science and engineering because it provides a principled way to extract parameters from noisy measurements, from calibrating instruments to testing physical theories.

History

The method was first published by Adrien-Marie Legendre in 1805, and Carl Friedrich Gauss claimed to have used it earlier, around 1795, for astronomical calculations.

How it works

For a given model (e.g., a straight line y = mx + b), you compute the residual for each data point: the difference between the observed value and the model's prediction. Squaring each residual removes the sign, penalizes large deviations more heavily, and makes the sum differentiable. The parameters (m and b) are then adjusted using calculus (or numerical methods) until the sum of squared residuals reaches a minimum. This minimum corresponds to the most likely parameter values if the measurement errors are independent and normally distributed with equal variance.

In practice

Used in virtually every field of quantitative science: fitting calibration curves in chemistry, determining Hubble's constant from supernova data, and estimating parameters in machine learning regression models.

Fun fact

The name 'least squares' comes from the fact that the solution minimizes the sum of the squared residuals, not the sum of the absolute residuals, which would be more robust to outliers but is harder to compute analytically.

Related articles · 22

How to pick a crystal thickness in 50 simulations
A translator at the negotiating table doesn't listen to every word; they grasp the meaning of whole phrases. Electron microscopy poses a similar challenge: you need to figure out the crystal's thickness and its tilt in the beam, and all you have is a diffraction pattern, a mosaic of thousands of bright and dark spots.
Statistical ML2026-08-171 minarXiv:2608.16506express
How to See Shape When Data Are Unevenly Sampled
Two photographers shoot the same mountain. One takes a hundred shots from the summit and only a couple from the base; the other does the opposite. If you try to align their images, the algorithm might decide that the summit in one photo matches the summit in the other simply because there are many similar points there, not because it's the same spot. Sampling density throws it off.
Quantum Physics2026-08-052 minarXiv:2608.04876express
A Quantum Compass for 3D Vision
A camera looks at two distant sparks. They're so close together that they merge into a single fuzzy blob. It seems impossible to tell them apart — the classic limit of optical microscopy has been reached. But quantum mechanics hints that the light field still holds a secret about where each spark sits.
General Relativity2026-08-021 minarXiv:2608.01061express
Listening to the Echo of a Black Hole
You could send a short radio pulse toward a black hole and wait for the reflected echo. Intuitively, the shorter the signal, the better it would probe the finest details of spacetime right at the horizon: that region from which even light cannot return.
Cosmology2026-07-205 minarXiv:2607.17942
Gaussian Mask Falls: How 4 610 Universes Changed Cosmological Statistics
4 610 universes — that's exactly how many cosmological models astrophysicists needed to show that the familiar Gaussian mask no longer works for next-generation data. Future sky surveys, such as the Euclid mission and the Vera C.
General Relativity2026-07-172 minarXiv:2607.16158express
The Universe Is a Bit More Complex Than We Thought
Gravity isn't just the force that keeps us on the floor. On cosmic scales, it conducts galaxies, bends light rays, and decides the fate of everything. A century ago, Einstein described it as the curvature of space and time.
Signal Processing2026-07-161 minarXiv:2607.14597express
Self-Taught Algorithm: How to Hear a Melody from Noise
Reconstructing a full picture from fragments is like discerning an orchestra's melody in a noisy hall. Such challenges arise in photometry, where a star's brightness is recovered from faint twinkling. Traditional methods need precise noise information, which is almost always unknown.
math.OC2026-07-151 minarXiv:2607.13701express
How to Keep a Problem from Ballooning: A Fast Method for Machine Learning
The standard approach to a certain class of machine learning problems is like a spring that's been stretched and then forgotten: standard methods artificially inflate the problem's size, turning computations into a black hole for memory and time.
Quantum Physics2026-07-121 minarXiv:2607.10518express
Why a Laser Sensor Trembles Even in Perfection
A laser is like a tuning fork that rings at a single note. But even in complete silence, its sound trembles slightly. Previously, it was thought that this tremor, random kicks from spontaneous emission of light by atoms inside the laser, was the main limit to precision.
Squealer: When the Model Squeals, Rejecting Your Data
Statistical models are an attempt to stretch a perfect mathematical web over the uneven landscape of data. When a model resists, it emits tension, but we've grown accustomed to ignoring it. Researchers spend hours staring at residual plots, trying to guess where the model is 'coming apart at the seams.' Squealer translates this resistance into sound.
Optics2026-06-201 minarXiv:2606.21945express
Neural Networks That Have Internalized the Laws of Nature
Ordinary neural networks learn from examples, like a person memorizing tunes by ear. But networks with physical laws embedded from the start resemble a musician who knows notes and harmony: they can play a new piece from just a few chords. Instead of mindless memorization, they use equations like energy conservation or motion.
Optics2026-05-092 minarXiv:2605.08880express
A Flat Lens That Pretends to Be Thick Glass
Light needs space. A camera lens sits several centimeters from the sensor so the rays have room to focus. Now, that gap has been squeezed to the thickness of a sheet of paper, and light still behaves as if it had traveled its rightful centimeters. That's what 'spaceplates' do: flat elements that mimic free-space propagation.
Dynamical Systems2026-04-192 minarXiv:2604.17528express
Five Faces of the Same Randomness
In a big city after rain, water collects in the same low spots no matter where the first drops fall. An hour later, the pattern of puddles hardly depends on where the downpour started. That is equilibrium — the outcome a system reaches regardless of its start, once the details are forgotten.
Optics2026-03-291 minarXiv:2603.27815express
How to Measure an Ultrashort Laser Pulse
A laser flash lasts a few femtoseconds — imagine a single instant stretched into a million parts. Such a flash mixes many colors, from red to violet. Instruments that measure the pulse shape often err: they see some colors well and others poorly, blurring the picture. The authors propose a simple fix.
Physics and Society2026-03-151 minarXiv:2603.14564express
How to Thin a Network Without Tearing It
A dense social network: everyone is connected to almost everyone else, and in this web it's hard to see who really matters. Too many threads — computers choke, simulations stall. Scientists have figured out how to prune such networks without losing what's essential. The idea is to remove connections that don't participate in shortest paths.
Fluid Dynamics2026-02-221 minarXiv:2602.19336express
Microbe Swimmers: How Body Shape Dictates Trajectory
A microbe with flagella rows through water the way a person rows with their arms. But if a person swims breaststroke, they go forward, while a microbe goes in a spiral. The reason is that a microbe has no single direction: each part of its surface pushes water in its own direction, and the body twists like a corkscrew.
Applied Statistics2026-02-211 minarXiv:2602.18727express
Seeing Molecules Without Cheat Sheets
Glowing spots on a dark background: that's what single-molecule images from MINFLUX look like. This microscope can reveal details smaller than five nanometers: roughly ten thousand times thinner than a human hair.
HEP Phenomenology2025-12-161 minarXiv:2512.14821express
Quantum Sensors Will Hear the Hum of Dark Matter
Dark matter makes up 85% of the matter in the Universe, yet remains invisible. It only reveals itself through gravity. We can catch it by its cosmic 'hum' — a faint vibration that permeates space. A single detector is powerless here: the signal is too quiet. Physicists turn many sensors into a quantum ensemble.
Maximum Quantum Entanglement: Hidden Symmetry and the Mirror Universe
In the silent heart of creation, where particles converge and part, an act of pure harmony is born. Two Higgs bosons meet and for a fleeting moment form a single whole — and if one demands that their quantum entanglement always reaches its limit, like a tuning fork setting a perfect pitch, then the equations suddenly light up with a new symmetry.
cs.CE2025-01-223 minarXiv:2501.12756
The Sculptor of Informativeness: How to Carve a Specimen That Tells Its Own Story
A mechanical testing lab is like a kitchen where a chef tastes a dish to guess the recipe. For an anisotropic material, one that is stiffer along its fibers than across them, a single taste is not enough. You need three or more separate tests, each with its own specimen. Engineers have spent years refining specimen shapes by hand, relying on intuition and experience.
Calibrating for Small Data: The GOAL Algorithm
An optician turns the frame, adjusts the focus, and a blurry spot becomes a sharp image. The new algorithm GOAL works much the same way: it rotates the data cloud, compresses redundant dimensions, and brings into focus what truly matters.
Where Does the Boundary Lie: Algorithm Finds Groups by Gaps in Data
Imagine a border river that separates two countries. On one bank live one group of people, on the other, another. The boundary between them is not always obvious: in some places the river is wide and calm, in others narrow and turbulent. But it is exactly where the current changes abruptly that the border becomes most noticeable.