Home » Research Blog » A method for de-trending asset prices

A method for de-trending asset prices

Financial market prices and return indices are non-stationary time series, even in logarithmic form. This means not only that they are drifting, but also that their distribution changes overtime. The main purpose of de-trending is to mitigate the effects of non-stationarity on estimated price or return distribution. De-trending can also support the design of trading strategies. The simplest basis for estimating trends is to subtract moving averages. The key challenge is to pick the appropriate average window, which must be long enough to detect a trend and short enough to make the de-trended data stationary. A neat method is to pick the window based on the kurtosis criterion, i.e. choosing the window length that brings the ‘fatness of tails’ of de-trended data to what it should look like under a normal distribution.

Arias-Calluari1, Karina, Morteza. N. Najafi, Michael S. Harr, and Fernando Alonso-Marroquin (2019), “Stationarity of the detrended time series of S&P500”

The below are excerpts from the draft paper. Headings, text in italics, and brackets have been added. Some orthographic changes have been applied as the underlying paper is unedited.

Statistical properties of asset price series

Financial markets…generate non-stationary and non-linear time series. The main feature of these time series is the variance in their basic statistical properties. In other words, these time series are non-identically distributed throughout their full length and characterized by…fat-tailed distributions.”

“Simple returns and log-returns…are non-stationary time series. This means that their statistical distributions change over time.”

“We have analysed the Standard & Poor’s 500 stock market data during the 22-year period from January 1996 to May 2018 with an interval span of 1 minute. The [figure below] shows the time series of this data identifying the closing milestones.”

“Price return time series and log return time series present a similar behaviour on their drift and growth rates exhibiting three well-defined zones which are limited by abrupt changes of slope.

“Price returns determine losses and gains. Their probability density function allows evaluating the mean return for different time intervals…High and low closing milestones of S&P500 produce fat tail distributions…The values of [extreme prices] and drift clearly depend on time. Consequently, price returns are classified as a non-stationary. Although log-price returns [remove] most non-stationary effects, their drift is non-constant.”

A de-trending method

“A de-trended process is made to neutralize the non-stationary effects…by decomposing the financial time series into a deterministic trend and random fluctuations….We present an alternative method on de-trending time series based on classical moving average (MA) models, where Kurtosis is used to determine the [lookback] windows size.”

“The process used to construct the trend of the data is the moving average (MA). This process is constructed based on an average value within a time window size that is shifted forward until the end of the data set. The appropriate window must…be long enough to ensure a deterministic trend and short enough that the de-trended part is stationary.”

“[The window length] is the key parameter to obtain stationary de-trended data. Consequently, [emphasis is on finding] the optimal window length. Then, the moving average is applied [using that length]…[The figure below] displays the results [for the S&P500 price series]. The optimal window size is around 13 months.”

“We adopt the method of Xu et al. (2016) to obtain the optimal lookback window…The data set of the distribution in each window should be as close as possible to a Gaussian distribution but may vary in variance. Xu et al. applied kurtosis as [criterion] to determine the lookback window. The kurtosis is the fourth standardized moment.”

N.B.: Kurtosis measures whether data have a distribution with fat tails or a distribution with thin tails relative to the normal distribution. For a normal population, the coefficient of kurtosis is 3. Positive kurtosis (value above 3) means fat tails or many outliers. Negative kurtosis means thin tails with few or no outliers.

“The optimal window size must satisfy the condition of kurtosis being equal to three [which is the value of the] univariate normal distribution. The [overall] time series…is split into non-overlapping time windows as a quick test to find the most appropriate value of the lookback window. For a given window length the kurtosis is measured in each time window. After having the values of kurtosis for all the windows, the average of the kurtosis…is calculated.”

“The trend is constructed for the index price of S&P 500. The figure below (a) displays the trend for a lookback window of 12 months and (b) the de-trended price as a result of subtracting the value of the trend.”

N.B.: The above-used trends are based on centred moving averages. For trading strategies the method must typically be based on trailing moving averages.

Evidence that de-trending makers S&P500 prices stationary

De-trended fluctuation analysis (DFA) is used as a tool to test stationarity…The time series is divided into equal non-overlapping segments, which represent the time scale of the de-trended time series. Then, the ‘self-similarity parameter’ or Hurst exponent is obtained by calculating the power-law relation between the ‘statistical functions’ for each segment…The stationarity is tested by applying two methods. The first is related to autocorrelation function and the second to the power spectral density.”

“This paper address the question on whether the time series of the S&P500 index can be decomposed into a deterministic trend and a stochastic time series…We perform various statistics on the detrended price to show that the de-trended part is stationary.”


Related articles