Skip to content

Instantly share code, notes, and snippets.

@h3ik0th
Created September 16, 2021 15:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save h3ik0th/cf682d60ebd87054d3c0ea6f63f8971c to your computer and use it in GitHub Desktop.
Save h3ik0th/cf682d60ebd87054d3c0ea6f63f8971c to your computer and use it in GitHub Desktop.
GoT_grangercausality_01.py
import statsmodels.api as sm
from statsmodels.stats.stattools import durbin_watson
from statsmodels.tsa.stattools import grangercausalitytests, adfuller, kpss, coint
from pmdarima.arima import ndiffs # for order of differencing
from statsmodels.tsa.api import VAR
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import warnings
warnings.filterwarnings("ignore")
ALPHA = 0.05
# import the Google Trend csv file
# Tyrion and Cersei's weekly Google fame since 2011
df = pd.read_csv("got_Cersei_Tyrion.csv")
df
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment