financial risk forecasting chapter 2 univariate volatility
TRANSCRIPT
Financial Risk Forecasting © 2011-2021 Jon Danielsson, page 1 of 145
Simple ARCH GARCH Extensions ML Code Sim Diagnosis Alt Sum Covid
Financial Risk ForecastingChapter 2
Univariate Volatility Modeling
Jon Danielsson ©2021London School of Economics
To accompanyFinancial Risk Forecasting
www.financialriskforecasting.com
Published by Wiley 2011
Version 6.3, November 2021
Financial Risk Forecasting © 2011-2021 Jon Danielsson, page 2 of 145
Simple ARCH GARCH Extensions ML Code Sim Diagnosis Alt Sum Covid
Financial Risk Forecasting © 2011-2021 Jon Danielsson, page 3 of 145
Simple ARCH GARCH Extensions ML Code Sim Diagnosis Alt Sum Covid
Financial Risk Forecasting © 2011-2021 Jon Danielsson, page 4 of 145
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-2021 Jon Danielsson, page 5 of 145
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 singleasset (univariate)
• The next Chapter does multivariate volatility
• The focus in this Chapter is on estimation, both of a model and in–samplevolatilities
• Chapter 5 introduces (out–of–sample) forecasting of volatilities
Financial Risk Forecasting © 2011-2021 Jon Danielsson, page 6 of 145
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-2021 Jon Danielsson, page 7 of 145
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-2021 Jon Danielsson, page 8 of 145
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-2021 Jon Danielsson, page 9 of 145
Simple ARCH GARCH Extensions ML Code Sim Diagnosis Alt Sum Covid
Simple models
Financial Risk Forecasting © 2011-2021 Jon Danielsson, page 10 of 145
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-2021 Jon Danielsson, page 11 of 145
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
σ̂2 =1
T − 1
T∑
i=1
(xi − x̄)2
• And since we assume the mean is zero, this simplifies to
σ̂2 =1
T
T∑
i=1
x2i
Financial Risk Forecasting © 2011-2021 Jon Danielsson, page 12 of 145
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 average sum of squared returns over theestimation window, WE
σ̂2t =
1
WE
WE∑
i=1
y2t−i
• 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-2021 Jon Danielsson, page 13 of 145
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 nextplots)
• And because it does not weigh history
Financial Risk Forecasting © 2011-2021 Jon Danielsson, page 14 of 145
Simple ARCH GARCH Extensions ML Code Sim Diagnosis Alt Sum Covid
Hypothetical returns
0 50 100 150 200 250
−40
−20
0
20
40
day
retu
rn
Financial Risk Forecasting © 2011-2021 Jon Danielsson, page 15 of 145
Simple ARCH GARCH Extensions ML Code Sim Diagnosis Alt Sum Covid
Hypothetical returns
0 50 100 150 200 250
−40
−20
0
20
40
day
retu
rn
12
Financial Risk Forecasting © 2011-2021 Jon Danielsson, page 16 of 145
Simple ARCH GARCH Extensions ML Code Sim Diagnosis Alt Sum Covid
Hypothetical returns
0 50 100 150 200 250
−40
−20
0
20
40
day
retu
rn
912
Financial Risk Forecasting © 2011-2021 Jon Danielsson, page 17 of 145
Simple ARCH GARCH Extensions ML Code Sim Diagnosis Alt Sum Covid
Hypothetical returns
0 50 100 150 200 250
−40
−20
0
20
40
day
retu
rn
11 912
Financial Risk Forecasting © 2011-2021 Jon Danielsson, page 18 of 145
Simple ARCH GARCH Extensions ML Code Sim Diagnosis Alt Sum Covid
Hypothetical returns
0 50 100 150 200 250
−40
−20
0
20
40
day
retu
rn
16
11 912
Financial Risk Forecasting © 2011-2021 Jon Danielsson, page 19 of 145
Simple ARCH GARCH Extensions ML Code Sim Diagnosis Alt Sum Covid
Hypothetical returns
0 50 100 150 200 250
−40
−20
0
20
40
day
retu
rn
21
16
11 912
Financial Risk Forecasting © 2011-2021 Jon Danielsson, page 20 of 145
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 modelparameters
Financial Risk Forecasting © 2011-2021 Jon Danielsson, page 21 of 145
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 usethe more pedestrian
• Exponentially weighted moving average (EWMA)
Financial Risk Forecasting © 2011-2021 Jon Danielsson, page 22 of 145
Simple ARCH GARCH Extensions ML Code Sim Diagnosis Alt Sum Covid
EWMA
• Volatility a weighted sum of past returns, with weights wi
σ̂2t = w1y
2t−1 + w2y
2t−2 . . .+ wWE
y2t−WE
• Let the weights be exponentially declining, and denote them by λi
σ̂2t = λy2t−1 + λ2y2t−2 . . .+ λWE y2t−WE
• 1 > λ > 0
• If WE is large enough, the terms λn are negligible for all n ≥ WE
• So set WE = ∞
Financial Risk Forecasting © 2011-2021 Jon Danielsson, page 23 of 145
Simple ARCH GARCH Extensions ML Code Sim Diagnosis Alt Sum Covid
Deriving the EWMA model
• Sum of an infinite power series
Sum =λ
1− λ= λ+ λ2 + λ3 + . . .+ λ∞
• Thenσ̂2t = λy2t−1 + λ2y2t−2 . . .+ λ∞y2t−∞
• Then
σ̂2t =
1− λ
λ
∞∑
i=1
λiy2t−i
Financial Risk Forecasting © 2011-2021 Jon Danielsson, page 24 of 145
Simple ARCH GARCH Extensions ML Code Sim Diagnosis Alt Sum Covid
• Rewriting
σ̂2t = (1− λ)y2t−1 +
1− λ
λ
∞∑
i=2
λiy2t−i
• Since
(1− λ)∞∑
i=1
λi = (1− λ)(λ1 + · · ·+ λ∞) = λ
• We get the EWMA equation
σ̂2t = (1− λ)y2t−1 + λσ̂2
t−1
Financial Risk Forecasting © 2011-2021 Jon Danielsson, page 25 of 145
Simple ARCH GARCH Extensions ML Code Sim Diagnosis Alt Sum Covid
What is λ ?
σ̂2t = (1− λ)y2t−i + λσ̂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-2021 Jon Danielsson, page 26 of 145
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
σ2 =0
0
• In other words, undefined
• We can explore that more with simulations
Financial Risk Forecasting © 2011-2021 Jon Danielsson, page 27 of 145
Simple ARCH GARCH Extensions ML Code Sim Diagnosis Alt Sum Covid
Simulation analysis
N=1000y=rnorm (N)lambda=0.94s igma=ve c t o r ( l e n g t h=N)sigma [1]=1f o r ( i i n 2 :N){
s igma [ i ]= lambda∗ s igma [ i −1] +(1− lambda ) ∗y [ i −1]ˆ2
y [ i ]=y [ i ] ∗ s q r t ( s igma [ i ] )}p l o t ( y , t ype=’ l ’ )p l o t ( sigma , type=’ l ’ , l o g=’ y ’ )
Financial Risk Forecasting © 2011-2021 Jon Danielsson, page 28 of 145
Simple ARCH GARCH Extensions ML Code Sim Diagnosis Alt Sum Covid
Simulate EWMA
0 1000 2000 3000 4000 5000
−1.0−0.5
0.00.51.01.5
0 1000 2000 3000 4000 5000
1e−11
1e−08
1e−05
1e−02
Financial Risk Forecasting © 2011-2021 Jon Danielsson, page 29 of 145
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-2021 Jon Danielsson, page 30 of 145
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-2021 Jon Danielsson, page 31 of 145
Simple ARCH GARCH Extensions ML Code Sim Diagnosis Alt Sum Covid
The GARCH Family
Financial Risk Forecasting © 2011-2021 Jon Danielsson, page 32 of 145
Simple ARCH GARCH Extensions ML Code Sim Diagnosis Alt Sum Covid
ARCH and GARCH
• Robert Engle proposed a model in 1982 called autoregressive conditionallyheteroscadastic (ARCH)
• Most volatility models derive from this
• Returns have a conditional distribution (here assumed to be normal)
Yt ∼ N (0, σ2t )
• Or we can writeYt = σtǫt , ǫt ∼ N (0, 1)
• Where ǫt is called residual
Financial Risk Forecasting © 2011-2021 Jon Danielsson, page 33 of 145
Simple ARCH GARCH Extensions ML Code Sim Diagnosis Alt Sum Covid
ARCH
• The volatility is weighted average of past returns
• ARCH(L1)
σ2t = ω +
L1∑
i=1
αiy2t−i
• The number of lags is L1
• The most common form is ARCH(1)
σ2t = ω + αy2t−1
• ω, α are parameters to be estimated with maximum likelihood
Financial Risk Forecasting © 2011-2021 Jon Danielsson, page 34 of 145
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
E[Xm] =
∫∞
−∞
xmf (x)dx
• The mean is the first moment
µ = 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-2021 Jon Danielsson, page 35 of 145
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(Ym) = E (Et(Ym)) = E(Ym
t )
for all t. Therefore when µ = 0:
E (Y 2) = σ2 = E(Y 2t
)
Financial Risk Forecasting © 2011-2021 Jon Danielsson, page 36 of 145
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(σ2t ǫ
2t
)= E
(σ2t
)
• Then:σ2 = E(ω + αY 2
t−1) = ω + ασ2
• Because the parameters are constant
• So, the unconditional volatility of the ARCH(1) model is:
σ2 =ω
1− α
Financial Risk Forecasting © 2011-2021 Jon Danielsson, page 37 of 145
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 tailedif it has more extreme outcomes than a normal with the same mean and variance
• Kurtosis is normalized forth moment
Kurtosis =E(Y 4)
(E(Y 2))2
• Kurtosis is 3 for the normal
• Regardless of what the mean and variance are
Financial Risk Forecasting © 2011-2021 Jon Danielsson, page 38 of 145
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-2021 Jon Danielsson, page 39 of 145
Simple ARCH GARCH Extensions ML Code Sim Diagnosis Alt Sum Covid
• The 4th moment isE(Y 4) = E(Y 4
t ) = E(σ4t ǫ
41)
• Because of the normality of ǫt and because it has variance one
E[ǫ4t ] = 3
• Then the 4th moment of Yt is3 E[σt
4]
Financial Risk Forecasting © 2011-2021 Jon Danielsson, page 40 of 145
Simple ARCH GARCH Extensions ML Code Sim Diagnosis Alt Sum Covid
• Recall the definition of kurtosis
Kurtosis =E(Y 4)
(E (Y 2))2=
E(Y 4)
σ4
• Plug in the ARCH parameters
E(Y 4) = 3E((
ω + αY 2t−1
)2)
= 3ω2 + 6αω E(Y 2) + 3α2 E(Y 4)
= 3ω2 + 6αωω
1− α+ 3α2 E(Y 4)
• Then
E(Y 4)(1− 3α2) = 3ω2 + 6αωω
1− α
= 3ω2(1 + α)
1− α
Financial Risk Forecasting © 2011-2021 Jon Danielsson, page 41 of 145
Simple ARCH GARCH Extensions ML Code Sim Diagnosis Alt Sum Covid
• Solve for
E(Y 4) =3ω2(1 + α)
(1− α)(1− 3α2)
=σ2(1− α2)
1− 3α2
• If that exceeds three then Yt must be fat tailed
Kurtosis =3(1− α2
)
1− 3α2> 3 if 3α2 < 1.
Financial Risk Forecasting © 2011-2021 Jon Danielsson, page 42 of 145
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 tailindex ι implies fatter tails)
α 0.10 0.50 0.90 0.99ι 26.48 4.73 2.30 2.02
Financial Risk Forecasting © 2011-2021 Jon Danielsson, page 43 of 145
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-2021 Jon Danielsson, page 44 of 145
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 to cannot be negative
• We might think therefore to restrict α to be less than one
0 < α < 1
• This is not needed except in special circumstances (see discussion on GARCHbelow)
Financial Risk Forecasting © 2011-2021 Jon Danielsson, page 45 of 145
Simple ARCH GARCH Extensions ML Code Sim Diagnosis Alt Sum Covid
Generalized ARCH (GARCH)
• As it turns out, ARCH is not a very good model and almost nobody uses it
• The reason is that it needs to use information from many days before t tocalculate volatility on day t
• That is, it needs a lot of lags
• The solution is to write it as an ARMA model
• That is, add one component to the equation, βσ2t−1
Financial Risk Forecasting © 2011-2021 Jon Danielsson, page 46 of 145
Simple ARCH GARCH Extensions ML Code Sim Diagnosis Alt Sum Covid
GARCH(L1,L2)
σ2t = ω +
L1∑
i=1
αiY2t−i +
L2∑
j=1
βjσ2t−j
GARCH(1,1)σ2t = ω + αY 2
t−1 + βσ2t−1
• GARCH(1,1) is the most common specification
Financial Risk Forecasting © 2011-2021 Jon Danielsson, page 47 of 145
Simple ARCH GARCH Extensions ML Code Sim Diagnosis Alt Sum Covid
GARCH(1,1) unconditional volatility
• The unconditional volatility is the unconditional expectation of volatility on agiven day
σ2 = E[σ2t ]
• So plug in the parammeters
σ2 = E(ω + αY 2t−1 + βσ2
t−1) =ω + ασ2 + βσ2
• And solveσ2 =
ω
1− α− β
Financial Risk Forecasting © 2011-2021 Jon Danielsson, page 48 of 145
Simple ARCH GARCH Extensions ML Code Sim Diagnosis Alt Sum Covid
Parameter restrictions
• To ensure positive volatility forecasts
ω, α, β ≥ 0
• Because if any parameter is negative σt+1 may be negative
Financial Risk Forecasting © 2011-2021 Jon Danielsson, page 49 of 145
Simple ARCH GARCH Extensions ML Code Sim Diagnosis Alt Sum Covid
Stationarity
• Should we imposeα+ β < 1
• Becauseσ2 =
ω
1− α− β
• Not advisable except in special circumstances for 2 reasons
1. Can lead to multiple parameter combinations satisfying the constraint so volatilityforecasts can be non-unique
2. Model is misspecified anyways and the non-restricted could give more accurateforecasts
Financial Risk Forecasting © 2011-2021 Jon Danielsson, page 50 of 145
Simple ARCH GARCH Extensions ML Code Sim Diagnosis Alt Sum Covid
EWMA unconditional variance
• EWMA isσ2t = (1− λ)y2t−i + λσ2
t−1
• The GARCH model isσ2t = ω + αy2t−1 + βσ2
t−1
• And GARCH becomes EWMA when ω = 0, β = λ, α = 1− λ
• So for EWMA
σ2 =0
0
Financial Risk Forecasting © 2011-2021 Jon Danielsson, page 51 of 145
Simple ARCH GARCH Extensions ML Code Sim Diagnosis Alt Sum Covid
Meaning of parameters
• α is news — how volatility reacts to new information
• β is memory — how much volatility remembers from the past
• The size of (α+ β) determines how quickly the predictability (memory) of theprocess dies out:
• If (α+ β) is close to zero, predictability will die out very quickly
• If (α+ β) is close to one, predictability will die out slowly
Financial Risk Forecasting © 2011-2021 Jon Danielsson, page 52 of 145
Simple ARCH GARCH Extensions ML Code Sim Diagnosis Alt Sum Covid
GARCH news and memory
0 10 20 30 40 50 60 70
0
5
10
15
alpha=0.1, beta=0.8
0 10 20 30 40 50 60 70
0
5
10
15
alpha=0.15, beta=0.8
0 10 20 30 40 50 60 70
0
5
10
15
alpha=0.1, beta=0.5
0 10 20 30 40 50 60 70
0
5
10
15
alpha=0.15, beta=0.5
Financial Risk Forecasting © 2011-2021 Jon Danielsson, page 53 of 145
Simple ARCH GARCH Extensions ML Code Sim Diagnosis Alt Sum Covid
Half-life
• In physics, half-life indicates how quickly a radioactive material decays to half theradiation
• The half-life of GARCH is how quickly a shock to volatility dies out to half theimpact of the shock
• You can see that labelled on the next figure
Financial Risk Forecasting © 2011-2021 Jon Danielsson, page 54 of 145
Simple ARCH GARCH Extensions ML Code Sim Diagnosis Alt Sum Covid
GARCH news and memory
0 10 20 30 40 50 60 70
0
5
10
15
alpha=0.1, beta=0.8
0 10 20 30 40 50 60 70
0
5
10
15
alpha=0.15, beta=0.8
0 10 20 30 40 50 60 70
0
5
10
15
alpha=0.1, beta=0.5
0 10 20 30 40 50 60 70
0
5
10
15
alpha=0.15, beta=0.5
Financial Risk Forecasting © 2011-2021 Jon Danielsson, page 55 of 145
Simple ARCH GARCH Extensions ML Code Sim Diagnosis Alt Sum Covid
GARCH Half-life
σ2t = ω + αy2t−1 + βσ2
t−1
AsEt−1[y
2t ] = σ2
t
Theny2t = ω + (α+ β)y2t−1
Subtract σ2 = ω/(1− α− β) from both sides
y2t − σ2 =ω + (α+ β)y2t−1 −ω
1− α− β
=(α+ β)(y2t−1 − σ2)
Financial Risk Forecasting © 2011-2021 Jon Danielsson, page 56 of 145
Simple ARCH GARCH Extensions ML Code Sim Diagnosis Alt Sum Covid
• Iterate n times then
y2t+n − σ2 = (α+ β)n(y2t−1 − σ2)
• The number of periods, n∗, it takes for conditional variance to revert back halfwaytowards unconditional variance
σ2t+n∗ − σ2 =
1
2(σ2
t+1 − σ2)
• So we want to solve for n∗ as a function of the pparameters
Financial Risk Forecasting © 2011-2021 Jon Danielsson, page 57 of 145
Simple ARCH GARCH Extensions ML Code Sim Diagnosis Alt Sum Covid
• So
(α+ β)n∗−1(σ2
t+1 − σ2) =1
2(σ2
t+1 − σ2)
• So
n∗ = 1 +
log
(1
2
)
log(α+ β)
• And as (α+ β) −→ 1, n∗ → ∞, memory is infinite
Financial Risk Forecasting © 2011-2021 Jon Danielsson, page 58 of 145
Simple ARCH GARCH Extensions ML Code Sim Diagnosis Alt Sum Covid
Other GARCH type models
Financial Risk Forecasting © 2011-2021 Jon Danielsson, page 59 of 145
Simple ARCH GARCH Extensions ML Code Sim Diagnosis Alt Sum Covid
Conditional distributions
• The conditional distribution in the GARCH model in the previous section is thenormal
ǫt ∼ N(0, 1)
• We showed in Chapter 1 that unconditional, returns are fat and we also showed inthe previous section that the unconditional returns in GARCH are fat even if thecondition is normal
• That leaves the question of whether they are fat enough, which becomesimportant in the risk measure chapters later in the book
• We can make the GARCH model fatter by using a different conditional distribution
Financial Risk Forecasting © 2011-2021 Jon Danielsson, page 60 of 145
Simple ARCH GARCH Extensions ML Code Sim Diagnosis Alt Sum Covid
Student–t GARCH (tGARCH)
• As we discussed in the previous chapter, the Student-t distribution is fat, wherethe degrees of freedom parameter — ν — controls the fatness
• If ν = ∞ the Student becomes the normal
• The Student–t GARCH then replaces the normal innovation distribution with theStudent
ǫt ∼ t(ν)
• When it comes to estimation, ν becomes yet another parameter to be estimatedalong with the three GARCH parameters
Financial Risk Forecasting © 2011-2021 Jon Danielsson, page 61 of 145
Simple ARCH GARCH Extensions ML Code Sim Diagnosis Alt Sum Covid
Using tGARCH for VaR/ES
• An important complication is that by convention the Student–t in tGARCH usesthe standardized Student–t density, i.e., one where it is standardized to havevariance=1
• While the Student–t density density has variance=ν/ν−2
• That becomes important later when we do risk (VaR and ES)
Financial Risk Forecasting © 2011-2021 Jon Danielsson, page 62 of 145
Simple ARCH GARCH Extensions ML Code Sim Diagnosis Alt Sum Covid
• There are two downsides to this
1. The tGARCH needs more observation in estimation, several thousand2. The ν parameter is often estimated with high standard error so it is imprecise and
can move around when we use estimation windows in risk forecasting
Financial Risk Forecasting © 2011-2021 Jon Danielsson, page 63 of 145
Simple ARCH GARCH Extensions ML Code Sim Diagnosis Alt Sum Covid
What about the mean?
• In the standard GARCH model the mean is assumed to be zero
Yt ∼ (0, σ2t )
• What is often done in practice is to subtract the mean from the returns prior toestimation
• However, in many applications, like price forecasting, it can be beneficial toforecast the mean
• While there are many complicated ways to do so, two are relatively simple andcommon
Financial Risk Forecasting © 2011-2021 Jon Danielsson, page 64 of 145
Simple ARCH GARCH Extensions ML Code Sim Diagnosis Alt Sum Covid
(G)ARCH in mean
• Incorporating a meanYt = µt + σtǫt
• Return can be positively related to volatility
µt = δσ2t
• Where δ captures the impact of volatility on the mean
• We can also make the mean follow some autoregressive process like ARMA
µt = a+ byt−1 + cǫt−1
• This is build into the rugarch package
• We will evaluate the quality of the mean in the chapter on backtesting
Financial Risk Forecasting © 2011-2021 Jon Danielsson, page 65 of 145
Simple ARCH GARCH Extensions ML Code Sim Diagnosis Alt Sum Covid
Leverage effect
• If the price of equity falls, the company’s debt to equity ratio increases and thecompany becomes riskier as a consequence
• We therefore might expect the volatility to increase
• That is known as the leverage effects
• Stock returns are negatively correlated with changes in volatility
• However, the standard GARCH model assumes symmetry
Financial Risk Forecasting © 2011-2021 Jon Danielsson, page 66 of 145
Simple ARCH GARCH Extensions ML Code Sim Diagnosis Alt Sum Covid
• So separate out the impact of the positive and negative returns with an extraparameter ζ
σ2t = ω + α (|Yt−1| − ζYt−1)
2 + βσ2t−1
• If ζ = 0 this model reduces to the standard GARCH model
Financial Risk Forecasting © 2011-2021 Jon Danielsson, page 67 of 145
Simple ARCH GARCH Extensions ML Code Sim Diagnosis Alt Sum Covid
Power effect
• In the standard GARCH model the power on lagged volatility is 2
σ2t = ω + αY 2
t−1 + βσ2t−1
• However, there is no reason to believe that it should be 2, and it is sometimesfound in estimation that the GARCH model is improved if the power is different
• In the power GARCH we also estimate the parameter for the power, δ
σ2t = ω + α|Yt−1|δ + βσ2
t−1
• Ifδ 6= 2
• The model has power effects
Financial Risk Forecasting © 2011-2021 Jon Danielsson, page 68 of 145
Simple ARCH GARCH Extensions ML Code Sim Diagnosis Alt Sum Covid
Asymmetric power GARCH – APARCH
• These two affeects come together in the APARCH model
σ2t = ω + α (|Yt−1| − ζYt−1)
δ + βσδt−1
• The model allows for leverage effects when ζ 6= 0 and power effects when δ 6= 2
• This model can difficult to estimate and typically requires thousands ofobservations
Financial Risk Forecasting © 2011-2021 Jon Danielsson, page 69 of 145
Simple ARCH GARCH Extensions ML Code Sim Diagnosis Alt Sum Covid
News impact curve
• The news impact curve captures the relationship between shocks at time t − 1(ǫt−1) to the variance at time t, σ2
t
Financial Risk Forecasting © 2011-2021 Jon Danielsson, page 70 of 145
Simple ARCH GARCH Extensions ML Code Sim Diagnosis Alt Sum Covid
SP-500
• 10,000 observations
• 1980-11-12 - 2020-07-09
• We discuss the significance a bit later
ω α β ζ δ ν half life
1 0.0000018 0.09 0.89 482 0.0000010 0.08 0.91 5.9 1103 0.0000001 0.06 0.89 0.35 2.6 47
Financial Risk Forecasting © 2011-2021 Jon Danielsson, page 71 of 145
Simple ARCH GARCH Extensions ML Code Sim Diagnosis Alt Sum Covid
GARCH news and memory (same SP-500)
−0.3 −0.2 −0.1 0.0 0.1 0.2 0.3
0.000
0.002
0.004
0.006
0.008
News impact
Shock
GARCH
tGARCH
APARCH
Financial Risk Forecasting © 2011-2021 Jon Danielsson, page 72 of 145
Simple ARCH GARCH Extensions ML Code Sim Diagnosis Alt Sum Covid
Maximum Likelihood
Financial Risk Forecasting © 2011-2021 Jon Danielsson, page 73 of 145
Simple ARCH GARCH Extensions ML Code Sim Diagnosis Alt Sum Covid
Maximum likelihood estimation
• A linear model isy = a+ bx + ǫ
• i.e. ǫ relate linearly to the dependent variable y
• Why we can do OLS
• But GARCH is non-linear
• Do maximum likelihood
• Consistent parameter estimates even if true density is non–normal
Financial Risk Forecasting © 2011-2021 Jon Danielsson, page 74 of 145
Simple ARCH GARCH Extensions ML Code Sim Diagnosis Alt Sum Covid
What is maximum likelihood?
• Ask the question which parameters most likely generated the data we have
• Suppose we have a sample of
(−0.2, 3, 4,−1, 0.5)
• Of the three possibilities, which is most likely?
µ σ1 1 52 -2 23 1 2
Financial Risk Forecasting © 2011-2021 Jon Danielsson, page 75 of 145
Simple ARCH GARCH Extensions ML Code Sim Diagnosis Alt Sum Covid
Normal density
• Ifx ∼ N (µ, σ2)
• Then its density is
f (x) =1√2πσ2
exp
(
−1
2
(x − µ)2
σ2
)
Financial Risk Forecasting © 2011-2021 Jon Danielsson, page 76 of 145
Simple ARCH GARCH Extensions ML Code Sim Diagnosis Alt Sum Covid
ARCH(1)
• ǫt in ARCH(1) is standard normally distributed
Yt =σtǫt
σ2t =ω + αY 2
t−1
ǫt ∼N (0, 1)
Financial Risk Forecasting © 2011-2021 Jon Danielsson, page 77 of 145
Simple ARCH GARCH Extensions ML Code Sim Diagnosis Alt Sum Covid
ARCH(1) density
• Presence of lagged returns implies the density function for t = 1 is unknown sincey0 is unknown
• The t = 2 density is:
f (y2|y1) =1
√
2π(ω + αy21 )exp
(
−1
2
y22ω + αy21
)
• Joint density
T∏
t=2
f (yt |yt−1) =
T∏
t=2
1√
2π(ω + αy2t−1)exp
(
−1
2
y2tω + αy2t−1
)
Financial Risk Forecasting © 2011-2021 Jon Danielsson, page 78 of 145
Simple ARCH GARCH Extensions ML Code Sim Diagnosis Alt Sum Covid
ARCH(1) likelihood function
• The likelihood function is then the density, except we condition the parametersθ = (α, β) on the data
logL(θ|data)• The log likelihood function is then
logL =−T − 1
2log(2π)
︸ ︷︷ ︸
Constant
− 1
2
T∑
t=2
(
log(ω + αy2t−1) +y2t
ω + αy2t−1
)
Financial Risk Forecasting © 2011-2021 Jon Danielsson, page 79 of 145
Simple ARCH GARCH Extensions ML Code Sim Diagnosis Alt Sum Covid
GARCH(1,1)
σ2t = ω + αY 2
t−1 + βσ2t−1
f (y2|y1) =1
√
2π(ω + αy21 + βσ̂21)
exp
(
−1
2
y22ω + αy21 + βσ̂2
1
)
logL = −T − 1
2log(2π)
︸ ︷︷ ︸
Constant
− 1
2
T∑
t=2
(
(log(ω + αy2t−1 + βσ̂2t−1)) +
y2tω + αy2t−1 + βσ̂2
t−1
)
Financial Risk Forecasting © 2011-2021 Jon Danielsson, page 80 of 145
Simple ARCH GARCH Extensions ML Code Sim Diagnosis Alt Sum Covid
Importance of σ1
• Value of σ1 can make a large difference
• Especially when the sample size is small
• Typically set σ1 = σ̂
Financial Risk Forecasting © 2011-2021 Jon Danielsson, page 81 of 145
Simple ARCH GARCH Extensions ML Code Sim Diagnosis Alt Sum Covid
Volatility targeting
• Since we know thatσ2 =
ω
1− α− β
• We can setω = σ̂2(1− α− β)
• where σ̂2 is the sample variance
• And save one parameter in the estimation
Financial Risk Forecasting © 2011-2021 Jon Danielsson, page 82 of 145
Simple ARCH GARCH Extensions ML Code Sim Diagnosis Alt Sum Covid
Issues in estimation
• Parameters are obtained by maximizing the likelihood function
θ the set of parametersΘ the space the parameters live in
maxθ∈Θ
logL(θ|y) = θ̂ML
• Done with an algorithm called optimizer
• There often are numerical problems
Financial Risk Forecasting © 2011-2021 Jon Danielsson, page 83 of 145
Simple ARCH GARCH Extensions ML Code Sim Diagnosis Alt Sum Covid
Optimizing
• The computer uses an algorithm called optimizer to maximize the likelihoodfunction
• There are many optimizers available
• A classical, and not the best, optimizer is Newton–Raphson
Financial Risk Forecasting © 2011-2021 Jon Danielsson, page 84 of 145
Simple ARCH GARCH Extensions ML Code Sim Diagnosis Alt Sum Covid
Newton–Raphson
0 50 100 150 200
0
2
4
6
8
parameter value
log lik
elih
ood
Financial Risk Forecasting © 2011-2021 Jon Danielsson, page 85 of 145
Simple ARCH GARCH Extensions ML Code Sim Diagnosis Alt Sum Covid
Newton–Raphson
0 50 100 150 200
0
2
4
6
8
parameter value
log lik
elih
ood
o1df(x)
dx> 0
d2f(x)dx2
> 0
Financial Risk Forecasting © 2011-2021 Jon Danielsson, page 86 of 145
Simple ARCH GARCH Extensions ML Code Sim Diagnosis Alt Sum Covid
Newton–Raphson
0 50 100 150 200
0
2
4
6
8
parameter value
log lik
elih
ood
o2df(x)
dx< 0
d2f(x)dx2
< 0
Financial Risk Forecasting © 2011-2021 Jon Danielsson, page 87 of 145
Simple ARCH GARCH Extensions ML Code Sim Diagnosis Alt Sum Covid
Newton–Raphson
0 50 100 150 200
0
2
4
6
8
parameter value
log lik
elih
ood
o 3
df(x)dx
> 0
d2f(x)dx2
< 0
Financial Risk Forecasting © 2011-2021 Jon Danielsson, page 88 of 145
Simple ARCH GARCH Extensions ML Code Sim Diagnosis Alt Sum Covid
Newton–Raphson
0 50 100 150 200
0
2
4
6
8
parameter value
log lik
elih
ood
o4
df(x)dx
= 0d2f(x)
dx2< 0
Financial Risk Forecasting © 2011-2021 Jon Danielsson, page 89 of 145
Simple ARCH GARCH Extensions ML Code Sim Diagnosis Alt Sum Covid
Pathologies
• It is straightforward to optimize the ARCH model
• And the GARCH
• For other models they can be a number of problems
• A common one is multiple local maxima
Financial Risk Forecasting © 2011-2021 Jon Danielsson, page 90 of 145
Simple ARCH GARCH Extensions ML Code Sim Diagnosis Alt Sum Covid
Pathologies
0 50 100 150 200
0
2
4
6
8
parameter value
log lik
elih
ood
Financial Risk Forecasting © 2011-2021 Jon Danielsson, page 91 of 145
Simple ARCH GARCH Extensions ML Code Sim Diagnosis Alt Sum Covid
Pathologies
0 50 100 150 200 250 300
0
2
4
6
8
10
12
parameter value
log lik
elih
ood
Financial Risk Forecasting © 2011-2021 Jon Danielsson, page 92 of 145
Simple ARCH GARCH Extensions ML Code Sim Diagnosis Alt Sum Covid
Pathologies
0 50 100 150 200
0
5
10
15
parameter value
log lik
elih
ood
Financial Risk Forecasting © 2011-2021 Jon Danielsson, page 93 of 145
Simple ARCH GARCH Extensions ML Code Sim Diagnosis Alt Sum Covid
Pathologies
0 50 100 150 200
0
1
2
3
4
5
parameter value
log lik
elih
ood
Financial Risk Forecasting © 2011-2021 Jon Danielsson, page 94 of 145
Simple ARCH GARCH Extensions ML Code Sim Diagnosis Alt Sum Covid
Issues
• Problems are rare for smaller models such as GARCH(1,1)
• The more parameters there are, the more likely problems are
• And the more data we need for estimation
• GARCH might need at least 500 observations, Student–t GARCH 3,000
• For the multivatiate models discussed in the next chapter estimation problems arecommon
• For example multiple local minima
Financial Risk Forecasting © 2011-2021 Jon Danielsson, page 95 of 145
Simple ARCH GARCH Extensions ML Code Sim Diagnosis Alt Sum Covid
Estimation options
• At least two R packages support estimating GARCH style models
• The best is rugarch by Alexios Ghalanos
• cran.r-project.org/web/packages/rugarch/vignettes/Introduction to the rugarch package.pdf
• cran.r-project.org/web/packages/rugarch/rugarch.pdf
• Provides useful plots (try plotting the result)
• And useful information when printing result
Financial Risk Forecasting © 2011-2021 Jon Danielsson, page 96 of 145
Simple ARCH GARCH Extensions ML Code Sim Diagnosis Alt Sum Covid
Specifying models with rugarch
• There are a large number of GARCH type models and specification
• rugarch separates out model specification and estimation
• ugarchspec creates model, some common options are• variance.model• mean.model• distribution.model
• See next slide
• Then model is estimated with ugarchfit
• It returns a structure with estimated parameters, fitted volatility, log likelihoodand other useful results
Financial Risk Forecasting © 2011-2021 Jon Danielsson, page 97 of 145
Simple ARCH GARCH Extensions ML Code Sim Diagnosis Alt Sum Covid
variance.model
• List containing the variance model specification
• Standard GARCH is ’sGARCH” (default). Some others ”apARCH”
• garchOrder The ARCH and GARCH orders (lags)
• external.regressors
• variance.targeting
• variance.model = list( garchOrder = c(1, 1))
Financial Risk Forecasting © 2011-2021 Jon Danielsson, page 98 of 145
Simple ARCH GARCH Extensions ML Code Sim Diagnosis Alt Sum Covid
mean.model
• List containing the mean model specification
• It is possible to make it a constant or use a more rich model
• For our purposes, we just tell the code not to do it
• mean.model = list( armaOrder = c(0,0),include.mean = FALSE))
Financial Risk Forecasting © 2011-2021 Jon Danielsson, page 99 of 145
Simple ARCH GARCH Extensions ML Code Sim Diagnosis Alt Sum Covid
distribution.model
• The conditional density to use for the innovations
• The default is ”norm” for the normal distibution
• We also use ”std” for the student-t
• But there are many others that could be used
• distribution.model = "std"
Financial Risk Forecasting © 2011-2021 Jon Danielsson, page 100 of 145
Simple ARCH GARCH Extensions ML Code Sim Diagnosis Alt Sum Covid
R estimation with rugarch
Same SP-500 10,000 observations. 1980-11-12 - 2020-07-09
l i b r a r y ( r uga r ch )
spec1 = uga rch spec ( v a r i a n c e . model = l i s t ( ga rchOrder = c (1 , 1 ) ) ,mean . model = l i s t ( armaOrder = c (0 , 0 ) , i n c l u d e . mean = FALSE ) )
r e s 1 = u g a r c h f i t ( spec = spec1 , data = y )
spec2 = uga rch spec ( v a r i a n c e . model = l i s t ( ga rchOrder = c (1 , 0 ) ) ,mean . model = l i s t ( armaOrder = c (0 , 0 ) , i n c l u d e . mean = FALSE ) )
r e s 2 = u g a r c h f i t ( spec = spec2 , data = y )
spec3 = uga rch spec ( v a r i a n c e . model = l i s t ( ga rchOrder = c (1 , 1 ) ) ,mean . model = l i s t ( armaOrder = c (0 , 0 ) , i n c l u d e . mean = FALSE) ,d i s t r i b u t i o n . model = ” s td ” )
r e s 3 = u g a r c h f i t ( spec = spec3 , data = y )
p l o t ( r e s 3 )
Financial Risk Forecasting © 2011-2021 Jon Danielsson, page 101 of 145
Simple ARCH GARCH Extensions ML Code Sim Diagnosis Alt Sum Covid
Choosing optimizers
• rugarch allows us to choose optimizers. Try (see the 1,0 in garchOrder)
spec4 = uga rch spec ( v a r i a n c e . model = l i s t ( ga rchOrder = c (1 , 0 ) ) ,mean . model = l i s t ( armaOrder = c (0 , 0 ) , i n c l u d e . mean = FALSE) ,d i s t r i b u t i o n . model = ” s td ” )r e s 4 = u g a r c h f i t ( spec = spec4 , data = y )
Warning message: In .sgarchfit(spec = spec, data = data, out.sample
= out.sample, : ugarchfit-->warning: solver failer to converge.
• But
r e s 4 = u g a r c h f i t ( spec = spec4 , data = y , s o l v e r=” hyb r i d ” )
• Works
• The “hybrid” strategy solver first tries the “solnp” solver, in failing to convergetries “nlminb”, then “gosolnp” and finally “nloptr” solvers
Financial Risk Forecasting © 2011-2021 Jon Danielsson, page 102 of 145
Simple ARCH GARCH Extensions ML Code Sim Diagnosis Alt Sum Covid
Simulation analysis of GARCH models
• We use thousand observations of the S&P 500
• First, estimate a normal GARCH model and include the mean effects
Financial Risk Forecasting © 2011-2021 Jon Danielsson, page 103 of 145
Simple ARCH GARCH Extensions ML Code Sim Diagnosis Alt Sum Covid
SP-500
2017 2018 2019 2020
2200240026002800300032003400
2017 2018 2019 2020
−0.10
−0.05
0.00
0.05
Financial Risk Forecasting © 2011-2021 Jon Danielsson, page 104 of 145
Simple ARCH GARCH Extensions ML Code Sim Diagnosis Alt Sum Covid
SP-500 with 1 simulation
2017 2018 2019 2020
2200
2400
2600
2800
3000
3200
3400
2017 2018 2019 2020
−0.10
−0.05
0.00
0.05
2021 2022 2023 2024
3000
4000
5000
6000
7000
8000
9000
10000
2021 2022 2023 2024
−0.04
−0.02
0.00
0.02
0.04
Financial Risk Forecasting © 2011-2021 Jon Danielsson, page 105 of 145
Simple ARCH GARCH Extensions ML Code Sim Diagnosis Alt Sum Covid
Summary
• The simulated data looks quite different from the true data
• Of course, it should be different but what we’re looking for is the dynamicpatterns in it
• Booms and busts
• Volatility clusters
• The following plot shows 10 simulations
Financial Risk Forecasting © 2011-2021 Jon Danielsson, page 106 of 145
Simple ARCH GARCH Extensions ML Code Sim Diagnosis Alt Sum Covid
SP-500 with 10 simulations
2021 2022 2023 2024
2000
4000
6000
8000
10000
12000
14000
zoo(s
imp, ord
er.
by =
d)
Financial Risk Forecasting © 2011-2021 Jon Danielsson, page 107 of 145
Simple ARCH GARCH Extensions ML Code Sim Diagnosis Alt Sum Covid
10 parameter estimates from true and simulated data, Normal
ω α β
True 3.8e-06 0.218 0.7522 3.9e-06 0.272 0.7273 4e-06 0.273 0.7014 4.1e-06 0.281 0.7185 2.8e-06 0.224 0.7536 4.2e-06 0.246 0.7167 3.1e-06 0.26 0.7258 4.6e-06 0.271 0.7039 2.4e-06 0.18 0.79810 4.9e-06 0.257 0.71211 6.9e-06 0.242 0.687
Financial Risk Forecasting © 2011-2021 Jon Danielsson, page 108 of 145
Simple ARCH GARCH Extensions ML Code Sim Diagnosis Alt Sum Covid
10 parameter estimates from true and simulated data, t-garch
ω α β ν
True 2.2e-06 0.2 0.799 4.1182 1.5e-06 0.19 0.809 3.9013 2.2e-06 0.231 0.768 4.7734 3.2e-06 0.252 0.735 4.3175 2e-06 0.204 0.777 5.1286 2.8e-06 0.192 0.807 4.1397 2.1e-06 0.18 0.796 5.1858 9e-07 0.117 0.881 3.9289 2e-06 0.179 0.81 4.69310 2.1e-06 0.237 0.762 4.3211 2.1e-06 0.261 0.738 4.743
Financial Risk Forecasting © 2011-2021 Jon Danielsson, page 109 of 145
Simple ARCH GARCH Extensions ML Code Sim Diagnosis Alt Sum Covid
Diagnosing Volatility Models
Financial Risk Forecasting © 2011-2021 Jon Danielsson, page 110 of 145
Simple ARCH GARCH Extensions ML Code Sim Diagnosis Alt Sum Covid
Diagnosing volatility models
• Ideally we would want to know how a model performs operationally
• But usually we have to make do with an in–sample comparison
• In out–of–sample forecast comparisons, more parsimonious models perform bettereven if more flexible model is significantly better in–sample
• If more flexible model performs better in sample, it is unlikely to perform betterout of sample
Financial Risk Forecasting © 2011-2021 Jon Danielsson, page 111 of 145
Simple ARCH GARCH Extensions ML Code Sim Diagnosis Alt Sum Covid
Alternatives
1. Likelihood ratio tests
2. Residual analysis
• Do not confuse the discussion here with backtesting as presented later in the book
Financial Risk Forecasting © 2011-2021 Jon Danielsson, page 112 of 145
Simple ARCH GARCH Extensions ML Code Sim Diagnosis Alt Sum Covid
Likelihood ratio test
• Consider two models, where one is nested inside the other
• That is, one is a strict subset of the other
• Like ARCH(1) is a subset of GARCH(1,1)
• Is the same as a standard t-test for one parameter
• But also allows testing of multiple parameters
• Call the nested model restricted (R) and the other unrestricted (U)
• By definitionlogLR ≤ logLU
Financial Risk Forecasting © 2011-2021 Jon Danielsson, page 113 of 145
Simple ARCH GARCH Extensions ML Code Sim Diagnosis Alt Sum Covid
Likelihood ratios
0 50 100 150 200
0
2
4
6
8
parameter value
log lik
elih
ood
Financial Risk Forecasting © 2011-2021 Jon Danielsson, page 114 of 145
Simple ARCH GARCH Extensions ML Code Sim Diagnosis Alt Sum Covid
Likelihood ratios
0 50 100 150 200
0
2
4
6
8
parameter value
log lik
elih
ood
restricted
unrestricted
Financial Risk Forecasting © 2011-2021 Jon Danielsson, page 115 of 145
Simple ARCH GARCH Extensions ML Code Sim Diagnosis Alt Sum Covid
Likelihood ratios
0 50 100 150 200
0
2
4
6
8
parameter value
log lik
elih
ood
restricted
unrestricted
Financial Risk Forecasting © 2011-2021 Jon Danielsson, page 116 of 145
Simple ARCH GARCH Extensions ML Code Sim Diagnosis Alt Sum Covid
Likelihood ratios
0 50 100 150 200
0
2
4
6
8
parameter value
log lik
elih
ood
logLU − logLR
restricted
unrestricted
Financial Risk Forecasting © 2011-2021 Jon Danielsson, page 117 of 145
Simple ARCH GARCH Extensions ML Code Sim Diagnosis Alt Sum Covid
Likelihood ratio test
• 2 times the difference between the unrestricted and restricted likelihoods is χ2
distributed
• The degrees of freedom is equal to the number of restrictions
LR = 2(LU − LR)∼ χ2(number of restrictions)
qch i s q ( p=1−0.05 , d f=1)3 .841459
Financial Risk Forecasting © 2011-2021 Jon Danielsson, page 118 of 145
Simple ARCH GARCH Extensions ML Code Sim Diagnosis Alt Sum Covid
χ2 in R
x=seq ( 0 . 0 , 9 , by=0.1)p l o t ( x , d ch i s q ( x , 3 ) , t ype=’ l ’ )p l o t ( x , p ch i s q ( x , 3 ) , t ype=’ l ’ )p l o t ( x , d ch i s q ( x , 1 ) , t ype=’ l ’ )p l o t ( x , p ch i s q ( x , 1 ) , t ype=’ l ’ )
Financial Risk Forecasting © 2011-2021 Jon Danielsson, page 119 of 145
Simple ARCH GARCH Extensions ML Code Sim Diagnosis Alt Sum Covid
Compare GARCH(1,1) to ARCH(1)
SP-500 10,000 observations 1980-11-12 - 2020-07-09
spec0 = uga rch spec ( v a r i a n c e . model = l i s t ( ga rchOrder = c (1 , 0 ) ) ,mean . model = l i s t ( armaOrder = c (0 , 0 ) , i n c l u d e . mean = FALSE ) )
r e s 0 = u g a r c h f i t ( spec = spec0 , data = y , s o l v e r=” hyb r i d ” )l i k e l i h o o d ( r e s 0 )
spec1 = uga rch spec ( v a r i a n c e . model = l i s t ( ga rchOrder = c (1 , 1 ) ) ,mean . model = l i s t ( armaOrder = c (0 , 0 ) , i n c l u d e . mean = FALSE ) )
r e s 1 = u g a r c h f i t ( spec = spec1 , data = y , s o l v e r=” hyb r i d ” )l i k e l i h o o d ( r e s 1 )
LR=2 ∗ ( l i k e l i h o o d ( r e s 1 )− l i k e l i h o o d ( r e s 0 ) )LR740.9976pva l u e=1−pch i s q (LR , 1 )pva l u e0
Financial Risk Forecasting © 2011-2021 Jon Danielsson, page 120 of 145
Simple ARCH GARCH Extensions ML Code Sim Diagnosis Alt Sum Covid
Sample tests
Unrestricted Restricted TestARCH(4) ARCH(1) H0 : α2 = α3 = α4 = 0GARCH(1,1) ARCH(1) H0 : β = 0GARCH(2,2) GARCH(1,1) H0 : β2 = α2 = 0APARCH GARCH H0 : δ = 2, ζ = 0
Financial Risk Forecasting © 2011-2021 Jon Danielsson, page 121 of 145
Simple ARCH GARCH Extensions ML Code Sim Diagnosis Alt Sum Covid
SP-500 10,000 observations 1980-11-12 - 2020-07-09
Model ω α β ζ δ ν likARCH(1) 0.0000861 0.325 31347
GARCH(1,1) 0.0000018 0.095 0.891 32693tGARCH(1,1) 0.0000010 0.079 0.915 5.926 33012
APGARCH(1,1) 0.0000001 0.06 0.889 0.352 2.573 32794
The tGARCH it is significantly the best model, followed by the APGARCH. However, itmight be worthwhile to estimate a tAPGARCH, which might be significantly betterthan the others.
Financial Risk Forecasting © 2011-2021 Jon Danielsson, page 122 of 145
Simple ARCH GARCH Extensions ML Code Sim Diagnosis Alt Sum Covid
Residual analysis
• Test if a single model is correctly specified
• Is based on the residuals (innovations) of the estimated model being what wasassumed in the model specification
• For example, for a normal GARCH are the residuals iid normal
Financial Risk Forecasting © 2011-2021 Jon Danielsson, page 123 of 145
Simple ARCH GARCH Extensions ML Code Sim Diagnosis Alt Sum Covid
Residual analysis of GARCH(1,1)
• Returns have a distribution (here assumed to be normal)
Yt ∼N (0, σ2t )
Yt =σtǫt , ǫt ∼ N (0, 1)
σ2t =ω + αY 2
t−1 + βσ2t−1
ǫ̂t =ytσ̂t
• Can test the estimated residuals ǫ̂ with a Jarque-Bera test for normality andLjung-Box test for autocorrelation of ǫ̂ and ǫ̂2. Can also do a QQ plot for ǫ̂
Financial Risk Forecasting © 2011-2021 Jon Danielsson, page 124 of 145
Simple ARCH GARCH Extensions ML Code Sim Diagnosis Alt Sum Covid
Residual tests in R
r e s i d u a l s ( r e s 1 )
Box . t e s t ( r e s i d u a l s ( r e s 1 ) , l a g = 20 ,type = c ( ”Ljung−Box” ) )
l i b r a r y ( t s e r i e s )j a r q u e . be ra . t e s t ( r e s i d u a l s ( r e s 1 ) )l i b r a r y ( ca r )qqPlot ( r e s i d u a l s ( r e s 1 ) )qqPlot ( r e s i d u a l s ( r e s 1 ) , d i s t r i b u t i o n=” t ” , d f=4)
Financial Risk Forecasting © 2011-2021 Jon Danielsson, page 125 of 145
Simple ARCH GARCH Extensions ML Code Sim Diagnosis Alt Sum Covid
S&P500 value
2006 2008 2010 2012 2014
1000
1500
2000
Financial Risk Forecasting © 2011-2021 Jon Danielsson, page 126 of 145
Simple ARCH GARCH Extensions ML Code Sim Diagnosis Alt Sum Covid
S&P500 return
2006 2008 2010 2012 2014
−10 %
−5 %
0 %
5 %
10 %
Financial Risk Forecasting © 2011-2021 Jon Danielsson, page 127 of 145
Simple ARCH GARCH Extensions ML Code Sim Diagnosis Alt Sum Covid
Conditional volatility
2006 2008 2010 2012 2014
1 %
2 %
3 %
4 %
5 %
Financial Risk Forecasting © 2011-2021 Jon Danielsson, page 128 of 145
Simple ARCH GARCH Extensions ML Code Sim Diagnosis Alt Sum Covid
Conditional volatility and returnsReturns and ±2× σt
2006 2008 2010 2012 2014
−10 %
−5 %
0 %
5 %
10 %
Financial Risk Forecasting © 2011-2021 Jon Danielsson, page 129 of 145
Simple ARCH GARCH Extensions ML Code Sim Diagnosis Alt Sum Covid
QQ plot of residuals
−3 −2 −1 0 1 2 3
−10
−5
0
5
10
Financial Risk Forecasting © 2011-2021 Jon Danielsson, page 130 of 145
Simple ARCH GARCH Extensions ML Code Sim Diagnosis Alt Sum Covid
ACF of squared residuals
0 5 10 15 20 25 30
−6 %
−3 %
0 %
3 %
6 %
Financial Risk Forecasting © 2011-2021 Jon Danielsson, page 131 of 145
Simple ARCH GARCH Extensions ML Code Sim Diagnosis Alt Sum Covid
Residual analysis
ǫ̂t =ytσ̂t
• Jarque-Bera test for normality and Ljung-Box test for autocorrelation
Model Jarque-Bera test Ljung-Box test (20 squared lags)ARCH(1) 0.00 0.00ARCH(4) 0.00 0.00GARCH(4,1) 0.00 0.99GARCH(1,1) 0.00 0.53
Financial Risk Forecasting © 2011-2021 Jon Danielsson, page 132 of 145
Simple ARCH GARCH Extensions ML Code Sim Diagnosis Alt Sum Covid
Alternative volatility models
Financial Risk Forecasting © 2011-2021 Jon Danielsson, page 133 of 145
Simple ARCH GARCH Extensions ML Code Sim Diagnosis Alt Sum Covid
Realized Volatility
• Based on taking intraday data, sampled at regular intervals and using them toobtain covariance matrix
• Pros• Purely data driven and no reliance on parametric methods
• Cons• Intraday data must be available, data is difficult to obtain, hard to use and not very
clean and expensive• Intraday data has complicated patterns that have to be addressed
Financial Risk Forecasting © 2011-2021 Jon Danielsson, page 134 of 145
Simple ARCH GARCH Extensions ML Code Sim Diagnosis Alt Sum Covid
Implied volatility
• Black Scholes (BS) equation
price = BS(T , r , S ,X , σ)
• Volatility implied by the price
σ = BS−1(T , r , S ,X , price)
• Based on current market prices and not historical data
• Depends critically on accuracy of BS model (constant volatility and normalinnovations)
Financial Risk Forecasting © 2011-2021 Jon Danielsson, page 135 of 145
Simple ARCH GARCH Extensions ML Code Sim Diagnosis Alt Sum Covid
VIX
• From the Chicago Board Options Exchange (CBOE)
• Volatility Index — VIX
• It captures the annualized one month volatility of the S&P-500
• Similar to implied volatilities
• It is known as the Fear Index of the financial markets
• And even has inspired a thriller by Robert Harris with the same title
• The following figure shows the VIX along with key market events
Financial Risk Forecasting © 2011-2021 Jon Danielsson, page 136 of 145
Simple ARCH GARCH Extensions ML Code Sim Diagnosis Alt Sum Covid
VIX
1990 1995 2000 2005 2010 2015 2020
20
40
60
80
Financial Risk Forecasting © 2011-2021 Jon Danielsson, page 137 of 145
Simple ARCH GARCH Extensions ML Code Sim Diagnosis Alt Sum Covid
GARCH and VIX on SP-500
2019 2020
20
40
60
80
100
120
140GARCH
VIX
Financial Risk Forecasting © 2011-2021 Jon Danielsson, page 138 of 145
Simple ARCH GARCH Extensions ML Code Sim Diagnosis Alt Sum Covid
Summary
Financial Risk Forecasting © 2011-2021 Jon Danielsson, page 139 of 145
Simple ARCH GARCH Extensions ML Code Sim Diagnosis Alt Sum Covid
Summary
• It is not possible to measure volatility
• Instead, it has to be inferred from observed data
• Using some sort of model
• And that means there are multiple alternative ways to measure volatility
• And it can be very hard to discriminate between them
Financial Risk Forecasting © 2011-2021 Jon Danielsson, page 140 of 145
Simple ARCH GARCH Extensions ML Code Sim Diagnosis Alt Sum Covid
SP-500 ACF with and without 2020
2017 2018 2019 2020
20002200240026002800300032003400
2016−03−07 to 2020−02−25
2017 2018 2019 2020
−0.10
−0.05
0.00
0.05
0.102016−03−07 to 2020−02−25
2017 2018 2019 2020
2200
2400
2600
2800
3000
3200
34002016−07−28 to 2020−07−17
2017 2018 2019 2020
−0.10
−0.05
0.00
0.05
0.102016−07−28 to 2020−07−17
Financial Risk Forecasting © 2011-2021 Jon Danielsson, page 141 of 145
Simple ARCH GARCH Extensions ML Code Sim Diagnosis Alt Sum Covid
SP-500
0 5 10 15 20 25 30
−0.3−0.2−0.1
0.00.10.20.3
Lag
acf(
y)
0 5 10 15 20 25 30
0.00.10.20.30.40.50.6
Lag
acf(
y^2
)
0 5 10 15 20 25 30
−0.3−0.2−0.1
0.00.10.20.3
Lag
acf(
y)
0 5 10 15 20 25 30
0.00.10.20.30.40.50.6
Lag
acf(
y^2
)
Financial Risk Forecasting © 2011-2021 Jon Danielsson, page 142 of 145
Simple ARCH GARCH Extensions ML Code Sim Diagnosis Alt Sum Covid
GARCH analysis
• Consider the normal and student to GARCH
• When we include and exclude the crisis period
• The outcome is exactly what we would expect
Financial Risk Forecasting © 2011-2021 Jon Danielsson, page 143 of 145
Simple ARCH GARCH Extensions ML Code Sim Diagnosis Alt Sum Covid
SP-500
2016-02-22 to 2020-02-10ω α β ν α+ β Half
4.6e-06 0.19 0.73 0.93 92.7e-06 0.19 0.79 4.24 0.97 27
2016-07-14 to 2020-07-02ω α β ν α+ β Half
3.7e-06 0.22 0.75 0.97 232.1e-06 0.22 0.80 3.86 1.02 NA
Why do you think the half-life is NA for the student-t?
Financial Risk Forecasting © 2011-2021 Jon Danielsson, page 144 of 145
Simple ARCH GARCH Extensions ML Code Sim Diagnosis Alt Sum Covid
News impact (normal GARCH)
−0.3 −0.2 −0.1 0.0 0.1 0.2 0.3
0.000
0.005
0.010
0.015
Shock
2016−02−18 to 2020−02−06
2016−07−12 to 2020−06−30
Financial Risk Forecasting © 2011-2021 Jon Danielsson, page 145 of 145
Simple ARCH GARCH Extensions ML Code Sim Diagnosis Alt Sum Covid
SP-500
−3 −2 −1 0 1 2 3
−0.04
−0.02
0.00
0.02
0.04
Sam
ple
quantile
s 720
496
2016−02−18 to 2020−02−06
Theoretical quantiles normal
−10 −5 0 5 10
−0.04
−0.02
0.00
0.02
0.04720
496
Theoretical quantiles t(3)
−3 −2 −1 0 1 2 3
−0.10
−0.05
0.00
0.05
926924
2016−07−12 to 2020−06−30
−10 −5 0 5 10
−0.10
−0.05
0.00
0.05
926924