Distribution
assumptions
GA RCH MODELS IN P YTH ON
Chelsea Yang
Data Science Instructor
Why make assumptions
Volatility is not directly observable
GARCH model use residuals as volatility shocks
rt = μt + ϵt
Volatility is related to the residuals:
ϵt = σt ∗ ζ(W hiteNoise)
GARCH MODELS IN PYTHON
Standardized residuals
Residual = predicted return - mean return
residuals = ϵt = rt − μt
Standardized residual = residual / return volatility
ϵt
std Resid =
σt
GARCH MODELS IN PYTHON
Residuals in GARCH
gm_std_resid = gm_result.resid / gm_result.conditional_volatility
plt.hist(gm_std_resid, facecolor = 'orange',label = 'standardized residuals')
GARCH MODELS IN PYTHON
Fat tails
Higher probability to observe large (positive or negative) returns than under a normal distribution
GARCH MODELS IN PYTHON
Skewness
Measure of asymmetry of a probability distribution
GARCH MODELS IN PYTHON
Student's t-distribution
ν parameter of a Student's t-distribution indicates its shape
GARCH MODELS IN PYTHON
GARCH with t-distribution
arch_model(my_data, p = 1, q = 1,
mean = 'constant', vol = 'GARCH',
dist = 't')
GARCH MODELS IN PYTHON
GARCH with skewed t-distribution
arch_model(my_data, p = 1, q = 1,
mean = 'constant', vol = 'GARCH',
dist = 'skewt')
GARCH MODELS IN PYTHON
Let's practice!
GA RCH MODELS IN P YTH ON
Mean model
speci cations
GA RCH MODELS IN P YTH ON
Chelsea Yang
Data Science Instructor
Constant mean by default
constant mean: generally works well with most nancial return data
arch_model(my_data, p = 1, q = 1,
mean = 'constant', vol = 'GARCH')
GARCH MODELS IN PYTHON
Zero mean assumption
zero mean: use when the mean has been modeled separately
arch_model(my_data, p = 1, q = 1,
mean = 'zero', vol = 'GARCH')
GARCH MODELS IN PYTHON
Autoregressive mean
AR mean: model the mean as an autoregressive (AR) process
arch_model(my_data, p = 1, q = 1,
mean = 'AR', lags = 1, vol = 'GARCH')
GARCH MODELS IN PYTHON
Let's practice!
GA RCH MODELS IN P YTH ON
Volatility models for
asymmetric shocks
GA RCH MODELS IN P YTH ON
Chelsea Yang
Data Science Instructor
Asymmetric shocks in nancial data
News impact curve:
GARCH MODELS IN PYTHON
Leverage effect
Debt-equity Ratio = Debt / Equity
Stock price goes down, debt-equity ratio goes up
Riskier!
GARCH MODELS IN PYTHON
GJR-GARCH
GARCH MODELS IN PYTHON
GJR-GARCH in Python
arch_model(my_data, p = 1, q = 1, o = 1,
mean = 'constant', vol = 'GARCH')
GARCH MODELS IN PYTHON
EGARCH
A popular option to model asymmetric shocks
Exponential GARCH
Add a conditional component to model the asymmetry in shocks similar to the GJR-GARCH
No non-negative constraints on alpha, beta so it runs faster
GARCH MODELS IN PYTHON
EGARCH in Python
arch_model(my_data, p = 1, q = 1, o = 1,
mean = 'constant', vol = 'EGARCH')
GARCH MODELS IN PYTHON
Which model to use
GJR-GARCH or EGARCH?
Which model is better depends on the data
GARCH MODELS IN PYTHON
Let's practice!
GA RCH MODELS IN P YTH ON
GARCH rolling
window forecast
GA RCH MODELS IN P YTH ON
Chelsea Yang
Data Science Instructor
Rolling window for out-of-sample forecast
An exciting part of nancial modeling: predict the unknown
Rolling window forecast: repeatedly perform model tting and forecast as time rolls forward
GARCH MODELS IN PYTHON
Expanding window forecast
Continuously add new data points to the sample
GARCH MODELS IN PYTHON
Motivations of rolling window forecast
Avoid lookback bias
Less subject to over tting
Adapt forecast to new observations
GARCH MODELS IN PYTHON
Implement expanding window forecast
Expanding window forecast:
for i in range(120):
gm_result = basic_gm.fit(first_obs = start_loc,
last_obs = i + end_loc, disp = 'off')
temp_result = gm_result.forecast(horizon = 1).variance
GARCH MODELS IN PYTHON
Fixed rolling window forecast
New data points are added while old ones are dropped from the sample
GARCH MODELS IN PYTHON
Implement xed rolling window forecast
Fixed rolling window forecast:
for i in range(120):
# Specify rolling window range for model fitting
gm_result = basic_gm.fit(first_obs = i + start_loc,
last_obs = i + end_loc, disp = 'off')
temp_result = gm_result.forecast(horizon = 1).variance
GARCH MODELS IN PYTHON
How to determine window size
Usually determined on a case-by-case basis
Too wide window size: include obsolete data that may lead to high bias
Too narrow window size: exclude relevant data that may lead to higher variance
The optimal window size: trade-off to balance bias and variance
GARCH MODELS IN PYTHON
Let's practice!
GA RCH MODELS IN P YTH ON