You record one measurement from a changing system, such as a population count or a sensor reading. The trace looks irregular, but that does not by itself tell you whether the changes come from noise or from deterministic dynamics. Chaotic dynamics can make a deterministic system look noisy. Its recent history may carry information about parts of the system you cannot measure directly.
The recent history can supply missing coordinates, as Takens' 1981 result describes. We reconstruct a Lorenz state from one measured coordinate. Simplex projection gives correlation 0.99 a third of a time unit ahead, against 0.39 for linear forecasting. A Lyapunov exponent near 0.96 per time unit limits how far that improvement extends.
Let's Build It
Click the badge to open the full, runnable notebook in Google Colab:
Here is the whole trick, animated: we feed in one variable of the Lorenz system, the signal, and out comes the butterfly attractor traced in a space built only from delayed copies of .

import numpy as np
def lorenz(n, dt=0.01, sigma=10.0, rho=28.0, beta=8.0 / 3.0,
x0=(1.0, 1.0, 1.0), transient=2000):
"""Integrate the Lorenz system with RK4. Returns (n, 3) after the transient."""
def f(s):
x, y, z = s
return np.array([sigma * (y - x), x * (rho - z) - y, x * y - beta * z])
traj = np.empty((n + transient, 3))
s = np.array(x0, float)
for i in range(n + transient):
traj[i] = s
k1 = f(s); k2 = f(s + 0.5 * dt * k1)
k3 = f(s + 0.5 * dt * k2); k4 = f(s + dt * k3)
s = s + (dt / 6.0) * (k1 + 2 * k2 + 2 * k3 + k4)
return traj[transient:]
def time_delay_embed(x, tau, m):
"""Delay vectors [x(t), x(t-tau), ..., x(t-(m-1)tau)]. Returns (N, m)."""
N = len(x) - (m - 1) * tau
return np.column_stack([x[i * tau: i * tau + N] for i in range(m)])
traj = lorenz(8000)
x = traj[:, 0] # pretend we can only measure this one coordinate
embedded = time_delay_embed(x, tau=16, m=3)
print(embedded.shape) # (7968, 3): one 3-D point per instant

The middle panel is the real attractor, plotted from all three Lorenz coordinates. The right panel uses only and two delayed copies of it. The two are not identical, but they have the same shape: two lobes, the same loops, the same holes. We rebuilt the geometry of a three-dimensional system from a single one-dimensional measurement.
What Just Happened?
The idea sounds like it should be impossible. We measured one number over time and recovered a three-dimensional object. How can a delayed copy of stand in for the and we never saw?
The reason is that the variables of a coupled system leak into each other. In the Lorenz equations, , so the rate of change of carries information about . A delayed value is a proxy for that rate of change: the difference is a crude derivative, and the derivative depends on the unmeasured coordinates. Stack enough delays and you span the same information the full state would.
Takens made this precise. A delay vector
traces out a shape that is a smooth, invertible deformation (a diffeomorphism) of the true attractor, as long as the dimension is large enough. Distances, neighbours, and the branching structure are preserved. That is exactly what we need for forecasting: points that sit near each other on the reconstructed attractor are in similar states, so their near futures are similar too.

Think of it like recognising a song from a few notes. No single note identifies the tune, but three consecutive notes pin down where you are in the melody. Each delayed sample is a note; the delay vector is the short phrase that locates you on the attractor.
Going Deeper
Delay embedding has two free parameters, the delay and the dimension , and the data can choose both.
Choosing the delay and the dimension
Pick too small and the coordinates and are nearly identical, so the attractor collapses onto the diagonal. Pick it too large and, for a chaotic system, the coordinates become effectively unrelated and the shape folds into noise. The standard rule takes the first minimum of the average mutual information between and : the smallest delay at which the delayed copy adds new information rather than a near-duplicate.
For , the false nearest neighbours test asks a simple question. Two points that look like close neighbours in dimensions might only be close because the embedding is too cramped, projecting distant parts of the attractor on top of each other. Add one more dimension: if the neighbours fly apart, they were false. Raise until the fraction of false neighbours drops to zero.
def mutual_information(x, max_lag=60, bins=32):
ami = np.empty(max_lag)
for lag in range(1, max_lag + 1):
c, _, _ = np.histogram2d(x[:-lag], x[lag:], bins=bins)
p = c / c.sum()
pa, pb = p.sum(1), p.sum(0)
nz = p > 0
ami[lag - 1] = np.sum(p[nz] * np.log(p[nz] / (pa[:, None] * pb[None, :])[nz]))
return ami
def first_minimum(curve):
"""First local minimum of a 1-D curve (the delay we want)."""
for i in range(1, len(curve) - 1):
if curve[i] < curve[i - 1] and curve[i] < curve[i + 1]:
return i + 1
return int(np.argmin(curve)) + 1
tau = first_minimum(mutual_information(x)) # -> 16 samples

The data speaks clearly. Mutual information bottoms out at samples, and false nearest neighbours collapse from 99% at to 5% at and 0% at . The method recovers the true dimension of the Lorenz system, three, without ever being told the equations.
Forecasting with simplex projection
Once the attractor is reconstructed, forecasting needs no fitted equation. To predict where the system goes next from some current state, find the handful of past states that sat closest to it on the attractor, see where each of them went, and take a distance-weighted average of those outcomes. This is simplex projection, and it is nearest-neighbour forecasting on the reconstructed manifold.
from scipy.spatial import cKDTree
def simplex_forecast(x, tau, m, Tp, lib_frac=0.6):
emb = time_delay_embed(x, tau, m)
tip = (m - 1) * tau
split = int(len(emb) * lib_frac)
lib = np.arange(split); lib = lib[tip + lib + Tp < len(x)]
pred = np.arange(split, len(emb)); pred = pred[tip + pred + Tp < len(x)]
tree = cKDTree(emb[lib])
dist, nbr = tree.query(emb[pred], k=m + 1) # m+1 nearest neighbours
w = np.exp(-dist / np.maximum(dist[:, [0]], 1e-12))
w /= w.sum(1, keepdims=True)
predicted = np.sum(w * x[tip + lib[nbr] + Tp], axis=1) # weighted future
actual = x[tip + pred + Tp]
return predicted, actual
The payoff is the difference between a nonlinear and a linear view of the same data. We compare simplex projection against a linear autoregression fitted on the identical delay coordinates, forecasting further and further ahead.

One step ahead, both methods score a near-perfect correlation of 1.0: over a tiny interval even chaos looks linear. As the horizon grows they separate sharply. At a third of a time unit the simplex forecast still scores 0.99 while the linear model has fallen to 0.39. Push further and the linear model's skill drops through zero and turns negative, worse than guessing the mean, while simplex projection holds above 0.8. The nonlinear method captures the deterministic rule that the linear model cannot see.
The predictability horizon
Simplex projection does not hold forever, and that is not a flaw in the method. It is chaos. Two states that start imperceptibly close drift apart at an exponential rate, the defining property of a chaotic system, and the rate is the largest Lyapunov exponent . Follow pairs of nearby points on the reconstructed attractor, watch how their separation grows, and the slope of the log-separation gives directly (the Rosenstein method).

The fitted slope is per time unit, close to the textbook Lorenz value of 0.906. Its reciprocal, time unit, is the predictability horizon: the timescale over which a small error grows by a factor of . That is why the simplex skill curve decays where it does. No model, however clever, forecasts a chaotic system far past its Lyapunov horizon, because the information you started with has been amplified beyond recognition.
When this works and when it does not
The method shines on the Lorenz system because that system is exactly what the theory assumes: low-dimensional, deterministic, densely sampled, almost noise-free. Real data rarely obliges on all four counts.

The sunspot record is a favourite test case: a strong roughly 11-year cycle with real nonlinearity in its amplitude. Reconstructed with a 4-year delay, it shows a clear cyclic core, evidence of deterministic structure, but the loop is fuzzy. The series is short (about 300 yearly points), observational noise is large, and the underlying dynamics are higher-dimensional than Lorenz. Delay embedding still adds a genuine nonlinear lens the statistical models lack, but the clean attractor and the long predictability horizon of the textbook example do not survive contact with messy data. Reach for these methods when you suspect low-dimensional determinism and have a long, clean series; keep a statistical model like ARIMA or a changepoint detector when the series is short, dominated by noise, or stochastic rather than deterministic.
Where This Comes From
The chain of ideas runs from a topology theorem to a working forecasting toolkit.

Floris Takens (1981), "Detecting Strange Attractors in Turbulence", proved the embedding theorem. His result guarantees that for a generic observation function and an embedding dimension (where is the attractor's dimension), the delay map is an embedding: the reconstructed and true attractors are diffeomorphic. The two-lobed shape we recovered is that theorem made visible.
George Sugihara and Robert May (1990), "Nonlinear forecasting as a way of distinguishing chaos from measurement error", turned the theorem into a test. Their insight is that the shape of the skill-versus-horizon curve is diagnostic:
"For chaotic time series, the accuracy of nonlinear forecasts falls off with increasing prediction interval; for uncorrelated noise, forecasting accuracy is independent of the prediction interval."
A skill curve that decays with horizon, exactly the simplex curve we plotted, is a fingerprint of deterministic chaos rather than random noise. Kennel, Brown and Abarbanel (1992) contributed the false-nearest-neighbours criterion for , and Rosenstein, Collins and De Luca (1993) gave the practical algorithm for estimating from a single series that we used. Two decades later, Sugihara et al. (2012), "Detecting Causality in Complex Ecosystems", extended the same reconstruction idea into convergent cross mapping, a way to infer which variable drives which from observational time series alone. The humble delay vector turns out to be a tool for forecasting, for telling chaos from noise, and for causality.
Interactive Tools
- Markov Chain Simulator: Watch a state evolve under fixed transition rules; a dynamical system is the deterministic, continuous cousin of a Markov chain.
- Regression Playground: Fit the linear models that simplex projection outperforms once the dynamics turn nonlinear.
- Gaussian Process Playground: Another model-free forecaster: a GP predicts from similarity in input space the way simplex predicts from proximity on the attractor.
Related Posts
For time-varying financial volatility, the GARCH Python tutorial compares fitted conditional variance and forecasts.
For recurrent sequence models, LSTM from scratch measures how forget bias affects retention over 100 steps.
Fourier Transform for Time Series Forecasting: The linear, frequency-domain lens on a signal, complementary to the state-space view here.
Changepoint Detection: Finding Regime Shifts in Financial Data: A statistical time-series tool for when structure is piecewise rather than chaotic.
Cointegration Test for Pairs Trading in Python: Engle-Granger and Johansen: Another way two series can be coupled, through a shared stochastic trend.
Hidden Markov Models: When Clusters Have Memory: A probabilistic state-space model, the stochastic counterpart to a deterministic attractor.
Gaussian Process Regression from Scratch: Nonparametric forecasting that, like simplex projection, leans on similarity rather than a fitted equation.







