Download as pdf or txt
Download as pdf or txt
You are on page 1of 41

Simple ARCH GARCH Extensions ML Code Sim Diagnosis Alt Sum Covid

Volatility

• Volatility is the main measure of risk (see Chapter 4)


• Investment decisions
• Portfolio construction
• Derivative pricing

Financial Risk Forecasting © 2011-2022 Jon Danielsson, page 4 of 146


Simple ARCH GARCH Extensions ML Code Sim Diagnosis Alt Sum Covid

Estimation and forecasting

• In this Chapter we focus on the estimation and forecasting of volatility for a single
asset (univariate)
• The next Chapter does multivariate volatility
• The focus in this Chapter is on estimation, both of a model and in–sample
volatilities
• Chapter 5 introduces (out–of–sample) forecasting of volatilities

Financial Risk Forecasting © 2011-2022 Jon Danielsson, page 5 of 146


Simple ARCH GARCH Extensions ML Code Sim Diagnosis Alt Sum Covid

Structure

• The theoretical specification of common volatility models


• The theory of estimating the models
• Practical implementation in estimation
• Diagnostics of estimated volatility models

Financial Risk Forecasting © 2011-2022 Jon Danielsson, page 6 of 146


Simple ARCH GARCH Extensions ML Code Sim Diagnosis Alt Sum Covid

Univariate volatility models

• Moving average (MA)


• Exponentially weighted moving average (EWMA)
• GARCH and its extension models
• Implied volatilities (like VIX)
• Realized volatilities

Financial Risk Forecasting © 2011-2022 Jon Danielsson, page 7 of 146


Simple ARCH GARCH Extensions ML Code Sim Diagnosis Alt Sum Covid

Notation

WE Estimation window
λ Decay factor in EWMA
ǫt Residuals
ω, α, β Main model parameters
ζ, δ Other model parameters
L1 , L2 Lags in volatility models

Financial Risk Forecasting © 2011-2022 Jon Danielsson, page 8 of 146


Simple ARCH GARCH Extensions ML Code Sim Diagnosis Alt Sum Covid

Simple models

Financial Risk Forecasting © 2011-2022 Jon Danielsson, page 9 of 146


Simple ARCH GARCH Extensions ML Code Sim Diagnosis Alt Sum Covid

The mean of returns

• Recall from the last Chapter that the mean of daily returns is very low
• For www.financialriskforecasting.com/data/sp-500.csv
• It is 0.0001007711
• While the standard error is more than 100 times larger at 0.01245144
• With daily returns it is usually quite safe to assume the mean is zero
• Convenient because it makes the mathematics simpler
• We will return to this issue several times later in the book

Financial Risk Forecasting © 2011-2022 Jon Danielsson, page 10 of 146


Simple ARCH GARCH Extensions ML Code Sim Diagnosis Alt Sum Covid

Volatility

• Volatility is the standard error (square root of variance) of returns


• The definition of variance is
T
1 X
σ̂ 2 = (xi − x̄)2
T −1
i=1

• And since we assume the mean is zero, this simplifies to


T
1 X 2
σ̂ 2 = xi
T
i=1

Financial Risk Forecasting © 2011-2022 Jon Danielsson, page 11 of 146


Simple ARCH GARCH Extensions ML Code Sim Diagnosis Alt Sum Covid

Moving average

• The simplest volatility model is moving average


• Where the conditional volatility is the square root of the average of squared
returns over the estimation window, WE
v
u WE
u 1 X
σ̂t = t 2
yt−i
WE
i=1

• Note that this is a one day ahead forecast


• Because it uses information until time t − 1 to do the calculation for time t

Financial Risk Forecasting © 2011-2022 Jon Danielsson, page 12 of 146


Simple ARCH GARCH Extensions ML Code Sim Diagnosis Alt Sum Covid

Moving average

• The moving average model will generally perform quite badly


• Because it is quite sensitive to the size of the estimation window (see the next
plots)
• And because it does not weigh history

Financial Risk Forecasting © 2011-2022 Jon Danielsson, page 13 of 146


Simple ARCH GARCH Extensions ML Code Sim Diagnosis Alt Sum Covid

Hypothetical returns
40

20
return

−20

−40

0 50 100 150 200 250


day
Financial Risk Forecasting © 2011-2022 Jon Danielsson, page 14 of 146
Simple ARCH GARCH Extensions ML Code Sim Diagnosis Alt Sum Covid

Hypothetical returns
40

20
12
return

−20

−40

0 50 100 150 200 250


day
Financial Risk Forecasting © 2011-2022 Jon Danielsson, page 15 of 146
Simple ARCH GARCH Extensions ML Code Sim Diagnosis Alt Sum Covid

Hypothetical returns
40

20
12
9
return

−20

−40

0 50 100 150 200 250


day
Financial Risk Forecasting © 2011-2022 Jon Danielsson, page 16 of 146
Simple ARCH GARCH Extensions ML Code Sim Diagnosis Alt Sum Covid

Hypothetical returns
40

20
1112 9
return

−20

−40

0 50 100 150 200 250


day
Financial Risk Forecasting © 2011-2022 Jon Danielsson, page 17 of 146
Simple ARCH GARCH Extensions ML Code Sim Diagnosis Alt Sum Covid

Hypothetical returns
40

20
16
1112 9
return

−20

−40

0 50 100 150 200 250


day
Financial Risk Forecasting © 2011-2022 Jon Danielsson, page 18 of 146
Simple ARCH GARCH Extensions ML Code Sim Diagnosis Alt Sum Covid

Hypothetical returns
40

20 21
16
1112 9
return

−20

−40

0 50 100 150 200 250


day
Financial Risk Forecasting © 2011-2022 Jon Danielsson, page 19 of 146
Simple ARCH GARCH Extensions ML Code Sim Diagnosis Alt Sum Covid

Two concepts of volatility

• Unconditional volatility (σ)


volatility over an entire time period

• Conditional volatility (σt )


volatility conditional on a given time period, the past history, model and model
parameters

Financial Risk Forecasting © 2011-2022 Jon Danielsson, page 20 of 146


Simple ARCH GARCH Extensions ML Code Sim Diagnosis Alt Sum Covid

EWMA

• JP Morgan proposed a model called RiskMetrics in 1993


• Since they later used that name for a consulting company they spun off, we use
the more pedestrian
• Exponentially weighted moving average (EWMA)

Financial Risk Forecasting © 2011-2022 Jon Danielsson, page 21 of 146


Simple ARCH GARCH Extensions ML Code Sim Diagnosis Alt Sum Covid

EWMA

• Volatility a weighted sum of past returns, with weights wi

σ̂t2 = w1 yt−1
2 2
+ w2 yt−2 2
. . . + wWE yt−W E

• Let the weights be exponentially declining, and denote them by λi , start by

σ̂t2 = λyt−1
2
+ λ2 yt−2
2 2
. . . + λWE yt−W E

• 1>λ>0
• If WE is large enough, the terms λn are negligible for all n ≥ WE
• So set WE = ∞
• However, we have to ensure the sum of the weights is one

Financial Risk Forecasting © 2011-2022 Jon Danielsson, page 22 of 146


Simple ARCH GARCH Extensions ML Code Sim Diagnosis Alt Sum Covid

Deriving the EWMA model

• Sum of an infinite power series

λ
Sum = = λ + λ2 + λ3 + . . . + λ∞
1−λ
• Then since this is the sum of a geometric progression:

σ̂t2 = λyt−1
2
+ λ2 yt−2
2 2
. . . + λ∞ yt−∞

• Then

1−λX i 2
σ̂t2 = λ yt−i
λ
i=1

Financial Risk Forecasting © 2011-2022 Jon Danielsson, page 23 of 146


Simple ARCH GARCH Extensions ML Code Sim Diagnosis Alt Sum Covid

• Rewriting

1−λX i 2
σ̂t2 = (1 − 2
λ)yt−1 + λ yt−i
λ
i=2
• Since

X
(1 − λ) λi = (1 − λ)(λ1 + · · · + λ∞ ) = λ
i=1
• We get the EWMA equation

σ̂t2 = (1 − λ)yt−1
2 2
+ λσ̂t−1

Financial Risk Forecasting © 2011-2022 Jon Danielsson, page 24 of 146


Simple ARCH GARCH Extensions ML Code Sim Diagnosis Alt Sum Covid

What is λ ?

σ̂t2 = (1 − λ)yt−1
2 2
+ λσ̂t−1

• It is possible to estimate EWMA with the methods discussed later in this Chapter
• Since the EWMA is a reduced GARCH model, we could simply estimate λ with
maximum likelihood (See GARCH discussion below)
• JP Morgan set for daily data
λ = 0.94
• And when we use the term EWMA we are assuming that value

Financial Risk Forecasting © 2011-2022 Jon Danielsson, page 25 of 146


Simple ARCH GARCH Extensions ML Code Sim Diagnosis Alt Sum Covid

Unconditional EWMA volatility

• The EWMA is a reduced GARCH model


• So using an equation shown later, we get that the unconditional volatility is

0
σ2 =
0
• In other words, undefined
• We can explore that more with simulations

Financial Risk Forecasting © 2011-2022 Jon Danielsson, page 26 of 146


Simple ARCH GARCH Extensions ML Code Sim Diagnosis Alt Sum Covid

Simulation analysis

N=1000
y=rnorm (N)
lambda =0.94
s i g m a=v e c t o r ( l e n g t h=N)
sigma [1]=1
f o r ( i i n 2 :N) {
s i g m a [ i ]= lambda ∗ s i g m a [ i −1] +
(1− lambda ) ∗ y [ i −1]ˆ2
y [ i ]= y [ i ] ∗ s q r t ( s i g m a [ i ] )
}
p l o t ( y , t y p e= ’ l ’ )
p l o t ( sigma , t y p e= ’ l ’ , l o g= ’ y ’ )

Financial Risk Forecasting © 2011-2022 Jon Danielsson, page 27 of 146


Simple ARCH GARCH Extensions ML Code Sim Diagnosis Alt Sum Covid

Simulate EWMA
1.5
1.0
0.5
0.0
−0.5
−1.0

0 1000 2000 3000 4000 5000

1e−02
1e−05
1e−08
1e−11
0 1000 2000 3000 4000 5000
Financial Risk Forecasting © 2011-2022 Jon Danielsson, page 28 of 146
Simple ARCH GARCH Extensions ML Code Sim Diagnosis Alt Sum Covid

Conclusion from simulation

• As we simulated longer and longer paths


• The σ become smaller and smaller
• Eventually zero
• So the unconditional volatility is undefined

Financial Risk Forecasting © 2011-2022 Jon Danielsson, page 29 of 146


Simple ARCH GARCH Extensions ML Code Sim Diagnosis Alt Sum Covid

EWMA pros and cons

• Pros
• It is really simple to implement
• And not that inaccurate compared to the more sophisticated GARCH
• And multivatiate (see Chapter 3) versions are really easy
• Cons
• By definition it is less accurate than GARCH
• Which can become important in some cases
• The unconditional volatility is not defined which can be a problem

Financial Risk Forecasting © 2011-2022 Jon Danielsson, page 30 of 146


Simple ARCH GARCH Extensions ML Code Sim Diagnosis Alt Sum Covid

The GARCH Family

Financial Risk Forecasting © 2011-2022 Jon Danielsson, page 31 of 146


Simple ARCH GARCH Extensions ML Code Sim Diagnosis Alt Sum Covid

ARCH and GARCH

• Robert Engle proposed a model in 1982 called autoregressive conditionally


heteroscadastic (ARCH)
• Most volatility models derive from this
• Returns have a conditional distribution (here assumed to be normal)

Yt ∼ N (0, σt2 )

• Or we can write
Yt = σt ǫ t , ǫt ∼ N (0, 1)
• Where ǫt is called residual

Financial Risk Forecasting © 2011-2022 Jon Danielsson, page 32 of 146


Simple ARCH GARCH Extensions ML Code Sim Diagnosis Alt Sum Covid

ARCH

• The volatility is weighted average of past returns


• ARCH(L1 )
XL1
2 2
σt = ω + αi yt−i
i=1
• The number of lags is L1
• The most common form is ARCH(1)

σt2 = ω + αyt−1
2

• ω, α are parameters to be estimated with maximum likelihood

Financial Risk Forecasting © 2011-2022 Jon Danielsson, page 33 of 146


Simple ARCH GARCH Extensions ML Code Sim Diagnosis Alt Sum Covid

Moments

• Moments are the expected value of a random variable to some power


• So the mth moment is Z ∞
m
E[X ] = x m f (x)dx
−∞
• The mean is the first moment
Z ∞
µ = E[X ] = xf (x)dx
−∞

• The variance is a function of the first and the second moment

E[(X − µ)2 ] = E[X 2 ] + µ2 − 2µ E[X ]

Financial Risk Forecasting © 2011-2022 Jon Danielsson, page 34 of 146


Simple ARCH GARCH Extensions ML Code Sim Diagnosis Alt Sum Covid

Some mathematics of moments

• The expected value (unconditionally) of a time dependent variable Yt is:

E(Y m ) = E (Et (Y m )) = E(Ytm )

for all t. Therefore when µ = 0:



E (Y 2 ) = σ 2 = E Yt2

Financial Risk Forecasting © 2011-2022 Jon Danielsson, page 35 of 146


Simple ARCH GARCH Extensions ML Code Sim Diagnosis Alt Sum Covid

Some mathematics of moments

