Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Delete time series plot_Cointegration Crypto #5

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file removed DEDA_WS21_22_Cointegration_Crypto/DEDA_Tables.pdf
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 8 additions & 0 deletions DEDA_WS21_22_Cointegration_Crypto/README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,10 @@
# DEDA_class_WS21
This repository is for Digital Economy and Data Analytics class of WS 2021/22

The folder data contains all the data sets and the code processing the data sets.
The folder tests contains all the code for processing ADF test, VAR, Johansen test and VECM and the impulse
response.
The folder time series plots contains the plots of the original data, the logged data and the data after
first difference.
The folder impulse response contains the plots of the impulse response result.

86 changes: 0 additions & 86 deletions DEDA_WS21_22_Cointegration_Crypto/Tests/EG test.py

This file was deleted.

83 changes: 0 additions & 83 deletions DEDA_WS21_22_Cointegration_Crypto/Tests/VAR.py

This file was deleted.

27 changes: 6 additions & 21 deletions DEDA_WS21_22_Cointegration_Crypto/Tests/VECM.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
from statsmodels.tsa.api import VAR
import matplotlib.pyplot as plt
from statsmodels.tsa.vector_ar import vecm
from matplotlib.backends.backend_pdf import PdfPages
# read the original data for the VECM
indicators_death_infection = pd.read_csv('../Data/final_merged_data.csv', index_col = 0)
indicators_death_infection.index = pd.to_datetime(indicators_death_infection.index)
Expand All @@ -25,36 +24,22 @@
model6 = indicators_death_infection.loc[:, xy6]

# run the VECM with the rank chosen by Johansen test and show the impulse response
def save_multi_image(filename):
pp = PdfPages(filename)
fig_nums = plt.get_fignums()
figs = [plt.figure(n) for n in fig_nums]
for fig in figs:
fig.savefig(pp, format='pdf')
pp.close()

save_multi_image('../impulse_response_plot')

def vecm_impulse(model, rank):
mod = vecm.VECM(model, k_ar_diff = 4, coint_rank = rank, deterministic = 'ci')
res = mod.fit()
ir = res.irf(periods = 30)
ir.plot(plot_stderr=False, figsize=(40, 40))
save_multi_image('../impulse_response_plot')

vecm_impulse(model1, 3)
plt.savefig('BTC_price_impulse')
vecm_impulse(model2, 3)
plt.savefig('DASH_price_impulse')
vecm_impulse(model3, 4)
plt.savefig('ETH_price_impulse')
vecm_impulse(model4, 4)
plt.savefig('BTC_retrun_impulse')
vecm_impulse(model5, 4)
plt.savefig('DASH_retrun_impulse')
vecm_impulse(model6, 3)

def save_multi_image(filename):
pp = PdfPages(filename)
fig_nums = plt.get_fignums()
figs = [plt.figure(n) for n in fig_nums]
for fig in figs:
fig.savefig(pp, format='pdf')
pp.close()

save_multi_image('../impulse_response_plot')
plt.savefig('ETH_retrun_impulse')
Binary file not shown.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.