Data in a table, no formula in sight: difference tables, the operators Δ, ∇, δ, E, μ and D, where each one comes from, how they are related, and why E = e^{hD} is the key to every interpolation, differentiation and integration formula that follows.
A machine logs one reading per second. We have only the numbers.
| (s) | 0 | 1 | 2 | 3 | 4 | 5 | 6 |
|---|---|---|---|---|---|---|---|
| 1 | 0 | 5 | 22 | 57 | 116 | 205 |
Module 3: linear systems. Interpolation will need them (splines, Lecture 18).
A new kind of data: values at equally spaced points. A small algebra of operators makes them easy to handle.
| 0 | 1 | −1 | 6 | 6 | 0 |
| 1 | 0 | 5 | 12 | 6 | 0 |
| 2 | 5 | 17 | 18 | 6 | 0 |
| 3 | 22 | 35 | 24 | 6 | — |
| 4 | 57 | 59 | 30 | — | — |
| 5 | 116 | 89 | — | — | — |
| 6 | 205 | — | — | — | — |
Shown in "row" layout: row holds . Third differences are all 6 and fourth differences are 0: the data come from a cubic.
| in terms of | in terms of | in terms of | |
|---|---|---|---|
Useful identities that follow: ; ; ; .
Census counts, temperatures or stock prices are not a polynomial; guessing "the formula" is impossible. The difference table works directly on the numbers, tells us how smooth the data are, and gives interpolation (Lecture 16), derivatives (Lecture 19) and integrals (Lecture 20).
Every formula of Module 4 and 5 is an operator identity expanded as a series:
Click a card to see differences at work.
Where exactly: the first mechanical computer design (1820s). Because the -th differences of a polynomial are constant, every new table value can be produced by additions alone, running the difference table backwards.
Babbage's engine evaluated 7th-degree polynomials to 31 digits; a working model was finally built in 1991 (Science Museum, London).
Where exactly: data science and forecasting. Before fitting a model, a trend is removed by differencing: removes a linear trend; removes a quadratic one. The "I" in ARIMA is the number of differences taken.
| month | 1 | 2 | 3 | 4 | 5 |
|---|---|---|---|---|---|
| sales | 120 | 135 | 152 | 171 | 192 |
| — | 15 | 17 | 19 | 21 | |
| — | — | 2 | 2 | 2 |
Constant second differences: a quadratic trend. The model is fitted to the leftover variation, then the forecast is "un-differenced" by adding back, like the difference engine.
Where exactly: computer vision. An edge is where brightness changes quickly. The simplest edge detector is the difference of neighbouring pixels, ; Sobel and Prewitt filters are smoothed central differences .
| pixel | 1 | 2 | 3 | 4 | 5 | 6 |
|---|---|---|---|---|---|---|
| brightness | 20 | 22 | 21 | 180 | 182 | 181 |
| 2 | −1 | 159 | 2 | −1 | — |
The huge difference 159 between pixels 3 and 4 marks the edge. Second differences (the discrete Laplacian of Lecture 14) mark edges by a sign change.
Where exactly: speech recognition and speaker identification. Besides the MFCC features of each frame, systems add "delta" and "delta-delta" features: differences across neighbouring frames that capture how the sound is changing.
With this is exactly the central difference . Delta-deltas are second differences.
Third differences are constant (6), so the data are a cubic with leading coefficient 1 (); ; an error of +1 in 22 shows up as in the third differences.
Newton's forward and backward interpolation. Expand to find values between the table entries.