Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
Forecasting
IMFx
This training material is the property of the International Monetary Fund (IMF) and is intended for use in IMF
I tit t ffor C
Institute Capacity
it D
Development
l t (ICD) courses. A
Any reuse requires
i ththe permission
i i off th
the ICD
ICD.
EViews® is a trademark of IHS Global Inc.
Evaluating Regression Models
Introduction
Model Evaluation: Introduction
• The
Th plan
l ffor thi
this module:
d l
• Linear regression model, “important assumptions”, “BLUE” properties (session1: introduction – today!)
• Model properties when one or more of the important assumptions do not hold (session 2)
• Consequences of:
• error term irregularities
g for forecastingg (session 3)
• of breaks for forecasting (session 4)
• Testing model residuals:
• for autocorrelation (session 5)
• testing model residuals for heteroskedasticity and normality (session 6)
• Testing for
f structurall b
breaks
k (session
( 7))
• Testing coefficient restrictions (session 8)
• Practicalities of dealing with error term irregularities and breaks (sessions 9 and 10)
Stages of Econometric Analysis
Economic Theory
Estimation
Model Evaluation/Diagnostic
NO YES
4
Linear Regression Model
• Linear
Li regression
i model:
d l
yt β0 β1 x1t ... βk xkt t
• or in a matrix form
Y Xβ
1 x11 ... xk 1
X ... ... ... ... ( 1 ,..., T ))'
1 x ... xkT
1T
5
Linear Regression
g Model: Important
p
Assumptions
• A1: Linear Relationship between Y and X
• A2: E{ t | X } 0
• A6: t | X ~ N 0,
2
6
Linear Regression Model: OLS
• Our
O ttask:
k estimate
ti t coefficients, fi d ˆ tto minimize
ffi i t ii.e. find i i i
T
SS
SSE
t 1
ˆt2 ˆ ' ˆ (Y X ˆ )' (Y X ˆ ),
)
• “Work-horse”
“W k h ” – ordinary
di lleastt squares, OLS-estimator:
OLS ti t
• f.o.c.:
foc:
SSE
2 X 'Y 2 X ' X ˆ 0
ˆ
• OLS
OLS-estimator
estimator of the parameters:
• Unbiased: E{ˆ}
• Estimator
• If,, additionally,
y, A6 (errors
( y) holds,, then ˆ | X ~ N , 2 ( X ' X ) 1
normality)
• … and
d A6 helps
h l a llot when
h we evaluate
l the
h properties
i off an estimated
i d model
d l
8
Linear Regression Model: “BLUE”
BLUE
(cont…)
• If A1-A6
A1 A6 hold:
hold
1
• We can estimate of the error variance using: ˆ
T k
2
t
t
ˆ 2
s.e.{ } ˆ X ' X
ˆ 1
2
• for forecasting performance and estimation of forecasting uncertainty (i.e. confidence bounds)
• Can proceed with hypothesis testing (e.g., coefficient restrictions or structural breaks)…
• … with better chances of test statistics have “correct” (and known) distributions
9
Hypothesis Test Example
• Regression: yt β0 β1 x1t ... βk xkt t
• If 1 0 then x1t can be excluded from the regression
• t-test statistic:
ˆ 1 1 ˆ 1 0 ˆ 1
t ˆ
s . e .{{ ˆ 1 } s . e .{{ ˆ 1 } s . e .{{ ˆ 1 }
10
Summary
• Assumptions A1 - A6 are important:
• In the
h next session:
• We
W check
h k the
th properties
ti off a regression
i model,
d l when
h some off A1
A1-A6
A6 do
d nott hold…
h ld
11
MFx – Macroeconomic
Forecasting
IMFx
This training material is the property of the International Monetary Fund (IMF) and is intended for use in IMF
I tit t ffor C
Institute Capacity
it D
Development
l t (ICD) courses. A
Any reuse requires
i ththe permission
i i off th
the ICD
ICD.
EViews® is a trademark of IHS Global Inc.
Evaluating Regression Models
Violation of Linear Regression
Assumptions
i
Part I
Model Properties when Some
Assumptions Do Not Hold
• In session 1:
• Linear regression model
• “Important
Important assumptions”
assumptions and “BLUE”
BLUE properties of the OLS-estimator
OLS estimator
• This session
session:
• Model properties when some important assumptions do not hold in the data
• EViews examples
A5 E{ | X } 0 for
• A5: '
t t s
f any t,
t s
• A6
A6: t | X ~ N 0, 2
• N
Note:
t
• A1 holds by construction
• A2 is easy to ensure – including intercept in your regression will do
• What is some of A3-A6
A3 A6 do not hold?...
4
What if A3
A3-A6
A6 Do Not Hold?
• A3. Some regressors X are correlated with errors: E{ X } 0 /
yt 1 xt 2 zt t
5
What if A3
A3-A6
A6 Do Not Hold (2)?
A4 Errors are autocorrelated: E { t s } 0 for some s
/
• A4. t
y t 1 x t t andd t t 1 t
Open
p p pagefile
g “m7_s2_autocorr_case01”,
_ _ _ equations
q “y_dgp”
y_ gp and “y_mod”
y_
6
What if A3
A3-A6
A6 Do Not Hold (3)?
A4 Errors are autocorrelated: E{ t s } 0 for some s
• A4. t
/
• Example 2,
2 lagged dependent variable:
y t 1 zt 2 y t 1 t and t t 1 t
• N
Note:
t yt is
i correlated
l t d with
ith εt (by
(b construction),
t ti ) th then yt-1 is
i also
l correlated
l t d with
ith εt-1, but
b t th
then yt-1 is
i
correlated with εt. This case is analogous to violation of A3
• ˆ is BIASED E { ˆ }
7
In part II of this session
• What
h if…
f
• A5 - constant error variance (homoskedasticity)
• A6 - normality
li
8
MFx – Macroeconomic
Forecasting
IMFx
This training material is the property of the International Monetary Fund (IMF) and is intended for use in IMF
I tit t ffor C
Institute Capacity
it D
Development
l t (ICD) courses. A
Any reuse requires
i ththe permission
i i off th
the ICD
ICD.
EViews® is a trademark of IHS Global Inc.
Evaluating Regression Models
Violation of Linear Regression
A
Assumptions
ti
Part II
What if A3-A6 Do Not Hold ?
Var { t } const
• A5. Errors are heteroskedastic: Va
β t t and
yt βx V { t } σ t2
d Var{ε
• t
2
i time
is i d
dependent,
d b
but, in
i general,l off unknown
k ffunctional
i l fform
• ˆ given
i b
by OLS iis still bi d E { ˆ }
till unbiased:
• BUT!!! ˆ is no longer efficient, i.e. has the smallest variance ( X ' X ) 1
ˆ 2
• Bad news: some tests statistics (e.g., t and F) do not have standard distributions in
small samples
• Good news:
1
• OLS-Eestimator ̂ 2
and ˆ
T k t
ˆt 2 are consistent (converge to their true values
in large samples)
• Can still implement inference: test statistics will have different (but known!) “asymptotic”
distributions (e.g., normal for t-stat.)
4
Next Steps
Steps…
5
MFx – Macroeconomic
Forecasting
IMFx
This training material is the property of the International Monetary Fund (IMF) and is intended for use in IMF
I tit t ffor C
Institute Capacity
it D
Development
l t (ICD) courses. A
Any reuse requires
i ththe permission
i i off th
the ICD
ICD.
EViews® is a trademark of IHS Global Inc.
Evaluating Regression Models
Consequences of error irregularities
f forecasting
for f ti
Part I
Consequences of error irregularities for forecasting
• Consequences of error…
• … autocorrelation
• … heteroskedasticity
• Multi-period
M li i d ahead
h d fforecast: C
Confidence
fid b
bounds
d and
d mean
4
Forecasting: 1 period ahead, repeated for 50
periods
• 1-period ahead forecasts (Expanding
( window strategy – see module 4))
• Split the sample:
• 950 observations to estimate both “incorrect” and “correct” models
“correct”
correct DGP model yt yˆt [1,950
ytˆ][z1,t951ˆ][z1,t952] tz
t , ˆt[1t,,950ˆ][t1t,951
,
tt
ˆ[t11,952
]
11 1t t1 t
] t 1
1 950 1000
.....
~ ~ ~
“incorrect”
incorrect model t []1z, 951
y t t [1y, 950
y t t] zt t t
t []1z, 952
5
F
Forecasting:
ti multi-period
lti i d fforecastt
• Multi-period forecast
• Split the sample:
• 950 observations to estimate both “incorrect” and “correct” models
• Analogy: inflation forecast over the next 8 quarters, starting from now
“correct”
correct DGP model yt ˆ[1,950] zt t , t ˆ[1,950] t 11 t
1 950 1000
.....
~
“incorrect”
incorrect model y t [1 , 950 ] z t t
6
Autocorrelation of errors in a linear regression model:
case 1
• True data generating process (generate
( 1000 obs.)) yt :
yt 0 .5 z t t t 0.8 t 1 t , t ~ N (0,1)
• Assume we neglect
g residual autocorrelation…
7
Autocorrelation of errors
errors, case 1: “incorrect”
incorrect model
and DGP
• …and we estimate an “incorrect” model:
yt zt t t ~ iid (0, )
2
• … while
h l ““correct”” ((DGP)) model
d l is
yt zt t t t 11 t
In EViews:
Please, have pagefile “m7_s3_Autocorr_case01” opened
Open and run “m7
m7_s3_autocorr_case01_application.prg
s3 autocorr case01 application.prg”
8
In the next part
part…
IMFx
This training material is the property of the International Monetary Fund (IMF) and is intended for use in IMF
I tit t ffor C
Institute Capacity
it D
Development
l t (ICD) courses. A
Any reuse requires
i ththe permission
i i off th
the ICD
ICD.
EViews® is a trademark of IHS Global Inc.
Evaluating Regression Models
Consequences of error irregularities
f forecasting
for f ti
Part II
Autocorrelation of errors in a linear regression model:
case 2
• True
T f yt (generate
DGP for ( t 1000 obs.):
b )
• we have
h d yt 1 iin th
llagged the RHS and
d AR(1) errors…
• … which we neglect…
3
Autocorrelation of errors
errors, case 2: “incorrect”
incorrect model
andd DGP
• … and estimate the “incorrect” model…
y t y t 1 t t ~ iid (0, )
2
y t y t 1 t t t 1 t
In Eviews:
Please,, have p
pagefile
g “m7_s3_Autocorr_case02” opened
p
Open and run “m7
m7_s3_autocorr_case02_application.prg
s3 autocorr case02 application prg”
4
Heteroskedasticity of errors in a linear regression
model
Th process yt h
• The has h
heteroskedastic
t k d ti errors:
yt 1 yt 1 2 yt 2 t t ~ N (0, t2 )
5
Heteroskedasticity of errors: “incorrect”
incorrect model and
DGP
• … and estimate an “incorrect” OLS model, assuming constant variance…
yt 1 yt 1 2 yt 2 t t ~ iid (0, )
2
yt 1 yt 1 2 yt 2 t 0
t
2 2
1 t 1 2 2
t 1
6
Heteroskedasticity of errors: forecasting
• Next example: actual data for monthly total return UK bond index
• 1979:1
1979 1 – 2006:12
2006 12
In EViews:
• Please,
Please have pagefile “m7
m7_s3_garch
s3 garch” opened
7
Consequences of Error Irregularities for
Forecasting: Summary
• Autocorrelation may cause:
• Worse forecasting performance in terms of the mean forecast
• Incorrectly estimated confidence bounds,…
• Biased up or down due to the biased mean forecast
• T narrow or too
Too t wide
id
• … i.e.
i e incorrectly estimated forecast uncertainty
• Heteroskedasticity may cause:
• No effect on the mean forecast
• Incorrectly estimated confidence bounds,…
• Too narrow or wide
• … i.e. incorrectly estimated forecast uncertainty
8
MFx – Macroeconomic
Forecasting
IMFx
This training material is the property of the International Monetary Fund (IMF) and is intended for use in IMF
I tit t ffor C
Institute Capacity
it D
Development
l t (ICD) courses. A
Any reuse requires
i ththe permission
i i off th
the ICD
ICD.
EViews® is a trademark of IHS Global Inc.
Evaluating Regression Models
• In
I this
thi session:
i
• Breaks in the intercept OR slope parameters of a linear regression model…
• … in
i th
the iintercept:
t t
yt 0 d T 1 xt t
* *
0, T T
• … in the slope: dT
*
1, T T
*
yt 0 ( 1 d T ) z t t
*
• i.e.,
i shift by att T *
hift b
• and new parameter value is 0 (intercept) and 1 (slope)
4
B k and
Breaks dF
Forecasting
ti
• We
W generate data b ) yt with
d (1000 obs.) i hab b T * 800
breakk at obs.
• Evaluate the effect of a break in the estimation sample
p on forecastingg
• We analyze:
• “Correct” (DGP) model – accounts for a break
• Compare models’
models forecasting performance (as in the previous session):
• Series of 1-period ahead forecast: RMSE
t ~ N (0,2.25 )
6
Break in the Intercept: “Incorrect” Model and DGP
• We do not realize there is a break …
• E.g.,
E g we forget to test for breaks (will do later!)
• …and
and estimate an “incorrect”
incorrect model:
yt 0 1 yt 1 t
yt 0 d T 1 yt 1 t
*
In EViews:
Please have pagefile “M7
Please, M7_S4_str_break_interc
S4 str break interc” opened
Use “M7
M7_S4_break_intercept_application.prg
S4 break intercept application prg”
7
MFx – Macroeconomic
Forecasting
IMFx
This training material is the property of the International Monetary Fund (IMF) and is intended for use in IMF
I tit t ffor C
Institute Capacity
it D
Development
l t (ICD) courses. A
Any reuse requires
i ththe permission
i i off th
the ICD
ICD.
EViews® is a trademark of IHS Global Inc.
Evaluating Regression Models
• “Incorrect”
Incorrect model:
yt 1 z t t
• Compare forecasts from “incorrect” and “correct” (i.e. DGP), that accounts
for the break in the slope:
yt zt d T zt t *
3
Break in the Slope: two cases
• Data generating process (1000 obs.) yt , two cases:
• p
positive shift
y t 0 .5 z t 0 .4 d T z t t
*
• negative shift
0, T 800
y t 0 .5 z t 0 .4 d T z t t t ~ N (0,1) dT
1, T 800
* *
• In EViews:
Please, have p
pagefile
g “M7_S4_str_break_slope”
_ _ _ _ p opened
p
Use “M7_SS4_b
break
ea _sslope
ope_app
application.prg”
cat o p g
4
Consequences of Breaks for Forecasting:
Summary
• Breaks may cause:
• Worse forecasting performance in terms of the mean forecast
• … i.e.
i iincorrectly
tl estimated
ti t d fforecastt uncertainty
t i t
MFx – Macroeconomic
Forecasting
IMFx
This training material is the property of the International Monetary Fund (IMF) and is intended for use in IMF
I tit t ffor C
Institute Capacity
it D
Development
l t (ICD) courses. A
Any reuse requires
i ththe permission
i i off th
the ICD
ICD.
EViews® is a trademark of IHS Global Inc.
Evaluating Regression Models
Testingg Residuals for Autocorrelation
Testing Residuals for Autocorrelation
• Portmanteau Q-test of no autocorrelation
• LM-test
LM test of no autocorrelation
• Portmanteau Q-test:
4
Q Tests of Autocorrelation: Intuition
Q-Tests
• Test statistic
T (T 2 ) m 2
Q (m )
T k i 1
r (i ) ~ ( m )
2
• Intuition:
• if ˆt are autocorrelated, r (i )' s should be “large”
• and Q(m) is “large”
• If Q((m) is “large enough” – larger than a “critical value” Q ( m) QCV ( m)
• H0: r (1) 0, r ( 2) 0,..., r ( m ) 0 is rejected
j
So t are autocorrelated indeed!
• So,
6
LM-Tests
LM Tests of Autocorrelation: Intuition
• Get
G the 2
h R off our auxiliary
ili regression
i
ˆt 1 1 x1t ... k xkt 1ˆt 1 ... mˆt m t
• Construct a statistic: T R ~ (m
2 2
(m) ,
• T – number of observations in the sample,
p , R2 is a coefficient of determination
• Intuition:
• if some of the ˆt i in regression (*) are correlated with ˆt
• then R is “large” T R is “large”
2 2
• if T R iis llarger th
2
than a ““critical”
iti l” value
l
• i.e.,
i e regression captures systematic information in residuals!
• H0: 1 0, 2 0,..., m 0 is rejected
• t are autocorrelated up to m lags
IMFx
This training material is the property of the International Monetary Fund (IMF) and is intended for use in IMF
I tit t ffor C
Institute Capacity
it D
Development
l t (ICD) courses. A
Any reuse requires
i ththe permission
i i off th
the ICD
ICD.
EViews® is a trademark of IHS Global Inc.
Evaluating Regression Models
Testing Residuals for
Heteroskedasticity
k d i i and d Normality
li
Testing Residuals for Heteroskedasticity and
Normality
• Q-test
• A family of LM-tests
LM tests
• Jarque-Bera
J B test off normality
li
4
Q Tests of Heteroskedasticity: Intuition
Q-Tests
• Familiar Test statistic
T (T 2 ) m 2
Q (m )
T k i 1
r (i ) ~ ( m )
2
• Intuition:
• if ˆt2 are autocorrelated, i.e. residuals are heteroskedastic
• r (i )' s should be “large”
• and Q(m) is “large”
• If Q((m) is “large
g enough” g than a “critical value” Q ( m) QCV ( m)
g – larger
• H0: r (1) r ( 2) ... r ( m ) 0 is rejected
So squares of residuals are autocorrelated
• So, t are heteroskedastic indeed
EViews example: pagefile “M7
M7_S6_Interbank_Ukraine
S6 Interbank Ukraine”
5
LM Tests of Heteroskedasticity: Ingredients
LM-Tests
• LM-style
y tests:
• investigate an auxiliary regression for t
ˆ 2
ˆ 2
• if t change
h systematically
i ll (d(depend i bl ) t are
d on some variables)
heteroskedastic
• Example:
E l ARCH LM
LM-test
• Regress t on t 1 :
ˆ 2
ˆ 2
ˆ 0 ˆ ... mˆ
t
2 2
1 t 1
1
2
t m
t
• H0 of homoskedasticity:
1 0, 2 0,..., m 0
6
LM Tests of Heteroskedasticity: Intuition
LM-Tests
• Get the of the regression
R 2
ˆ 1 ˆ ... mˆ
t
2 2
1 t 1
1
2
t m
t
• Intuition:
• if ˆt in regression are significantly related to
2
t i
ˆ 2
“large”” T R2 is
2
• R is
i “l i “l
“large””
• if T R2 is also larger than a “critical”
critical value
• H0: 1 0, 2 0,..., m 0 rejected!
• t are heteroskedastic up to m lags
4
1
Tˆ
3
ˆ 1 ˆt
T
• skewness
k ˆ t
t i K
S , kkurtosis
T t 1 ˆ T t 1 ˆ
• Jarque-Bera-test
q statistic:
JB
T ˆ 2
S
Kˆ 3 ~
2
2
2 ,
6 4
• ˆt are normal if not skewed (symmetric, Ŝˆ ~ 0 ) and not leptokurtic ( K̂ˆ ~ 3 ) JB ~ 0
8
MFx – Macroeconomic
Forecasting
IMFx
This training material is the property of the International Monetary Fund (IMF) and is intended for use in IMF
I tit t ffor C
Institute Capacity
it D
Development
l t (ICD) courses. A
Any reuse requires
i ththe permission
i i off th
the ICD
ICD.
EViews® is a trademark of IHS Global Inc.
Evaluating Regression Models
Testingg for Structural Breaks
Testing for Structural Breaks
• The main question: Have the true parameters of the model changed during
p p
estimation sample period?
• This session:
• Recursive coefficients
• Chow
Ch b breakpoint
k i t ttestt
• Quandt-Andrews
Q dt A d test
t t
• Quick Reminder: consequences of breaks for forecasting (see session 4 for details)
y t ytˆ0,[1yˆ ˆ ˆ ˆ
t x ˆ ...
yx t
ˆˆ ...
...
x ˆ x ˆˆ xt xxt ... t ˆk ,[1,T ] x k t
,T 0],[1,T 0,1[]11,T
0 0 ,[1,T2 ]]1,[11,T 11,[]1,T1 2 ] 1k0,[,[11,T,T ]k ,[1k,T k1,][11,[,T1k,T 2] ] 1k
0 0 0 0 0 0 0
1 T0 T0+1 T0+2 T
.......................
• Intuition:
• If the sum of squared errors for the U-model is substantially smaller, than that for
the
h R-modeld l ˆR ' ˆR ˆU ' ˆU
• which makes the F-stat.
F stat is “larger”
larger than a critical value
value,
• there are breaks indeed and R R-model
model accounts for them!
• the H0 of no breaks is rejected
j
1 t1 t2 T
t1 t t 2
k t t 2 1 k t t 1
and
~
ˆ SS ,t y t ˆ1 x1t ... ~ˆ k x kt for t 1,..., T1
• Intuition:
• if no break the fit of FS-model and SS-model are of the same degree of accuracy
• F-stat. is small
• If there is a break at T1 the fit of the FS-model should deteriorate after T1
• F-stat.
F t t becomes
b “l
“large”,
” andd if it exceeds
d th
the critical
iti l value
l
• the H0 of no breaks is rejected
IMFx
This training material is the property of the International Monetary Fund (IMF) and is intended for use in IMF
I tit t ffor C
Institute Capacity
it D
Development
l t (ICD) courses. A
Any reuse requires
i ththe permission
i i off th
the ICD
ICD.
EViews® is a trademark of IHS Global Inc.
Evaluating Regression Models
Coefficient Testing
Coefficient Testing
• Main questions:
• Should some coefficients in the regression be restricted to particular (e
(e.g.,
g economic-
theory-consistent) values?
• Should some regressors be excluded (i.e., respective coefficients restricted to 0’s) from
our model?
• In this session:
• t-test of single coefficient
• Wald test
• Redundant variables test
• H0: βi β
• t-statistic:
i i
ˆ i
t ˆ
i
s . e .(( ˆ i )
4
tt-test:
test: Intuition
• t-statistic:
i i
ˆ i
t ˆ
i
s . e .(( ˆ i )
• Intuition:
• if restriction is not correct β
β̂i and β are different values
• βi β is “large”
g t̂ is “large”
g
i
• H0 is rejected
H 0 : βi β 0
EViews Example: pagefile “M7_S8_exmpl_brazil_pstar” 5
Wald test of Multiple Linear Restrictions
• Regression model: yt β0 β1 x1t ... βk xkt t
• Linear restrictions on coefficients: R r
• R : ( m k ) - matrix
restrictions k – number of coefficients in vector β [ β0 , β1 ,..., βk ]]'
• m – number of restrictions,
• r : ( m 1) - vector
• Example: test β1 0, β2 β3 , β4 2
• Note: β2 β3 β2 β3 0
0 1 0 0 0 ... 0 0 0
R 0 0 1 1 ... ... 0 0, r 0
0 0 0 1 ... ... 0 0 2
[ 0 , 1 , 2 , 3 , 4 ,..., k ]]' 6
Wald Test: Intuition
• H0: R r
• Wald Test Statistic
A
W R ˆ r ˆ R X ' X R ' R r m ,
' 1
2 1
ˆ 2
• Intuition:
• if restrictions R r are correct
• ( R ˆ r ) ~ 0 then W ~ 0
• i.e., if W WCV (not statistically significant)
• the H0 is not rejected (can impose the restrictions)
1 ˆt2
f y t | X , exp{ }
2 ˆ 2
2ˆ 2
1 t
ˆ 2
ln L ln f ( y t | X , ) ln
T T
exp{ }
t 1 t 1 2ˆ
2
2ˆ 2
• this
h property is key
k for
f the
h test… 8
Redundant Variables Tests: Intuition
• Unrestricted model:
yt β0 β1 x1t ... βn xnt ... β j x jt ... βk xkt t
• Restricted one: xnt , x jt are dropped
yt β0 β1 x1t ... βk xkt t
• H0: xnt , xjt are redundant
• Test
T t statistic
t ti ti - the
th Lik
Likelihood
lih d RRatio:
ti
LR 2ln LR ln LU
r,A 2
• Intuition:
• if dropping variables (going from U to R)
• substantial decrease of LU to LR LR is “large”
• if LR LRCV the R-model fit deteriorates significantly
• reject H0 variables should not be dropped from the model 9
MFx – Macroeconomic
Forecasting
IMFx
This training material is the property of the International Monetary Fund (IMF) and is intended for use in IMF
I tit t ffor C
Institute Capacity
it D
Development
l t (ICD) courses. A
Any reuse requires
i ththe permission
i i off th
the ICD
ICD.
EViews® is a trademark of IHS Global Inc.
Evaluating Regression Models
• Residual heteroskedasticity
• Please,
Please have “M7
M7_data.wf1
data.wf1” opened
Residual Autocorrelation
• What if tests suggest that residuals are autocorrelated?
• Recall 2 cases:
cases
• No lagged dependent variables in the model and t are autocorrelated : t 1t1 ... mtm t
• In our example: AR(1)
yt zt t t t 1 t
y t 1 y t 1 2 z t t t t 1 t
Reminder:
d check
h k sessions 2 and
d 3 ffor the
h ddiscussion off consequences off autocorrelation
l
4
Dealing with Autocorrelation: Case 1
• No lagged variables in the model and t are autocorrelated:
• In general add lags zt 1 , yt 1 , zt 2 , yt 2 ,...
yt zt t y t 1 z t 2 y t 1 3 z t 1 t
5
Dealing with Autocorrelation: Case 1 (cont
(cont…))
• Alternatively, add AR-terms in the regression and estimate using MLE:
• In general: AR(1), AR(2),…, AR(m) This is the rho
• In our case: AR(1) coefficient in
t ˆ t 11 t
7
MFx – Macroeconomic
Forecasting
IMFx
This training material is the property of the International Monetary Fund (IMF) and is intended for use in IMF
I tit t ffor C
Institute Capacity
it D
Development
l t (ICD) courses. A
Any reuse requires
i ththe permission
i i off th
the ICD
ICD.
EViews® is a trademark of IHS Global Inc.
Evaluating Regression Models
y t 1 y t 1 2 z t t t t 1 t
3
Dealing with Autocorrelation: Case 2
• Errors are autocorrelated, lagged variables of the same order are in the RHS of the equation:
• Add lags: in general – yt2 , zt 1, yt 3, zt2 ,...
• Add llags: iin our case – yt2 , zt1
y t 1 y t 1 2 z t t yt 1 yt 1 2 zt 3 yt 2 4 zt 1 t
Consistent
estimates of
and β
β’s can be
recovered from:
1 c (1)
1 c ( 3)
c (2)
2
IMFx
This training material is the property of the International Monetary Fund (IMF) and is intended for use in IMF
I tit t ffor C
Institute Capacity
it D
Development
l t (ICD) courses. A
Any reuse requires
i ththe permission
i i off th
the ICD
ICD.
EViews® is a trademark of IHS Global Inc.
Evaluating Regression Models
• Heteroskedasticity:
Heteroskedasticity
3
Dealing with Heteroskedasticity
• Model the variance explicitly,
p y, estimate the model usingg Maximum Likelihood
Estimator (MLE):
• Open pagefile
O fil “M7_S9_garch_no_bias”,
“M7 S9 h bi ” check
h k objects
bj t named
d
p [ ] q [ ]
p_[…]_q_[…]
4
Dealing with heteroskedasticity (cont
(cont…))
q 1 2
p
1 3.424123 3.428592
2 3.429648 3.434166
yt 1 yt 1 2 yt 2 t 0
t
2 2
1 t 1
2 2
t 1
• If the
h aim
i is
i to check
h k significance
i ifi off our regression:
i
• use the HAC estimate of the error variance to correct the estimates of
standard errors…
6
Summary
• Testing residuals for autocorrelation and heteroskedasticity is an important part of
model
d l di
diagnostics
ti
• Autocorrelation may lead to:
• biased estimates of model coefficients or incorrectly estimated error variance
• Negative effect on the model’s forecasting performance and incorrectly estimated forecast uncertainty
(confidence bounds)
• Heteroskedasticity,
Heteroskedasticity if not accounted for:
• Does not affect
ff model’s
d l’ fforecasting performance
f iff terms off RMSE
• … but
b may llead
d to incorrectly
l estimated
d uncertainty (confidence
( fd b
bounds)
d)
IMFx
This training material is the property of the International Monetary Fund (IMF) and is intended for use in IMF
I tit t ffor C
Institute Capacity
it D
Development
l t (ICD) courses. A
Any reuse requires
i ththe permission
i i off th
the ICD
ICD.
EViews® is a trademark of IHS Global Inc.
Evaluating Regression Models
• Please,
Please have “M7
M7_Data.wf1
Data.wf1” opened
Single Break in the Intercept
• The intercept may break in the estimation sample [1, ... ,T ] in N points (one or more)
yt 0 1 x1t ... k xkt t , t 1,..., T1
yt ( 0 1 ) 1 x1t ... k xkt t , t T1 1,,...,, T2
...
yt ( 0 N ) 1 x1t ... k xkt t , t TN 1,..., T
yt 0 dum _ 802 1 yt 1 t
• In EViews: Use “m7_s10 – generate_shift_dummy.prg” to create a shift dummy for a break in “802”
5
Single Break in the Slope
• It is quite similar to how we treated breaks in the slope…
• Break in the slope, e.g. 1:
yt 0 1 x1t ... k xkt t , t 1,..., T1
yt 0 ( 1 1 ) x1t ... k xkt t , t T1 1,,...,, T2
...
yt 0 ( 1 N ) x1t ... k xkt t , t TN 1,,...,, T
• i.e.,
i shift by i att Ti and
hift b d new slope
l l iis 1 i
value
• We do not know the date of a break and test for it
• We consider the case of a single break in the slope
In EViews: select pagefile “M7_S10_str_break_slope” equation “y_mod” and Quandt-
Andrews
d test to estimate a d
date off a single
l bbreakk 6
Dealing with a Single Break in the Slope (cont
(cont…))
• We correct the “incorrect” model for a break in the slope by adding a cross-
product of a shift dummy and zt :
yt 0 1 zt dum _ 794 zt t
• In EViews: Open
p “m7_s10
_ - single_break_slope-dealing_irreg.prg”:
g _ _ p g_ g p g
• Correct the “incorrect” model
• Compare 3 model “Correct (DGP)”, “Incorrect” (does not account for a break) and “Corrected”
(include a product of z and shift dummy corresponding to the estimated moment of a break)
7
MFx – Macroeconomic
Forecasting
IMFx
This training material is the property of the International Monetary Fund (IMF) and is intended for use in IMF
I tit t ffor C
Institute Capacity
it D
Development
l t (ICD) courses. A
Any reuse requires
i ththe permission
i i off th
the ICD
ICD.
EViews® is a trademark of IHS Global Inc.
Evaluating Regression Models
I EViews:
In EVi S l pagefile
Select fil “M7_S10_mult_str_breaks”,
“M7 S10 l b k ” equation
i “y_mod”
“ d”
• Bai-Perron
i tests off LL+1
1 vs. L sequentially
i ll ddetermined
i db breaks
k to estimate
i d
dates off multiple
li l b breaks
k
3
Dealing with Multiple Breaks (cont
(cont…))
• We correct the “incorrect” model for by accounting for multiple breaks
• We use shift dummies:
In EViews:
• Use “m7_s10 - generate_shift_dummy.prg” to create dummies for breaks at “417”, “627” and
“771”
• Open “m7
m7_s10
s10 - multiple_str_breaks-dealing_irreg.prg
multiple str breaks dealing irreg prg”::
• correct the “incorrect” model and run the script
p
4
Summary
• Testing for beaks is an important part of model diagnostics
• We can use shift dummies to account for breaks in the intercept or slope
coefficients of a liner regression model