Recently I have been working on applying machine learning for volatility forecasting and trading. I presented some of my findings at QuantMinds Conference 2018 which I wanted to share in this post.
The most challenging part in volatility modeling and trading is the reliance on a quantitative model for the inference and for the forecast of the volatility. Indeed, because the realized volatility is not observable directly, the volatility needs to be inferred from price and tick data.
Academics and practitioners have developed many models for volatility measurement and forecast – I estimate that the total number of available models to be about 200-300 if we count all modifications of intraday estimators, GARCH-type and continuous-time models.
In practice, the estimate and forecast of the volatility serves provide vital inputs to many applications ranging from signal construction to algorithmic strategies and quantitative methods for portfolio allocation.
For both live and back-test algorithms, the choice of a specific model is then becoming crucial. As Andrew Lo demonstrates in “What is an Index”, by optimizing over parameters of a volatility model applied to the volatility-targeting strategy on the S&P 500 index, we can achieve a spectacular performance more than 40 times over the index!
By applying machine learning to the volatility modeling, we can reduce the back-test bias and, as a result, improve the performance of live strategies. In general, machine learning is a framework when algorithms continuously learn from their performance and new data. Machine learning methods applied to the time series data are divided onto the three broad categories as follows.
- Supervised learning: here the algorithm analyses the historical data for both inputs and outputs to find the best combination of parameters to predict outputs from input data. The supervised learning represents a fitting problem in the classic statistics with the typical example being the regression analysis.
- Unsupervised learning: here the algorithm is provided with the data without specifying what dependent and independent variables are. Here we differentiate between the two approaches. On the one hand, the clustering and factor analysis is about identifying the key independent drivers and patterns of the data with the typical example being the principal component analysis (PCA). On the other hand, the deep learning is about analyzing the data and signals through different layers and assigning weight to the signals.
- Reinforcement learning: here the algorithm is programmed to yield the maximum reward over a set of actions. As the typical example the reinforcement learning is formulated using the Markov decision process.
First, I implemented about 40 different volatility models from 4 separate model classes including intraday estimators, GARCH-type and Bayesian models, and Hidden Markov Chain (HMC) models.
Then, I applied the supervised learning for each of the volatility models with the goal is to analyze the out-of-sample fit of the model prediction to the time series data. I propose a few regression-based tests which are applied to gauge the performance of all volatility models.
The final step is the reinforcement learning that includes aggregation and analysis of the test results from the supervised learning. The goal is to dynamically select the best model out of 40 that provides the best predicative power out-of-sample. I use the analogy to the web-search to weight the importance of the test results when producing volatility forecasts for specific trading algorithms.
One of key discoveries is that Hidden Markov Chain model is one of the best model for volatility forecast across many asset classes. I also observe the cyclical pattern in the rankings of the best models. On one hand, Hidden Chain models perform the best in periods with strong trends. On the other hand, simple intraday estimators perform the best in periods with range-bound markets. The machine learning enables to dynamically choose the best model for the present cycle.
Finally, I make an interesting connection to the minimum description length (MDL)principle. In short, we can interpret the problem of searching for the best volatility model as a problem of describing the time series data in the best way out of several hypothesis. The MDL principle uses the insight that the model (seen as a computer program), that captures most patterns in the data, leads to the best compression of the data. The length of the shortest program (model) to reproduce the data is known as the Kolmogorov complexity of the data. On of the key insights of is that the Kolmogorov complexity is interpreted as the change rule that states that the shortest program to describe both the data and the model equals to: 1) a program to produce the model, 2) a program to produce the data given model, and 3) a logarithmic term. If we apply many data points, the logarithmic becomes insignificant to the first leading order terms. As a result, we can reduce the computational complexity of our analytical modeling of time series data using the best volatility model.
Andrew Lo (2016) What Is an Index? Journal of Portfolio Management, 42 (2), 21-36