Execute the following steps to estimate the ARCH(1) model.
- Import the libraries:
import pandas as pdimport yfinance as yffrom arch import arch_model
- Specify the risky asset and the time horizon:
RISKY_ASSET = 'GOOG'START_DATE = '2015-01-01'END_DATE = '2018-12-31'
- Download data from Yahoo Finance:
df = yf.download(RISKY_ASSET, start=START_DATE, end=END_DATE, adjusted=True)
- Calculate daily returns:
returns = 100 * df['Adj Close'].pct_change().dropna()returns.name = 'asset_returns'returns.plot(title=f'{RISKY_ASSET} returns: {START_DATE} - {END_DATE}')
Running the code generates the following plot:
![](/api/v2/epubs/9781789618518/files/assets/a2435339-4537-472e-b8fb-fe7dc80101b7.png)
In the plot, we can ...