Level 3 AI in trading · Part 3/8
Stationarity and Memory
Statistical models assume that the properties of the data stay stable over time – mean, variance, relationships. That property is called stationarity. Price series do not have it: their mean drifts, permanently.
The usual compromise and its cost
The standard fix is to model returns instead of prices. That makes the series stationary and is why practically all of financial econometrics works with returns.
The cost is rarely stated: differencing erases nearly all of the series’ memory. A return series no longer knows whether price sits near its two-year high or its two-year low. Yet that information – price level relative to its own past – is the core of almost every charting feature.
So you face a dilemma: the raw series has memory but no stationarity. The return series has stationarity but no memory.
The middle path
Differencing does not have to be integer. Instead of “each value minus the previous one” (order 1), a fractional order can be used, say 0.4. Technically the series is convolved with a decaying weight sequence that does not zero out older values but merely attenuates them.
The method is called fractional differentiation. The procedure is straightforward:
- Increase the order step by step, starting from zero.
- After each step, run a stationarity test.
- Take the smallest order that passes.
Often an order well below 1 suffices – many studies find values in the 0.2 to 0.5 range. The remaining correlation with the original series is then still high: the series is stationary and still knows where it came from.
Why this matters for this course
It gives a formal version of what Levels 1 and 2 claim informally. If price level relative to its own past were meaningless, support, resistance and trend would all be superstition. If raw prices were directly usable, no statistics would be needed.
Fractional differentiation makes the question measurable: how much memory must be given up to model at all? The answer is data-dependent – and as a rule, considerably less than the reflexive move to returns assumes.
Practical notes
- The weight sequence has to be truncated. Common practice: stop once weights fall below a small threshold; the first observations are dropped as a result.
- The order is determined on the training period, not on all the data. Otherwise it is the next hidden look into the future.
- Every series needs its own order. A value that fits an equity index rarely fits an exchange rate.
Next
The inputs are usable now. The harder question follows: what exactly should the model predict?