James Marsden Hurst 1924—2005

Chapter 12.4

Appendix IV — How a moving average responds (Hurst)

The exact derivation: aᵣ = (1+2f)/n, half-span lag, zero at period = span, the constant −0.23 error lobe — and why such a mediocre filter works on stock prices.

On this page

Who this entry is for — Every moving average in the book — half-span, full-span, inverse — rests on this derivation. Four facts to take home: half-span lag, an exact zero at period equal to the span, a constant −0.23 error lobe, and the law of nature that saves the whole thing.

Source: J. M. Hurst, The Profit Magic of Stock Transaction Timing, Prentice-Hall, 1970 — Appendix IV, Frequency Response Characteristics of a Centered Moving Average (pp. 207–211, Figs. A IV-1, A IV-2).


Prerequisites

The cyclic moving averages (Ch. 3/6) and, for context, the numerical filters (Ch. 11).


The derivation

Feed the average a pure cosine, eᵢ = A·cos(ωt), and compute the centred output. Collecting terms, the output/input ratio — the amplitude ratio — comes out as:

aᵣ = (1 + 2f) / n — where f = cos(ωtₙ) + cos(2ωtₙ) + … + cos(((n−1)/2)·ωtₙ)

with n the number of elements and tₙ the data spacing. Every property follows from this exact formula — and the figures below draw it as is.

HURST 1970 · APPENDIX IV How a moving average really works Appendix IV’s exact response: aᵣ = (1 + 2f)/n — here with span 11 CYCLEPEDIA DIAGRAM — EMICICLO AMPLITUDE RATIO · FREQUENCY (IN CUTOFF UNITS) 1.0 0.5 0.0 period = span span/2 span/3 centred MA (low-pass) inverse (high-pass) = 1 − MA FIRST LOBE −0.23 · constant LAG ½ span, always WHY IT WORKS aᵢ = k/ωᵢ A mediocre filter saved by a law of nature: short price cycles are born small.
Appendix IV's formula drawn exactly (span 11): the MA in gold, the inverse in teal — with the −0.23 lobe and the zeros at span, span/2, span/3.
Tap the lobe, the cutoff and the inverse
Original Fig. A IV-1 — Frequency Response of Moving Average Operation
The original 1970 plate: Fig. A IV-1, "How A Moving Average Works" — pass-band lobe, 23% out-of-phase error lobe, in-phase lobes beyond.

The four properties

  1. Phase: output is exactly in phase with input across the whole spectrum — except for 180° phase reversals in the odd error lobes. The lag is constant: half the span.
  2. Cutoff: the response first zeroes when the cycle's period equals the span (n·tₙ). Choosing the span = choosing which component vanishes entirely — the rule behind full-span and half-span.
  3. The −0.23 lobe: the first error lobe past cutoff is −0.23, constant, independent of design parameters; subsequent lobes alternate in sign as they shrink. High frequencies "creep through" attenuated, in or out of phase: the residue to recognize when hunting component turns.
  4. One knob only: the characteristics are entirely fixed by the span — there is nothing else to design.

Why such a mediocre filter works — The error lobes are Gibbs oscillations, the fault of the weighting function's square corners. As a generic "smoother" the MA would be poor — "except for the fact that the spectrum of stock prices consistently displays the aᵢ = k/ωᵢ relationship derived in Appendix One. It is only the sharp attenuation of high frequencies characteristic of stock price motion that permits the utilization of a filter with such relatively poor characteristics."

The inverse: the mirror

The inverse has response 1 − aᵣ: it behaves as a high-pass, again with error lobes up to 23% — but with one precious difference: no phase inversion, ever; the output is perfectly in phase across the entire spectrum, with the same half-span lag. The response first reaches 1 at period = span and in the lobes exceeds it by nearly ¼: when using the inverse to estimate a component's amplitude, correct for the excess.


Summary card

Property Value
Exact response aᵣ = (1 + 2f)/n, f = Σ cos(k·ωtₙ)
Lag ½ span, constant
First zero period = span (n·tₙ)
First error lobe −0.23, constant, out of phase
Folding first window at period = tₙ
Inverse 1 − MA: high-pass, always in phase, ≈ +0.23 overshoot
The lifesaver the aᵢ = k/ωᵢ law of stock prices (App. I)