├── var-granger-causality.py └── README.md /var-granger-causality.py: -------------------------------------------------------------------------------- 1 | import pandas as pd 2 | import numpy as np 3 | import quandl 4 | import matplotlib.pyplot as plt 5 | import warnings 6 | 7 | warnings.filterwarnings('ignore') 8 | 9 | quandl.ApiConfig.api_key = 'tJKSQn1pHLbyo1mu1wYn' 10 | 11 | gold = quandl.get('LBMA/GOLD') 12 | silver = quandl.get('LBMA/SILVER') 13 | oil = quandl.get('CHRIS/ICE_G6') 14 | dollar = quandl.get('CHRIS/ICE_DX1') 15 | dow_jones = quandl.get('BCB/UDJIAD1') 16 | treasury = quandl.get('FRED/DGS10') 17 | 18 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Forecasting-VAR-Granger-Causality 2 | 3 | This project focuses on the Data Science, Statistics, as well as some financial theory revolving around how financial markets behalf. 4 | 5 | ![](https://kidquant.com/post/images/financial_markets.png) 6 | 7 | ## Goal 8 | 9 | Our goals involve the following: 10 | 11 | - **Part 1**: Analyze the descriptive statistics and the trends of all of our variables, which involves testing for skewness, asymmetry, and kurtosis. 12 | - **Part 2**: Testing for autocorrelation which involves a process of using an autoregressive model. 13 | - **Part 3**: Testing for stationarity using the Augmented Dickey-Fuller test. 14 | - **Part 4**: Testing for causality with each individual variable using Granger Causality. 15 | - **Part 5**: Creating the model based on the relationship with the variables. 16 | 17 | This analysis will allow us to assess the given relationship between specific financial markets and effectively forecast them. 18 | 19 | ## Data 20 | 21 | We used data from [Quandl](https://www.quandl.com/), which allows us to extract financial and economic data for analysis in Python. We also used some data from the [Federal Reserve Economic Database](https://fred.stlouisfed.org/) or FRED. 22 | 23 | ## Enviroment and Tools 24 | 25 | 1. Jupyter NoteBook 26 | 2. Numpy 27 | 3. Pandas 28 | 4. Matplotlib 29 | 5. Scipy 30 | 6. Statsmodels 31 | 7. Quandl 32 | --------------------------------------------------------------------------------