Level 3 AI in trading · Part 3/8

Stationarity and Memory

Statistical models assume that the properties of the data stay stable over time: the mean, the variance, the relationships. That property is called stationarity. Price series do not have it, because their mean drifts permanently.

The usual compromise and what it costs

The standard fix is to model returns instead of prices. That makes the series stationary, which is why almost all of financial econometrics works with returns.

The cost is rarely stated. Taking differences erases nearly all of the memory in the series. A return series no longer knows whether the price sits near its two-year high or its two-year low. Yet that information – the price level compared with 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 use whole numbers. Instead of “each value minus the previous one”, which is order 1, you can use a fractional order such as 0.4. Technically, the series is combined with a sequence of declining weights that does not set older values to zero but only reduces them.

Price series with a trend and the same series after fractional differentiation
(1) The price series carries memory — today depends on yesterday — but is not stationary: its mean drifts. Models need stationarity. The usual fix, taking returns, is an integer differentiation and erases almost all memory. (2) Fractional differentiation with an exponent between 0 and 1 removes only as much memory as stationarity requires — the rest survives as signal.

The method is called fractional differentiation, and the procedure is straightforward:

  1. Raise the order step by step, starting at zero.
  2. After each step, run a stationarity test.
  3. Take the smallest order that passes.

An order well below 1 is often enough. Many studies find values between 0.2 and 0.5. 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 the price level compared with its own past meant nothing, then support, resistance and trend would all be superstition. If raw prices could be used directly, no statistics would be needed.

Fractional differentiation makes the question measurable: how much memory do you have to give up in order to model at all? The answer depends on the data – and as a rule it is considerably less than the automatic switch to returns assumes.

Practical notes

  • The weight sequence has to be cut off somewhere. Common practice is to stop once the weights fall below a small threshold, which means the first observations are dropped.
  • The order is determined on the training period, not on all of the data. Otherwise it becomes 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?