# Modelling volatility - ARCH and GARCH volatility - ARCH and GARCH models BetaStehlkov Timeseriesanalysis Modellingvolatility-ARCHandGARCHmodels –p.1/33

Post on 10-Apr-2018

217 views

Embed Size (px)

TRANSCRIPT

Modelling volatility - ARCH and GARCHmodels

Beta Stehlkov

Time series analysis

Modelling volatility - ARCH and GARCH models p.1/33

Stock prices

Weekly stock prices (library quantmod)

Continuous returns:

At the beginning of the term we analyzed theirautocorrelations in a HW

Modelling volatility - ARCH and GARCH models p.2/33

Returns

Time evolution:

Modelling volatility - ARCH and GARCH models p.3/33

Returns

Based on ACF, they look like a white noise:

Modelling volatility - ARCH and GARCH models p.4/33

Returns

We model them as a white noise:

residuals are just - up to a contant - the returns

If the absolute value of a residual is small, usuallyfollows a residual with a small absolute value

Similarly, after a residual with a large absolute value,there is often another residual with a large absolutevalue - it can be positive or negative, so it cannot beseen on the ACF

Second powers will likely be correlated (but this doesnot hold for a white noise)

Modelling volatility - ARCH and GARCH models p.5/33

Returns

ACF of squared residuals:

significant autocorrelation

QUESTION:Which model can capture this property?

Modelling volatility - ARCH and GARCH models p.6/33

Returns

Possible explanation: nonconstant variance

Modelling volatility - ARCH and GARCH models p.7/33

ARCH and GARCH models

u is not a white noise, butut =

2t t,

where is a white noise with unit variance, i.e.,

ut N(0, 2

t )

ARCH model (autoregressive conditionalheteroskedasticity) - equation for variance 2t :

2t = + 1u2

t1 + . . . qu2

tq

Constraints on parameters: variance has to be positive:

> 0, 1, . . . , q1 0, q > 0

stationarity:1 + . . . + q < 1

Modelling volatility - ARCH and GARCH models p.8/33

ARCH and GARCH models

Disadvantages of ARCH models: a small number of terms u2ti is often not sufficient

- squares of residuals are still often correlated for a larger number of terms, these are often not

significant or the constraints on paramters are notsatisfied

Generalization: GARCH models - solve theseproblems

Modelling volatility - ARCH and GARCH models p.9/33

ARCH and GARCH models

GARCH(p,q) model (generalized autoregressiveconditional heteroskedasticity) - equation for variance2t :

2t = + 1u2

t1 + . . .+ qu2

tq

+12

t1 + . . . + p2

tp

Constraints on parameters: variance has to be positive:

> 0, 1, . . . , q1 0, q > 0

1, . . . , p1 0, p > 0

stationarity:(1 + . . .+ q) + (1 + . . . p) < 1

A popular model is GARCH(1,1).Modelling volatility - ARCH and GARCH models p.10/33

GARCH models in R

Modelling YHOO returns - continued

In R: library fGarch function garchFit, model is writen for example like

arma(1,1)+garch(1,1) parameter trace=FALSE - we do not want the

details about optimization process

We have a model constant + noise; we try to model thenoise by ARCH/GARCH models

Modelling volatility - ARCH and GARCH models p.11/33

ARCH(1)

Estimation of ARCH(1) model:

We check1. ACF of standardized residuals2. ACF of squared standardized residuals3. summary with tests about standardized residuals

and their squares

Modelling volatility - ARCH and GARCH models p.12/33

GARCH models in v R

Useful values: @fitted - fitted values @residuals - residuals @h.t - estimated variance @sigma.t - estimated standard deviation

Standardized residuals - residuals divided by theirstandard deviation rezdu vydelen ich tadardnou -should be a white noise

Also their squares should be a white noise

Modelling volatility - ARCH and GARCH models p.13/33

ARCH(1)

Residuals:

Modelling volatility - ARCH and GARCH models p.14/33

ARCH(1)

Squares:

