financial econometric models iv
TRANSCRIPT
vinz
jean
nin@
hotm
ail.c
om
Financial Econometric ModelsVincent JEANNIN – ESGF 5IFM
Q1 2012
1
ESG
F 5I
FM Q
1 20
12
vinz
jean
nin@
hotm
ail.c
om
2
Summary of the session (Est. 3h)
• Interim Exam Sum Up• Reminder of Last Session• Generic case AR, MA, ARMA & ARIMA• Heteroscedasticity: Introduction
ESG
F 5I
FM Q
1 20
12
vinz
jean
nin@
hotm
ail.c
om
Interim Exam Sum-Up
3
ESG
F 4I
FM Q
1 20
12
𝑦=𝑎∗ ln (𝑥 )+𝑏+𝜀
1
vinz
jean
nin@
hotm
ail.c
om
4
ESG
F 5I
FM Q
1 20
12
Two parameters to estimate:• Intercept α• Gradient β
Minimising residuals
𝐸=∑𝑖=1
𝑛
𝜀𝑖❑2=∑
𝑖=1
𝑛
(𝑦 𝑖− (𝑎∗ ln (𝑥𝑖)+𝑏))2
When E is minimal?
When partial derivatives i.r.w. a and b are 0
Attention, logarithms are not additive!
vinz
jean
nin@
hotm
ail.c
om
5
ESG
F 5I
FM Q
1 20
12
ln (𝑎+𝑏 )≠ln (𝑎)+ ln (𝑏)
ln (∑ 𝑥𝑖 )≠𝑛 ln (𝑥 )Solution?
Change the variable Z=ln(X)
𝐸=∑𝑖=1
𝑛
𝜀𝑖❑2=∑
𝑖=1
𝑛
(𝑦 𝑖− (𝑎∗ 𝑧𝑖+𝑏))2
vinz
jean
nin@
hotm
ail.c
om
6
ESG
F 4I
FM Q
1 20
12
𝑎∗∑𝑖=1
𝑛
𝑧 𝑖+𝑛𝑏=∑𝑖=1
𝑛
𝑦 𝑖
Leads easily to the intercept
𝑎𝑛𝑧+𝑛𝑏=𝑛𝑦
𝑎𝑧+𝑏=𝑦
𝜕𝐸𝜕𝑏
𝑏=𝑦−𝑎𝑧
( 𝑦 𝑖−𝑎𝑥 𝑖−𝑏 )2=𝑦 𝑖2−2𝑎𝑧 𝑖 𝑦 𝑖−2𝑏𝑦 𝑖+𝑎
2𝑧 𝑖2+2𝑎𝑏𝑧 𝑖+𝑏
2
vinz
jean
nin@
hotm
ail.c
om
7
ESG
F 5I
FM Q
1 20
12
𝜕𝐸𝜕𝑎
=∑𝑖=1
𝑛
−2 𝑧𝑖 𝑦 𝑖+2𝑎𝑧𝑖❑2+2𝑏𝑧 𝑖=0
y=𝑎𝑧+ 𝑦−𝑎𝑧
y − 𝑦=𝑎(𝑧 −𝑧)
𝑏=𝑦−𝑎𝑧
∑𝑖=1
𝑛
𝑧 𝑖 (𝑦 𝑖−𝑎𝑧 𝑖❑−𝑏)=0
𝜕𝐸𝜕𝑏
=∑𝑖=1
𝑛
−2 𝑦 𝑖+2𝑏+2𝑎𝑧𝑖=0
∑𝑖=1
𝑛
𝑦 𝑖−𝑏−𝑎𝑧𝑖=0
∑𝑖=1
𝑛
𝑦 𝑖− 𝑦+𝑎𝑧−𝑎𝑧 𝑖=0
∑𝑖=1
𝑛
(𝑦 𝑖− 𝑦 )−𝑎(𝑧𝑖− 𝑧)=0
∑𝑖=1
𝑛
𝑧 𝑖 (𝑦 𝑖−𝑎𝑧 𝑖❑− 𝑦+𝑎𝑧 )=0
∑𝑖=1
𝑛
𝑧 𝑖(𝑦 𝑖−𝑦−𝑎 (𝑧 𝑖❑− 𝑧 ))=0
∑𝑖=1
𝑛
𝑧 (( 𝑦 𝑖− 𝑦 )−𝑎 (𝑧𝑖−𝑧 ))=0
vinz
jean
nin@
hotm
ail.c
om
8
ESG
F 5I
FM Q
1 20
12
∑𝑖=1
𝑛
𝑧 𝑖(𝑦 𝑖−𝑦−𝑎 (𝑧 𝑖❑− 𝑧 ))=0 ∑
𝑖=1
𝑛
𝑧 (( 𝑦 𝑖− 𝑦 )−𝑎 (𝑧𝑖−𝑧 ))=0
∑𝑖=1
𝑛
𝑧 𝑖(𝑦 𝑖−𝑦−𝑎 (𝑧 𝑖❑− 𝑧 ))=∑
𝑖=1
𝑛
𝑧 (( 𝑦 𝑖−𝑦 )−𝑎 ( 𝑧𝑖−𝑧 ))
∑𝑖=1
𝑛
𝑧 𝑖(𝑦 𝑖−𝑦−𝑎 (𝑧 𝑖❑− 𝑧 ))−∑
𝑖=1
𝑛
𝑧 (( 𝑦 𝑖− 𝑦 )−𝑎 (𝑧𝑖−𝑧 ))=0
∑𝑖=1
𝑛
(𝑧¿¿ 𝑖−𝑧)(𝑦 𝑖−𝑦−𝑎 (𝑧 𝑖❑− 𝑧 ))=0¿
𝑎=∑𝑖=1
𝑛
(𝑧¿¿ 𝑖− 𝑧)(𝑦 𝑖− 𝑦 )
∑𝑖=1
𝑛
(𝑧 ¿¿ 𝑖−𝑧)2¿¿
Finally…
We have
and
vinz
jean
nin@
hotm
ail.c
om
9
ESG
F 5I
FM Q
1 20
12
𝑎=∑𝑖=1
𝑛
(𝑧¿¿ 𝑖− 𝑧)(𝑦 𝑖− 𝑦 )
∑𝑖=1
𝑛
(𝑧 ¿¿ 𝑖−𝑧)2¿¿ 𝑏=𝑦−𝑎𝑧
Don’t forget…
Z=ln(X)
vinz
jean
nin@
hotm
ail.c
om
10
ESG
F 5I
FM Q
1 20
12
No forecast possible (one particular stock against the market)
Hedging is linear…
Accept or reject the regression?
Check correlation and R Squared
Check the normality of residuals
vinz
jean
nin@
hotm
ail.c
om
11
ESG
F 5I
FM Q
1 20
12
vinz
jean
nin@
hotm
ail.c
om
12
ESG
F 5I
FM Q
1 20
12𝑦=7.5𝑥=9
𝑦=3+0.5 𝑥𝑟=0.82𝑅2=0.67
For every dataset of the Quarter
Ultimate decider is the normality test on the residuals
vinz
jean
nin@
hotm
ail.c
om
13
ESG
F 5I
FM Q
1 20
12
2
Identify
Fit
Forecast
Trend
Seasonality
Residual
vinz
jean
nin@
hotm
ail.c
om
14
ESG
F 5I
FM Q
1 20
12
ACF = Auto Correlation in the series
Lag 0, Auto Correlation is 1 𝜌 (𝑋 𝑡 ,𝑋 𝑡)
Lag 1 𝜌 (𝑋 𝑡 ,𝑋 𝑡− 1)
Lag 2 𝜌 (𝑋 𝑡 ,𝑋 𝑡− 2)
Regression of the series against the same series retarded
vinz
jean
nin@
hotm
ail.c
om
15
ESG
F 4I
FM Q
1 20
12
vinz
jean
nin@
hotm
ail.c
om
16
ESG
F 4I
FM Q
1 20
12
PACF = Partial Auto Correlation in the series
Marginal Auto Correlation
Conditional Auto Correlation knowing the Auto Correlation at a lower order
vinz
jean
nin@
hotm
ail.c
om
17
ESG
F 5I
FM Q
1 20
12
3
vinz
jean
nin@
hotm
ail.c
om
18
ESG
F 5I
FM Q
1 20
12
vinz
jean
nin@
hotm
ail.c
om
19
ESG
F 5I
FM Q
1 20
12
vinz
jean
nin@
hotm
ail.c
om
20
ESG
F 5I
FM Q
1 20
12
AR(1)
vinz
jean
nin@
hotm
ail.c
om
Reminder of the last session
21
ESG
F 4I
FM Q
1 20
12
Reminders of the 3 steps
Identify
Fit
Forecast
Exploitation
Auto Correlation Analysis
Estimate the parameters
vinz
jean
nin@
hotm
ail.c
om
22
ESG
F 4I
FM Q
1 20
12
Reminders of the 3 components
Trend
Seasonality
Residual
∆ 𝑥𝑡=𝑥𝑡−𝑥𝑡 −1
∆30𝑥𝑡=𝑥𝑡−𝑥𝑡 −30
𝑁 (0.𝜎 )
vinz
jean
nin@
hotm
ail.c
om
23
ESG
F 4I
FM Q
1 20
12
There is a correlation between current data and previous data
Main principle
𝑋 𝑡=𝑐+𝜑1𝑋 𝑡 −1+𝜑2𝑋 𝑡 −2+…+𝜑𝑛 𝑋 𝑡−𝑛+𝜀𝑡
𝜑𝑛Parameters of the model
𝜀𝑛White noise
If the parameters are identified, the prediction will be easy
AR(n)
AR
vinz
jean
nin@
hotm
ail.c
om
24
ESG
F 4I
FM Q
1 20
12
vinz
jean
nin@
hotm
ail.c
om
25
ESG
F 4I
FM Q
1 20
12
vinz
jean
nin@
hotm
ail.c
om
26
ESG
F 4I
FM Q
1 20
12
vinz
jean
nin@
hotm
ail.c
om
27
ESG
F 4I
FM Q
1 20
12
ACF decreasing
PACF cancelling after order 1
vinz
jean
nin@
hotm
ail.c
om
28
ESG
F 4I
FM Q
1 20
12
Decreasing ACF
PACF cancel after order 1
Typically an Autoregressive Process
AR(1)
vinz
jean
nin@
hotm
ail.c
om
29
ESG
F 4I
FM Q
1 20
12
Modl<-ar(diff(DATA$Val),order.max=20)plot(Modl$aic)
Let’s try to fit an AR(1) model
The likelihood for the order 1 is significant
vinz
jean
nin@
hotm
ail.c
om
30
ESG
F 4I
FM Q
1 20
12
> ar(diff(DATA$Val),order.max=20)
Call:ar(x = diff(DATA$Val), order.max = 20)
Coefficients: 1 2 3 0.5925 -0.1669 0.1385
Order selected 3 sigma^2 estimated as 0.8514
We know the first term of our series
.
vinz
jean
nin@
hotm
ail.c
om
31
ESG
F 4I
FM Q
1 20
12
Need to test the residuals
Box.test(Modl$resid)
Box-Pierce test
data: Modl$resid X-squared = 7e-04, df = 1, p-value = 0.9789
H0 accepted, residuals are independently distributed (white noise)
The differentiated series is a AR(1)
vinz
jean
nin@
hotm
ail.c
om
32
ESG
F 4I
FM Q
1 20
12
Stationary series with auto correlation of errors
Main principle
𝑋 𝑡=𝜇+𝑍𝑡+𝜑1𝑍 𝑡−1+𝜑2𝑍 𝑡− 2+…+𝜑𝑛𝑍 𝑡−𝑛
𝜑𝑛Parameters of the model
𝑍𝑛White noise
More difficult to estimate than a AR(n)
MA(n)
MA
vinz
jean
nin@
hotm
ail.c
om
33
ESG
F 4I
FM Q
1 20
12
vinz
jean
nin@
hotm
ail.c
om
34
ESG
F 4I
FM Q
1 20
12
acf(Data,20)pacf(Data,20)
ACF & PACF suggest MA(1)
ACF cancels after order 1
PACF decays to 0
vinz
jean
nin@
hotm
ail.c
om
35
ESG
F 4I
FM Q
1 20
12
> Box.test(Rslt$residuals)
Box-Pierce test
data: Rslt$residuals X-squared = 0, df = 1, p-value = 0.9967
It works, MA(1), 0 mean, parameter -0.4621
> arima(Data, order = c(0, 0, 1),include.mean = FALSE)
Call:arima(x = Data, order = c(0, 0, 1), include.mean = FALSE)
Coefficients: ma1 -0.4621s.e. 0.0903
sigma^2 estimated as 0.937: log likelihood = -138.76, aic = 281.52
vinz
jean
nin@
hotm
ail.c
om
36
ESG
F 4I
FM Q
1 20
12
The series is a function of past values plus current and past values of the noise
Main principle
ARMA(p,q)
Combines AR(p) & MA(q)
ARMA
vinz
jean
nin@
hotm
ail.c
om
37
ESG
F 4I
FM Q
1 20
12
vinz
jean
nin@
hotm
ail.c
om
38
ESG
F 4I
FM Q
1 20
12
Both ACF and PACF decreases exponentially after order 1
vinz
jean
nin@
hotm
ail.c
om
39
ESG
F 5I
FM Q
1 20
12
Generic case AR, MA, ARMA & ARIMA
vinz
jean
nin@
hotm
ail.c
om
40
ESG
F 5I
FM Q
1 20
12
ARIMA(p,d,q), AutoRegressive Integrated Moving Average
Combines AR(p) & MA(q)
Non stationary… But can be removed with a differentiation of d
vinz
jean
nin@
hotm
ail.c
om
41
ESG
F 5I
FM Q
1 20
12
Non stationary
Typical ARIMA
vinz
jean
nin@
hotm
ail.c
om
42
ESG
F 5I
FM Q
1 20
12
Differentiation (d order)
Identification easier
MA(2)
vinz
jean
nin@
hotm
ail.c
om
43
ESG
F 5I
FM Q
1 20
12
Integration of the initial differentiation
If the d differentiation is an ARMA(p,q)
Original series is ARIMA(p,d,q)
vinz
jean
nin@
hotm
ail.c
om
44
ESG
F 5I
FM Q
1 20
12
Heteroscedasticity: Introduction
AR, MA, ARMA, ARIMA imply stationary series
When there is hetoroscedasticity, not applicable
Conditional heteroscedasticity is the answer
It assumes the current variance of residuals to be a function of the actual sizes of the previous time periods' residuals
vinz
jean
nin@
hotm
ail.c
om
45
ESG
F 5I
FM Q
1 20
12
ARCH(q)
AR (q) with heteroscedasticity
GARCH(p,q)
ARMA (p,q) with heteroscedasticity
vinz
jean
nin@
hotm
ail.c
om
46
ESG
F 5I
FM Q
1 20
12
Useful for financial series
Variance is very rarely stable