I am trying to model some data using a random walk, but after the standard increment and log (financial data) transformations for stationarity have found that, over long time frames, there is still not constant variance. What is the best way to now proceed? Or, are there further transformations I could consider to address the non-stationarity the standard transforms didnt address.
2 Answers
After taking log and differencing, the next step is to account for heteroscedasticity. The are many ways to do this, the simplest approach is to estimate the running standard deviation by exponential smoothing(a simple variation of GARCH actually).
library("quantmod")
library("fractal")
getSymbols('MSFT')
msft.ret <- na.omit(diff(log(Cl(MSFT))))
you can see a few volatility clusters
plot(msft.ret)
and reject the stationarity hypothesis, with p≈0:
stationarity(msft.ret)
now calculate the running std deviation for the period of one month
msft.ret.sd <- sqrt(EMA(msft.ret^2, 30))
and standardise the returns by running deviation:
msft.ret.st <- na.omit(msft.ret / msft.ret.sd)
now the stationarity hypothesis can't be rejected:
stationarity(msft.ret.st)
and the graph is much nicer:
plot(msft.ret.st)
-
$\begingroup$ Exponential smoothing is not a variation of garch and its parameter can't even be estimated. $\endgroup$– AksakalCommented Apr 24, 2014 at 1:29
There's a lot of literature on financial time series, e.g. Tsay's book on subject. also Carol Alexander book called "market risk analysis" where she has step by step excel examples with popular methods like stochastic volatility, GARCH and exponential smoothing.
For a beginner ARCH is the good place to start.