Modeling_the_VIX_with_LSTM

Contained within this repo is a collection of approaches for forecasting the CBOE VIX for the purpose of improving future market volatility forecasts.

The CBOE VIX is a real-time index that represents the market’s expectations for the relative strength of near-term price changes or future volatility of the S&P 500 Index (SPX), which is considered the leading indicator of the broad U.S. stock market. Being a forward-looking index, it is constructed using the implied volatilities on S&P 500 index options (SPX options).

Volatility, or how fast prices change, is often seen as a way to gauge market sentiment, and in particular the degree of fear among market participants. Having the ability to guage this sentiment in advance allows insight into the timing of indicators and assists traders in enhancing long-term fundamentals to better execute their market entries.  

Volatility forecasts are used for risk management, alpha (risk) trading, and the reduction of trading friction.


README Overview

This README serves as a blueprint for navigating the entire repo. The following instructions will guide the user through the process of installing necessary libraries and running the applicable Jupyter notebooks, as well as provide a step-by-step explanation of the code’s usage and results.

Included here is an explanation of the data gathering process for all data, relevant to Parts 1, 2, and 3, as well as a summation of the study’s findings for Part 1.

Please note, this repo is a copy of an earlier version. Commits were made on the earlier version starting August 15th, 2022. A new repo was created August 27th in the interest of cohesion.


Technologies

This application leverages Python 3.7.


Installation Guide

Begin by cloning the GitHub repo (the same repo that this README.md file is contained within) into your terminal.

Next, activate the correct environment by inputting the following command into your terminal: conda activate dev.

Within this environment, install the above listed dependencies. To do so, in your terminal while in this same repo, enter pip install -r requirements.txt.


Data Gathering

Please navigate to the Data Prep folder to review the following notebooks:

Macro_Data_2017-22_Prep.ipynb:

SPX_VIX_30min_2017-22_Prep.ipynb:


PART 1: Predicting VIX with LSTM

This section uses a multi-variate, multi-step LSTM model to predict how the VIX will evolve over time using 5.5 years of historical data (Q1 2017 through Q2 2022).

For this project, three, five, and 20 day forecasts were made. Please note 20 days provided insufficient predictive power; results will not be discussed.

vix_lstm_V4.ipynb:

LSTM Results:

voila example.

voila example.

voila example.

voila example.


PART 2: Monte Carlo and Facebook Prophet

Monte Carlo analysis was additionally performed to forecast the VIX for the first two weeks of August 2022.

Further, Facebook Prophet was likewise performed to forecast the VIX for six months starting August 1st, 2022 as well as the first two weeks in August 2022.

Please consult the VIXbyOptyxFinal.pdf presentation in the Presentation folder, pages 22-25 for Monte Carlo and Facebook Prophet results.


PART 3: Scenario Forecasting

This folder consists of scenario forecasts for the VIX. The goal was to manipulate certain features for an LSTM time-series model as a means of simulating various scenarios.

For example, in Scenario A (one scenario of three included), to simulate a period of hyper-inflation alongside a pandemic, the following features were manipulated by scaling them in a step-wise fashion over select periods:

Here are the three scenarios:


Contributors

Kfir Bar, Aarchit Malhotra, Aliza Naqvi, Nicole Roberts, Wilson Rosa