• If we write that in terms of residuals


 
E(Y 2 ) = E σt2 ǫ2t = E σt2

• Then:
σ 2 = E(ω + αYt−1
2
) = ω + ασ 2
• Because the parameters are constant
• So, the unconditional volatility of the ARCH(1) model is:
ω
σ2 =
1−α

Financial Risk Forecasting © 2011-2022 Jon Danielsson, page 36 of 146


Simple ARCH GARCH Extensions ML Code Sim Diagnosis Alt Sum Covid

Fat tails

• Recall the discussion in the last chapter which said that a distribution is fat tailed
if it has more extreme outcomes than a normal with the same mean and variance
• Kurtosis is normalized forth moment

E(Y 4 )
Kurtosis =
(E(Y 2 ))2
• Kurtosis is 3 for the normal
• Regardless of what the mean and variance are

Financial Risk Forecasting © 2011-2022 Jon Danielsson, page 37 of 146


Simple ARCH GARCH Extensions ML Code Sim Diagnosis Alt Sum Covid

ARCH(1) fat tails

• The most common distributional assumption for residuals ǫ is standard normality;


that is:
ǫt ∼ N (0, 1)
• Because ǫt is normal, so must conditional returns, σt ǫt because σt is a constant
• What about the unconditional distribution of the returns?

Financial Risk Forecasting © 2011-2022 Jon Danielsson, page 38 of 146


Simple ARCH GARCH Extensions ML Code Sim Diagnosis Alt Sum Covid

• The 4th moment is


E(Y 4 ) = E(Yt4 ) = E(σt4 ǫ41 )
• Because of the normality of ǫt and because it has variance one

E[ǫ4t ] = 3

• Then the 4th moment of Yt is


3 E[σt4 ]

Financial Risk Forecasting © 2011-2022 Jon Danielsson, page 39 of 146


Simple ARCH GARCH Extensions ML Code Sim Diagnosis Alt Sum Covid

• Recall the definition of kurtosis


 
E Y4 E Y4
Kurtosis = =
(E (Y 2 ))2 σ4
• Plug in the ARCH parameters
 2 
E(Y 4 ) = 3 E 2
ω + αYt−1
= 3ω 2 + 6αω E(Y 2 ) + 3α2 E(Y 4 )
ω
= 3ω 2 + 6αω + 3α2 E(Y 4 )
1−α

• Then
ω
E(Y 4 )(1 − 3α2 ) = 3ω 2 + 6αω
1−α
ω 2 (1 + α)
=3
1−α
Financial Risk Forecasting © 2011-2022 Jon Danielsson, page 40 of 146
Simple ARCH GARCH Extensions ML Code Sim Diagnosis Alt Sum Covid

• Solve for

3ω 2 (1 + α)
E(Y 4 ) =
(1 − α)(1 − 3α2 )
3σ 4 (1 − α2 )
=
1 − 3α2
• If that exceeds three then Yt must be fat tailed

3 1 − α2
Kurtosis = > 3 if 3α2 < 1.
1 − 3α2

Financial Risk Forecasting © 2011-2022 Jon Danielsson, page 41 of 146


Simple ARCH GARCH Extensions ML Code Sim Diagnosis Alt Sum Covid

Extreme value analysis (see Chapter 9)

• The table below shows that the the higher the α the fatter the tails (lower tail
index ι implies fatter tails)

α 0.10 0.50 0.90 0.99


ι 26.48 4.73 2.30 2.02

Financial Risk Forecasting © 2011-2022 Jon Danielsson, page 42 of 146


Simple ARCH GARCH Extensions ML Code Sim Diagnosis Alt Sum Covid

Parameter restrictions for ARCH(1)

• The ARCH(1) model has two parameters, ω and α


• Can we allow those two to take any value on the real line?
• No. There are two restrictions on the values the parameters can take
• One we always impose, and the other sometimes
• To ensure positive volatility ensure both parameters are positive

α > 0, ω > 0

Financial Risk Forecasting © 2011-2022 Jon Danielsson, page 43 of 146


Simple ARCH GARCH Extensions ML Code Sim Diagnosis Alt Sum Covid

Preventing explosions — Stationarity


• Suppose α > 1 then we expect σt to become bigger and bigger over time
• Which would mean that the unconditional variance undefined
ω
σ2 =
1−α
• Because, something to the power 2 cannot be negative (these are not complex
numbers)
• We might think therefore to restrict α to be less than one

0<α<1

• This is not needed except in special circumstances (see discussion on GARCH


below)
Financial Risk Forecasting © 2011-2022 Jon Danielsson, page 44 of 146

You might also like