← Back to KerryTech

The Mathematics of Weather Forecasting

From equations describing the atmosphere to probabilities describing tomorrow.

1. The Atmosphere as a Mathematical System

Weather forecasting begins with a surprisingly simple idea: the atmosphere can be represented mathematically as a system whose state changes through time.

At any particular moment the atmosphere has a state containing quantities such as temperature, pressure, humidity and wind speed at millions of locations throughout the atmosphere.

We can represent the entire atmospheric state by a vector x. A simplified mathematical description is:

dx / dt = F(x)

The function F represents the physical laws governing how the atmosphere evolves. If we knew the atmospheric state perfectly and could solve the equations perfectly, we could theoretically calculate the future.

In reality, we know the atmosphere only approximately, the equations must be simplified, and computers can only solve them numerically. These limitations are fundamental sources of forecast uncertainty.

2. The Equations Behind Weather

Modern numerical weather prediction is based on physical conservation laws. The atmosphere is treated as a fluid and its evolution is governed by a system of coupled differential equations.

Conservation of Mass

Air cannot simply appear or disappear. Changes in density are related to the movement of air.

∂ρ/∂t + ∇ · (ρu) = 0

Conservation of Momentum

Wind changes because of pressure gradients, gravity, rotation and friction.

Du/Dt = −(1/ρ)∇p + g + friction

Conservation of Energy

Heating, cooling, compression, expansion and phase changes affect the energy of the atmosphere.

Energy in − Energy out = Change in energy

Equation of State

Temperature, pressure and density are related through the properties of air.

p = ρRT

The Navier–Stokes Connection

The momentum equation can be viewed as a form of the Navier–Stokes equations used to describe fluid motion. A simplified representation is:

∂u/∂t + (u · ∇)u = −(1/ρ)∇p + g + friction

Every term has a physical meaning. The challenge is that these equations are coupled, nonlinear and must be solved across an enormous three-dimensional grid covering the atmosphere.

3. Turning the Atmosphere into a Numerical Model

A computer cannot simply solve the atmosphere as one enormous continuous equation. Instead, the atmosphere is divided into a numerical grid.

Observations
→
Initial State
→
Numerical Grid
→
Physics
→
Forecast
Simplified representation of a weather field moving across a numerical grid.

4. Why Weather Is Chaotic

One of the deepest mathematical problems in weather forecasting is that the atmosphere is a chaotic dynamical system.

Two atmospheric states that are almost identical can eventually evolve into dramatically different states.

A simplified description of this behaviour is:

d(t) ≈ d0eλt

where d0 is the initial difference between two states and λ represents the rate at which that difference grows.

Two initially similar atmospheric trajectories diverge over time.
This is the mathematical foundation of the famous butterfly effect: tiny differences in the initial state can eventually produce very different outcomes.

5. From One Forecast to an Ensemble

Because the initial atmospheric state is uncertain, modern forecasting does not rely on one single future.

Instead, a numerical model is run many times with slightly different initial conditions and sometimes different model assumptions. These are called ensemble members.

Initial State
→
Small Perturbations
→
Many Forecasts
→
Probability Distribution
Each curve represents a simplified forecast trajectory. Watch the ensemble spread develop through time.

6. Turning an Ensemble into Probability

Suppose an ensemble contains 50 forecasts and 30 of them predict rain at a particular location. A simple estimate of the probability of rain is:

P(rain) = forecasts predicting rain / total forecasts
P(rain) = 30 / 50 = 60%
Simulated probability of rain
60%
Each simulated ensemble member independently votes for or against measurable rain.

This is an important conceptual difference between a deterministic and probabilistic forecast.

Deterministic

“Rain will occur at 3pm.”

Probabilistic

“There is a 70% probability of measurable rain around 3pm.”

7. Data Assimilation

Weather models constantly receive new observations from satellites, weather stations, aircraft, ships, weather balloons, radar and other sources.

The mathematical challenge is to combine these imperfect observations with an existing model estimate.

Previous Forecast
+
New Observations
→
Updated State

A simplified Bayesian formulation is:

P(x | y) ∝ P(y | x)P(x)

Here:

A simplified Bayesian update: watch the prior, observation and posterior emerge in sequence.
PriorObservation likelihoodPosterior

8. Forecast Uncertainty as a Distribution

An ensemble can be interpreted as a probability distribution. For example, instead of predicting one temperature, the model can describe a range of plausible temperatures.

Changing the mean and standard deviation changes the forecast distribution.

The standard deviation gives a measure of forecast spread. A narrow distribution represents greater confidence; a wide distribution represents greater uncertainty.

σ = √[ Σ(x − μ)2 / n ]

9. The Mathematics of Rain

Rainfall is the result of several interacting physical processes. The simplified chain is:

Atmospheric State
→
Rising Air
→
Cooling
→
Condensation
→
Precipitation

The actual process is considerably more complicated. Cloud microphysics, convection, humidity, temperature and atmospheric stability all influence the eventual precipitation.

This is one reason precipitation is particularly difficult to forecast: small changes in atmospheric conditions can have large effects on whether, where and when rain develops.

10. Measuring Forecast Skill

A forecast is not useful simply because it looks plausible. Forecast systems must be tested against observations.

Mean Absolute Error

MAE = (1/n) Σ |y − ŷ|

Measures the average absolute difference between forecast and observation.

Root Mean Square Error

RMSE = √[(1/n) Σ(y − ŷ)2]

Penalises large forecast errors more heavily.

Bias

Bias = average(ŷ − y)

Shows whether a forecast systematically over-predicts or under-predicts.

Brier Score

BS = (1/n) Σ(p − o)2

Used to evaluate probabilistic forecasts such as the probability of rain.

The observation and forecast are drawn progressively so that the forecast error can be seen developing.

The Big Picture

Weather forecasting is ultimately a problem of predicting the future state of a chaotic physical system from incomplete and uncertain information.

Physics
→
Differential
Equations
→
Numerical
Simulation
→
Ensembles
→
Probability

The fascinating part is that the mathematics of weather forecasting connects many of the mathematical ideas explored elsewhere on KerryTech:

Probability

Forecasts describe distributions of possible futures rather than a single certain outcome.

Statistics

Observations are noisy and forecasts must be calibrated and evaluated.

Calculus

The evolution of atmospheric variables is described using differential equations.

Chaos

Small differences in the initial state can grow into major differences in the forecast.

Numerical Methods

The equations must be approximated and solved on enormous computer grids.

Risk

Ultimately the forecast is about quantifying uncertainty about future outcomes.

The surprising connection: Weather forecasting and financial risk modelling have something fundamental in common. Neither can predict the future with certainty. Both use mathematical models to describe a range of possible futures and quantify the uncertainty surrounding them.