Qm

Best window length for a moving-average forecast

You forecast a slowly drifting quantity (say, a rolling mean that creeps up by δ\delta per step) using the average of the last WW observations. Each observation carries noise of variance σ2=32\sigma^2 = 32, and the drift is δ=1\delta = 1 per step. A window of length WW has forecast error

MSE(W)σ2W+(δW2)2,\text{MSE}(W) \approx \frac{\sigma^2}{W} + \left(\frac{\delta W}{2}\right)^2,

where the first term is sampling noise and the second is the bias from averaging stale, out-of-date points.

What window length WW minimizes the forecast MSE?

Your answer

Solving needs a free account

Answers, streaks and solutions unlock when you are signed in. Reading the question and the hint stays free.

Discussion

Sign in to join the discussion · reading is open to everyone

💡 Discussion rules

  1. No full solutions here. Hints and approaches only.
  2. Complexity, edge cases and intuition are the point.
  3. Interview experiences are welcome. Respect your NDAs.

Loading discussion…

Learn the concepts

The theory behind this question.

Related questions

Optimal window when the data is quietOptimal window when the data is noisyHow the best window scales with noiseBack out the drift from the chosen windowBlend an unbiased noisy forecast with a biased sharp one
All questions →