threshold cointegration in r with package tsdyn · pdf filethreshold cointegration in r with...
TRANSCRIPT
Threshold cointegration in Rwith package tsDyn
Matthieu StiglerMatthieu.Stigler at gmail.com
8 July 2009
National Institute for Public Finance and Policy, India
Agroscope, Federal Office for Agriculture, Switzerland
Matthieu Stigler Matthieu.Stigler at gmail.com ()Threshold cointegration in R with package tsDyn 8 July 2009 1 / 26
Outline
1 Cointegration (linear)
2 Threshold cointegration
3 Areas of application
4 Implementation in R
Matthieu Stigler Matthieu.Stigler at gmail.com ()Threshold cointegration in R with package tsDyn 8 July 2009 2 / 26
Outline
1 Cointegration (linear)
2 Threshold cointegration
3 Areas of application
4 Implementation in R
Matthieu Stigler Matthieu.Stigler at gmail.com ()Threshold cointegration in R with package tsDyn 8 July 2009 3 / 26
Background
Non-stationnary variables with unit root: I(1)
Spurious regression when I(1) regressed on I(1):I R2 → 1I Statistical dependance among independant variablesI Wrong conclusions!
Matthieu Stigler Matthieu.Stigler at gmail.com ()Threshold cointegration in R with package tsDyn 8 July 2009 4 / 26
Background
Non-stationnary variables with unit root: I(1)
Spurious regression when I(1) regressed on I(1):I R2 → 1I Statistical dependance among independant variablesI Wrong conclusions!
Matthieu Stigler Matthieu.Stigler at gmail.com ()Threshold cointegration in R with package tsDyn 8 July 2009 4 / 26
Cointegration
Definition (Cointegration (Engle, Granger 1982))
If two (or more) variables are non-stationary,but there exist a linear combination of them which is stationary,there are said to be cointegrated
Example
X and Y as I(1),Take Xt − aYt = εtX and Y cointegrated ⇔ ε is I(0)
Matthieu Stigler Matthieu.Stigler at gmail.com ()Threshold cointegration in R with package tsDyn 8 July 2009 5 / 26
Cointegration
Definition (Cointegration (Engle, Granger 1982))
If two (or more) variables are non-stationary,but there exist a linear combination of them which is stationary,there are said to be cointegrated
Example
X and Y as I(1),Take Xt − aYt = εtX and Y cointegrated ⇔ ε is I(0)
Matthieu Stigler Matthieu.Stigler at gmail.com ()Threshold cointegration in R with package tsDyn 8 July 2009 5 / 26
Interest of linear cointegration
Stable long-run relationship between random walk variables.
Error-correction mechanisms pushing deviations back towards thelong-run equilibirum.
Example (VECM model with cointegrated variables)(∆Xt∆Yt
)=(
0.02−0.01
)+(−0.01
0.08
)ECTt−1 + ( 0.04 0.02
0.31 0.07 )(
∆Xt−1
∆Yt−1
)Where ECT (error-correction term) represents deviationsfrom the long-run relationship ECTt−1 = Yt − bXt
Matthieu Stigler Matthieu.Stigler at gmail.com ()Threshold cointegration in R with package tsDyn 8 July 2009 6 / 26
Interest of linear cointegration
Stable long-run relationship between random walk variables.
Error-correction mechanisms pushing deviations back towards thelong-run equilibirum.
Example (VECM model with cointegrated variables)(∆Xt∆Yt
)=(
0.02−0.01
)+(−0.01
0.08
)ECTt−1 + ( 0.04 0.02
0.31 0.07 )(
∆Xt−1
∆Yt−1
)Where ECT (error-correction term) represents deviationsfrom the long-run relationship ECTt−1 = Yt − bXt
Matthieu Stigler Matthieu.Stigler at gmail.com ()Threshold cointegration in R with package tsDyn 8 July 2009 6 / 26
Interest of linear cointegration
Stable long-run relationship between random walk variables.
Error-correction mechanisms pushing deviations back towards thelong-run equilibirum.
Example (VECM model with cointegrated variables)(∆Xt∆Yt
)=(
0.02−0.01
)+(−0.01
0.08
)ECTt−1 + ( 0.04 0.02
0.31 0.07 )(
∆Xt−1
∆Yt−1
)Where ECT (error-correction term) represents deviationsfrom the long-run relationship ECTt−1 = Yt − bXt
Matthieu Stigler Matthieu.Stigler at gmail.com ()Threshold cointegration in R with package tsDyn 8 July 2009 6 / 26
Interest of linear cointegration
Stable long-run relationship between random walk variables.
Error-correction mechanisms pushing deviations back towards thelong-run equilibirum.
Example (VECM model with cointegrated variables)(∆Xt∆Yt
)=(
0.02−0.01
)+(−0.01
0.08
)ECTt−1 + ( 0.04 0.02
0.31 0.07 )(
∆Xt−1
∆Yt−1
)Whith ECTt−1 = Yt − bXt
Matthieu Stigler Matthieu.Stigler at gmail.com ()Threshold cointegration in R with package tsDyn 8 July 2009 7 / 26
The assumption of linearity
Implicit assumption: every small/big deviation from equilibirum leads toinstantaneous correction.
But economic theory suggests:
Transaction costs (no adjustment when: deviations < transactioncosts)
Stickiness of the price
Asymetries: +/− deviations don’t lead to same effect
Matthieu Stigler Matthieu.Stigler at gmail.com ()Threshold cointegration in R with package tsDyn 8 July 2009 8 / 26
The assumption of linearity
Implicit assumption: every small/big deviation from equilibirum leads toinstantaneous correction.
But economic theory suggests:
Transaction costs (no adjustment when: deviations < transactioncosts)
Stickiness of the price
Asymetries: +/− deviations don’t lead to same effect
Matthieu Stigler Matthieu.Stigler at gmail.com ()Threshold cointegration in R with package tsDyn 8 July 2009 8 / 26
Outline
1 Cointegration (linear)
2 Threshold cointegration
3 Areas of application
4 Implementation in R
Matthieu Stigler Matthieu.Stigler at gmail.com ()Threshold cointegration in R with package tsDyn 8 July 2009 9 / 26
The threshold autoregressive (TAR) model
Linear model:AR : εt = ρεt−1 + ut
Regime-specific dynamics in the Threshold Autoregressive (TAR) model:
TAR(2) : εt =
{ρLεt−1 + ut if εt−1 ≤ 0ρHεt−1 + ut if 0 ≤ εt−1
TAR(3) : εt =
ρLεt−1 + ut if εt−1 ≤ θL
ρMεt−1 + ut if θL ≤ εt−1 ≤ θH
ρHεt−1 + ut if θH ≤ εt−1
Stationarity condition:
|ρL| < 1, |ρH | < 1
|ρM | <∞ (non-stationarity of middle regime doesn’t affectstationarity of whole proces)
Matthieu Stigler Matthieu.Stigler at gmail.com ()Threshold cointegration in R with package tsDyn 8 July 2009 10 / 26
The threshold autoregressive (TAR) model
Linear model:AR : εt = ρεt−1 + ut
Regime-specific dynamics in the Threshold Autoregressive (TAR) model:
TAR(2) : εt =
{ρLεt−1 + ut if εt−1 ≤ 0ρHεt−1 + ut if 0 ≤ εt−1
TAR(3) : εt =
ρLεt−1 + ut if εt−1 ≤ θL
ρMεt−1 + ut if θL ≤ εt−1 ≤ θH
ρHεt−1 + ut if θH ≤ εt−1
Stationarity condition:
|ρL| < 1, |ρH | < 1
|ρM | <∞ (non-stationarity of middle regime doesn’t affectstationarity of whole proces)
Matthieu Stigler Matthieu.Stigler at gmail.com ()Threshold cointegration in R with package tsDyn 8 July 2009 10 / 26
The threshold autoregressive (TAR) model
Linear model:AR : εt = ρεt−1 + ut
Regime-specific dynamics in the Threshold Autoregressive (TAR) model:
TAR(2) : εt =
{ρLεt−1 + ut if εt−1 ≤ 0ρHεt−1 + ut if 0 ≤ εt−1
TAR(3) : εt =
ρLεt−1 + ut if εt−1 ≤ θL
ρMεt−1 + ut if θL ≤ εt−1 ≤ θH
ρHεt−1 + ut if θH ≤ εt−1
Stationarity condition:
|ρL| < 1, |ρH | < 1
|ρM | <∞ (non-stationarity of middle regime doesn’t affectstationarity of whole proces)
Matthieu Stigler Matthieu.Stigler at gmail.com ()Threshold cointegration in R with package tsDyn 8 July 2009 10 / 26
The threshold autoregressive (TAR) model
Linear model:AR : εt = ρεt−1 + ut
Regime-specific dynamics in the Threshold Autoregressive (TAR) model:
TAR(2) : εt =
{ρLεt−1 + ut if εt−1 ≤ 0ρHεt−1 + ut if 0 ≤ εt−1
TAR(3) : εt =
ρLεt−1 + ut if εt−1 ≤ θL
ρMεt−1 + ut if θL ≤ εt−1 ≤ θH
ρHεt−1 + ut if θH ≤ εt−1
Stationarity condition:
|ρL| < 1, |ρH | < 1
|ρM | <∞ (non-stationarity of middle regime doesn’t affectstationarity of whole proces)
Matthieu Stigler Matthieu.Stigler at gmail.com ()Threshold cointegration in R with package tsDyn 8 July 2009 10 / 26
0 50 100 150 200
−1.
0−
0.5
0.0
0.5
1.0
TAR with three regimes
Time
Mean reversion zone: ρρ == 0.4
Mean reversion zone: ρρ == 0.3
No mean reversion (random walk): ρρ == 1
Matthieu Stigler Matthieu.Stigler at gmail.com ()Threshold cointegration in R with package tsDyn 8 July 2009 11 / 26
Threshold cointegration
Definition (Threshold cointegration)
If two (or more) variables are I(1),but there exist a linear combination of them which is ”threshold stationary”,there are said to be ”threshold cointegrated”
Two main features:
Allows no-adjustment band
Allows asymetries: different +/- adjustment speeds (ρH 6= ρL)
Threshold effects in:
Long-run (LR) relationship
VECM
Matthieu Stigler Matthieu.Stigler at gmail.com ()Threshold cointegration in R with package tsDyn 8 July 2009 12 / 26
Threshold effects in the VECM
Linear case(∆Xt∆Yt
)=(
0.02−0.01
)+(−0.01
0.08
)ECTt−1 + ( 0.04 0.02
0.31 0.07 )(
∆Xt−1
∆Yt−1
)Threshold case
(∆Xt∆Yt
)=(
0.02−0.01
)+
( 0.22
1.09 ) ECT L−1(−0.01
0.02
)ECTM
−1(−0.030.09
)ECTH
−1
+(−0.10 0.04
0.02 −0.03
) (∆Xt−1
∆Yt−1
)Note:
I lags can also be regime specificI Same feature: adjustment band, asymetries
Matthieu Stigler Matthieu.Stigler at gmail.com ()Threshold cointegration in R with package tsDyn 8 July 2009 13 / 26
Threshold effects in the VECM
Linear case(∆Xt∆Yt
)=(
0.02−0.01
)+(−0.01
0.08
)ECTt−1 + ( 0.04 0.02
0.31 0.07 )(
∆Xt−1
∆Yt−1
)Threshold case
(∆Xt∆Yt
)=(
0.02−0.01
)+
( 0.22
1.09 ) ECT L−1(−0.01
0.02
)ECTM
−1(−0.030.09
)ECTH
−1
+(−0.10 0.04
0.02 −0.03
) (∆Xt−1
∆Yt−1
)Note:
I lags can also be regime specificI Same feature: adjustment band, asymetries
Matthieu Stigler Matthieu.Stigler at gmail.com ()Threshold cointegration in R with package tsDyn 8 July 2009 13 / 26
Threshold effects in the VECM
Linear case(∆Xt∆Yt
)=(
0.02−0.01
)+(−0.01
0.08
)ECTt−1 + ( 0.04 0.02
0.31 0.07 )(
∆Xt−1
∆Yt−1
)Threshold case
(∆Xt∆Yt
)=(
0.02−0.01
)+
( 0.22
1.09 ) ECT L−1(−0.01
0.02
)ECTM
−1(−0.030.09
)ECTH
−1
+(−0.10 0.04
0.02 −0.03
) (∆Xt−1
∆Yt−1
)Note:
I lags can also be regime specificI Same feature: adjustment band, asymetries
Matthieu Stigler Matthieu.Stigler at gmail.com ()Threshold cointegration in R with package tsDyn 8 July 2009 13 / 26
Outline
1 Cointegration (linear)
2 Threshold cointegration
3 Areas of application
4 Implementation in R
Matthieu Stigler Matthieu.Stigler at gmail.com ()Threshold cointegration in R with package tsDyn 8 July 2009 14 / 26
Areas of application
Macroeconomics questionsI Law of one price (LOP)I Purchasing power parityI Exchange rate pass-throughI Fisher effect: nominal interest rates and inflationI Usual macro: price, interest rate, income
Price transmission studiesI Vertically: market chains, numerous studies for agricultural products,
oilI Horizontally: market integration, similar to LOP
Financial marketsI Term interest theoryI Stock Prices and DividendsI Futures marketI Various arbitrage markets
Matthieu Stigler Matthieu.Stigler at gmail.com ()Threshold cointegration in R with package tsDyn 8 July 2009 15 / 26
Areas of application
Macroeconomics questionsI Law of one price (LOP)I Purchasing power parityI Exchange rate pass-throughI Fisher effect: nominal interest rates and inflationI Usual macro: price, interest rate, income
Price transmission studiesI Vertically: market chains, numerous studies for agricultural products,
oilI Horizontally: market integration, similar to LOP
Financial marketsI Term interest theoryI Stock Prices and DividendsI Futures marketI Various arbitrage markets
Matthieu Stigler Matthieu.Stigler at gmail.com ()Threshold cointegration in R with package tsDyn 8 July 2009 15 / 26
Areas of application
Macroeconomics questionsI Law of one price (LOP)I Purchasing power parityI Exchange rate pass-throughI Fisher effect: nominal interest rates and inflationI Usual macro: price, interest rate, income
Price transmission studiesI Vertically: market chains, numerous studies for agricultural products,
oilI Horizontally: market integration, similar to LOP
Financial marketsI Term interest theoryI Stock Prices and DividendsI Futures marketI Various arbitrage markets
Matthieu Stigler Matthieu.Stigler at gmail.com ()Threshold cointegration in R with package tsDyn 8 July 2009 15 / 26
Areas of application
Macroeconomics questionsI Law of one price (LOP)I Purchasing power parityI Exchange rate pass-throughI Fisher effect: nominal interest rates and inflationI Usual macro: price, interest rate, income
Price transmission studiesI Vertically: market chains, numerous studies for agricultural products,
oilI Horizontally: market integration, similar to LOP
Financial marketsI Term interest theoryI Stock Prices and DividendsI Futures marketI Various arbitrage markets
Matthieu Stigler Matthieu.Stigler at gmail.com ()Threshold cointegration in R with package tsDyn 8 July 2009 15 / 26
Outline
1 Cointegration (linear)
2 Threshold cointegration
3 Areas of application
4 Implementation in R
Matthieu Stigler Matthieu.Stigler at gmail.com ()Threshold cointegration in R with package tsDyn 8 July 2009 16 / 26
Implementation in R: package tsDyn
Testing
Estimation
Matthieu Stigler Matthieu.Stigler at gmail.com ()Threshold cointegration in R with package tsDyn 8 July 2009 17 / 26
Testing
●
●
Do we have linear cointegration?
Yes
H0: linear cointegration
HA: threshold cointegration
Matthieu Stigler Matthieu.Stigler at gmail.com ()Threshold cointegration in R with package tsDyn 8 July 2009 18 / 26
Testing
●
●
Do we have linear cointegration?
No Yes
H0: no cointegration
HA: threshold cointegration
H0: linear cointegration
HA: threshold cointegration
Matthieu Stigler Matthieu.Stigler at gmail.com ()Threshold cointegration in R with package tsDyn 8 July 2009 19 / 26
Testing
●
●
Do we have linear cointegration?
No Yes
H0: no cointegration
HA: threshold cointegration
H0: linear cointegration
HA: threshold cointegration
Interesting case
Case of no linear but threshold cointegration!
Matthieu Stigler Matthieu.Stigler at gmail.com ()Threshold cointegration in R with package tsDyn 8 July 2009 20 / 26
0 5 10 15 20 25
0.00
0.10
Ftest12
Den
sity
Test linear AR vs 1 threshold SETAR
Asymptotic Chi 2BootstrapTest value
0 10 20 30 40 50
0.00
0.04
0.08
Ftest13
Den
sity
Test linear AR vs 2 thresholds SETAR
Asymptotic Chi 2BootstrapTest value
Matthieu Stigler Matthieu.Stigler at gmail.com ()Threshold cointegration in R with package tsDyn 8 July 2009 21 / 26
Estimation of the threshold
Estimation: grid search in the range of all possible values
●●●●●●
●●
●●●●●
●●●●
●●
● ●
●●
●
●●
●●
●●
●
●
●
●
●
●●●● ●
●●
●
●
●
●
●
●
●
●
●
●
●
●●
●
●
●
●●
●●
●
●●
●
●
●
●●
●
●
●
●
●
500 1000 1500 2000 2500 3000
1.24e
+08
1.26e
+08
1.28e
+08
1.30e
+08
1.32e
+08
1.34e
+08
Threshold Value
SSR
Results of the grid search
●
●
●
Threshold Delay 0th 1
Matthieu Stigler Matthieu.Stigler at gmail.com ()Threshold cointegration in R with package tsDyn 8 July 2009 22 / 26
Summary
Threshold cointegration answers the following questions:
Is there a long-run relationship? (Generalization of linearcointegration)
Is there a no arbitrage band?
Are there asymmetries, different adjustment speeds when increase ordecrease?
Matthieu Stigler Matthieu.Stigler at gmail.com ()Threshold cointegration in R with package tsDyn 8 July 2009 23 / 26
Further readings
Package vignette
Working-paper: Threshold cointegration: overview andimplementation in R
Matthieu Stigler Matthieu.Stigler at gmail.com ()Threshold cointegration in R with package tsDyn 8 July 2009 24 / 26
Thank you.
Matthieu Stigler Matthieu.Stigler at gmail.com ()Threshold cointegration in R with package tsDyn 8 July 2009 25 / 26
If because of the stress I spoke to fast
...and have some time left:
Additional features:
Simulation of TAR, (T)VAR and (T)VECM
Other representations of output compared to vars
toLatex() function for VAR and VECm
Matthieu Stigler Matthieu.Stigler at gmail.com ()Threshold cointegration in R with package tsDyn 8 July 2009 26 / 26