January 2020
Beginner to intermediate
432 pages
11h 24m
English
Execute the following steps to estimate the CCC-GARCH model in Python.
import pandas as pdimport yfinance as yffrom arch import arch_model
RISKY_ASSETS = ['GOOG', 'MSFT', 'AAPL']N = len(RISKY_ASSETS)START_DATE = '2015-01-01'END_DATE = '2018-12-31'
df = yf.download(RISKY_ASSETS, start=START_DATE, end=END_DATE, adjusted=True)
returns = 100 * df['Adj Close'].pct_change().dropna()returns.plot(subplots=True, title=f'Stock returns: {START_DATE} - {END_DATE}');
This results in the plot shown below:
coeffs = []cond_vol = []std_resids = []models = []
Read now
Unlock full access