Modelling volatility - ARCH and GARCH models p.15/33

Tests about residuals

Tests:

We have: normality test, Ljung-Box for standardizedresiduals and their sqaures

What is new: testing homoskedasticity for the residuals

Modelling volatility - ARCH and GARCH models p.16/33

ARCH(2)

We try ARCH(2) - results of the tests:

Modelling volatility - ARCH and GARCH models p.17/33

ARCH(3)

ARCH(3) - results of the tests:

Modelling volatility - ARCH and GARCH models p.18/33

ARCH(4)

ARCH(4) - results of the tests:

No autocorrelation in residuals and their squares.

Modelling volatility - ARCH and GARCH models p.19/33

ARCH(4)

ACF of squared residuals:

without significant correlation

Modelling volatility - ARCH and GARCH models p.20/33

ARCH(4)

But ARCH coefficients i are not significant:

Modelling volatility - ARCH and GARCH models p.21/33

GARCH(1,1)

We try GARCH(1,1)

Tests:

Modelling volatility - ARCH and GARCH models p.22/33

GARCH(1,1)

Estimates:

Modelling volatility - ARCH and GARCH models p.23/33

Estimated standard deviation

We obtain it using @sigma.t :

Modelling volatility - ARCH and GARCH models p.24/33

Estimated standard deviation

Another access to the graphs - plot(model11):

Modelling volatility - ARCH and GARCH models p.25/33

Predictions

We use the function predict with parameter n.ahead(number of observations)

Modelling volatility - ARCH and GARCH models p.26/33

Predictions

Parameter nx - we can change the number ofobservations from the data which are shown in the plot(here nx=100:

Modelling volatility - ARCH and GARCH models p.27/33

Predictions

Predicted standard deviation: plot(ts(predictions[3]))

Modelling volatility - ARCH and GARCH models p.28/33

Predictions

For a longer time (exercise: compute its limit):

Modelling volatility - ARCH and GARCH models p.29/33

Application: Value at risk (VaR)

Value at risk (VaR) is basicly a quantile

Let X be a portfolio value, then

P(X V aR) = ,

for example for = 0.05

A standard GARCH assumes normal distribution - wecan compute quantiles

Shortcomings: normality assumptions there are also better risk measures than VaR

Modelling volatility - ARCH and GARCH models p.30/33

Apication: Value at risk (VaR)

WHAT WE WILL DO: Start with N observations of returns Estimate the GARCH model. Make a prediction for standard deviation and using

the prediction we construct VaR for returns for thefollowing day

Every day move the window with data (we have anew observation), estimate GARCH again andcompute thes new VaR

Modelling volatility - ARCH and GARCH models p.31/33

Not required - for those interested

https://systematicinvestor.wordpress.com/2012/01/06/trading-using-garch-volatility-forecast/

"... Now, lets create a strategy that switches betweenmean-reversion and trend-following strategies basedon GARCH(1,1) volatility forecast." + R code

From the website:

Modelling volatility - ARCH and GARCH models p.32/33

Other models for volatility

Threshold GARCH: ut > 0 - "good news", ut < 0 - "bad news" TARCH can model their different effect on

volatility leverage effect: bad news have a higher impact

We do not model variance (as in ARCH/GARCHmodels), but its logarithm exponential GARCH any power of standard deviation power GARCH

and others...

Modelling volatility - ARCH and GARCH models p.33/33

Stock pricesReturnsReturnsReturnsReturnsReturnsARCH and GARCH modelsARCH and GARCH modelsARCH and GARCH modelsGARCH models in RARCH(1)

GARCH models in v RARCH(1)

ARCH(1)

Tests about residualsARCH(2)

ARCH(3)

ARCH(4)

ARCH(4)

ARCH(4)

GARCH(1,1)

GARCH(1,1)

Estimated standard deviationEstimated standard deviationPredictionsPredictionsPredictionsPredictionsApplication: Value at risk (VaR)Apication: Value at risk (VaR)Not required - for those interestedOther models for volatility

Recommended