models with eviews res. asst. gizem...

78
WORKSHOP on Forecasting, and Volatility Models with EViews Asst. Prof. Dr. Kemal Bagzibagli Department of Economic Res. Asst. Pejman Bahramian PhD Candidate, Department of Economic Res. Asst. Gizem Uzuner MSc Student, Department of Economic

Upload: lamthu

Post on 10-Apr-2018

235 views

Category:

Documents


3 download

TRANSCRIPT

Page 1: Models with EViews Res. Asst. Gizem Uzunerfbemoodle.emu.edu.tr/pluginfile.php/47098/mod_resource/content/1...Models with EViews Asst. Prof. Dr. Kemal Bagzibagli Department of Economic

WORKSHOP on

Forecasting, and Volatility Models with EViews

Asst. Prof. Dr. Kemal BagzibagliDepartment of Economic

Res. Asst. Pejman BahramianPhD Candidate, Department of Economic

Res. Asst. Gizem UzunerMSc Student, Department of Economic

Page 2: Models with EViews Res. Asst. Gizem Uzunerfbemoodle.emu.edu.tr/pluginfile.php/47098/mod_resource/content/1...Models with EViews Asst. Prof. Dr. Kemal Bagzibagli Department of Economic

EViews Workshop Series Agenda1. Introductory Econometrics with EViews

2. Advanced Time Series Econometrics with EViewsa. Unit root test and cointegrationb. Vector Autoregressive (VAR) modelsc. Structural Vector Autoregressive (SVAR) modelsd. Vector Error Correction Models(VECM)e. Autoregressive Distributed Lag processes

3. Forecasting, and Volatility Models with EViewsa. Forecastingb. Volatility modelsc. Regime Switching Models

2

Page 3: Models with EViews Res. Asst. Gizem Uzunerfbemoodle.emu.edu.tr/pluginfile.php/47098/mod_resource/content/1...Models with EViews Asst. Prof. Dr. Kemal Bagzibagli Department of Economic

Part 3 - Outline1. Forecasting

a. Forecasting with Exogenous Variablesb. Out-of-sample Forecastsc. Forecasting with AR Termsd. Forecasting with MA Terms

2. Volatility Modelsa. Autoregressive Conditionally Heteroscedastic (ARCH) Models

i. Testing for “ARCH Effects”ii. Problems with ARCH(q) Models

b. Generalised ARCH (GARCH) Modelsc. Extensions to Basic GARCH (EGARCH) Modelsd. The GJR Model

3. Markov Regime Switching Models 3

Page 4: Models with EViews Res. Asst. Gizem Uzunerfbemoodle.emu.edu.tr/pluginfile.php/47098/mod_resource/content/1...Models with EViews Asst. Prof. Dr. Kemal Bagzibagli Department of Economic

1. Forecasting

Page 5: Models with EViews Res. Asst. Gizem Uzunerfbemoodle.emu.edu.tr/pluginfile.php/47098/mod_resource/content/1...Models with EViews Asst. Prof. Dr. Kemal Bagzibagli Department of Economic

Forecasting with Exogenous Variables● Suppose we want to forecast the level of non-farm payroll

employment for the period from 2014m04 to 2014m12.● To accomplish this task, we first need to specify and estimate

a model. Let’s model the payroll level as a linear function of a time trend and seasonal factors.

Estimation1.Type in the command window: ls payroll c @trend @expand(@month, @dropfirst)

2.Press Enter (save this equation as eq01).5

Page 6: Models with EViews Res. Asst. Gizem Uzunerfbemoodle.emu.edu.tr/pluginfile.php/47098/mod_resource/content/1...Models with EViews Asst. Prof. Dr. Kemal Bagzibagli Department of Economic

Forecasting with Exo. Variables (cont.)

● Note that command @expand(@month) creates 12 dummy variables, one for each month of the year.

● These are the seasonal factors. ● Because we have included a constant, we need to exclude

one of the dummy variables in order not to fall in the dummy variable trap.

● Here we have chosen to exclude January, by using the option @dropfirst. 6

Page 7: Models with EViews Res. Asst. Gizem Uzunerfbemoodle.emu.edu.tr/pluginfile.php/47098/mod_resource/content/1...Models with EViews Asst. Prof. Dr. Kemal Bagzibagli Department of Economic

Forecasting with Exo. Variables (cont.)We also plot the actual and fitted values of the model:View → Actual, Fitted, Residual → Actual Fitted Residual Graph.

7

Page 8: Models with EViews Res. Asst. Gizem Uzunerfbemoodle.emu.edu.tr/pluginfile.php/47098/mod_resource/content/1...Models with EViews Asst. Prof. Dr. Kemal Bagzibagli Department of Economic

To forecast press the button in the equation toolbar.

1. Under Series name, specify a name for the forecast series. EViews suggests a name (payrollf) but this series will be overwritten every time a new model is estimated. Let’s save our series as eq01_f.

2. Under Forecast sample, select the sample over which the forecast will be carried out. Here we type, 2013m04 @last.

Forecasting with Exo. Variables (cont.)

8

Page 9: Models with EViews Res. Asst. Gizem Uzunerfbemoodle.emu.edu.tr/pluginfile.php/47098/mod_resource/content/1...Models with EViews Asst. Prof. Dr. Kemal Bagzibagli Department of Economic

Forecasting with Exo. Variables (cont.)3. Check “Insert actuals for out-of-sample

observations.”4. Under Method, notice that EViews indicates this is a

Static forecast (no dynamics in the equation) (more details later).

5. Under Output, check Forecast graph and Forecast evaluation.

6. Click OK.

9

Page 10: Models with EViews Res. Asst. Gizem Uzunerfbemoodle.emu.edu.tr/pluginfile.php/47098/mod_resource/content/1...Models with EViews Asst. Prof. Dr. Kemal Bagzibagli Department of Economic

Forecasting with Exo. Variables (cont.)The Forecast Output is shown here. Notice that EViews shows the series Eq01_f over the forecast sample, together with 2 standard error bands.

10

Page 11: Models with EViews Res. Asst. Gizem Uzunerfbemoodle.emu.edu.tr/pluginfile.php/47098/mod_resource/content/1...Models with EViews Asst. Prof. Dr. Kemal Bagzibagli Department of Economic

Forecasting with Exo. Variables (cont.)What would happen if we set the forecast sample to be the entire range of the workfile?

11

Page 12: Models with EViews Res. Asst. Gizem Uzunerfbemoodle.emu.edu.tr/pluginfile.php/47098/mod_resource/content/1...Models with EViews Asst. Prof. Dr. Kemal Bagzibagli Department of Economic

Forecasting with Exo. Variables (cont.)1. Under Series name, name the new forecasted series

eq01_f3.2. Set all the other options as we did before (check

Forecast graph and Forecast evaluation, check “Insert actuals for out-of-sample observations.”

3. Under Forecast Sample, set the sample to the entire workfile range (1960m01 2014m12).

4. Click OK. 12

Page 13: Models with EViews Res. Asst. Gizem Uzunerfbemoodle.emu.edu.tr/pluginfile.php/47098/mod_resource/content/1...Models with EViews Asst. Prof. Dr. Kemal Bagzibagli Department of Economic

Out-of-Sample Forecasts

Estimation1.Type in the command window:

smpl 1960m01 2008m12 ls payroll c @trend @expand(@month,@dropfirst)

13

Page 14: Models with EViews Res. Asst. Gizem Uzunerfbemoodle.emu.edu.tr/pluginfile.php/47098/mod_resource/content/1...Models with EViews Asst. Prof. Dr. Kemal Bagzibagli Department of Economic

2. Open eq02. On the equation box toolbar, press the button. The Forecast dialog box opens up.

3. Under Series name, name the series eq02_f.

4. Under the Forecast sample, type the forecast sample (here, 2009m1 2014m12).

14

Out-of-Sample Forecasts

Page 15: Models with EViews Res. Asst. Gizem Uzunerfbemoodle.emu.edu.tr/pluginfile.php/47098/mod_resource/content/1...Models with EViews Asst. Prof. Dr. Kemal Bagzibagli Department of Economic

5. Set all the other options as we did previously (check Forecast graph, Forecast evaluation, and Insert actuals for out-of-sample observations).

6. Click OK.

15

Out-of-Sample Forecasts (cont.)

Page 16: Models with EViews Res. Asst. Gizem Uzunerfbemoodle.emu.edu.tr/pluginfile.php/47098/mod_resource/content/1...Models with EViews Asst. Prof. Dr. Kemal Bagzibagli Department of Economic

• For comparison purposes, we have also shown a graph of the payroll and eq02_f series. Notice that since we selected to “Insert actuals for out-of-sample observations” the series are identical over the estimation sample (1960m1 to 2008m12 ).

Forecast Graph Payroll vs eq02_f

16

Out-of-Sample Forecasts (cont.)

Page 17: Models with EViews Res. Asst. Gizem Uzunerfbemoodle.emu.edu.tr/pluginfile.php/47098/mod_resource/content/1...Models with EViews Asst. Prof. Dr. Kemal Bagzibagli Department of Economic

Estimation with AR terms 1.Let’s first specify a model with two AR terms. Type in the command window: smpl sample_est ls payroll c ar(1) ar(2) @trend @expand(@month, @droplast)

17

Forecasting with AR Terms

Page 18: Models with EViews Res. Asst. Gizem Uzunerfbemoodle.emu.edu.tr/pluginfile.php/47098/mod_resource/content/1...Models with EViews Asst. Prof. Dr. Kemal Bagzibagli Department of Economic

Estimation with AR terms

2.Press Enter (the second command should be typed in one line).

18

Forecasting with AR Terms (cont.)

Page 19: Models with EViews Res. Asst. Gizem Uzunerfbemoodle.emu.edu.tr/pluginfile.php/47098/mod_resource/content/1...Models with EViews Asst. Prof. Dr. Kemal Bagzibagli Department of Economic

3. Open eq06 and click the button. As usual, the Forecast dialog box opens up. Name the series eq06_dyn for the dynamic series and eq06_stat for the static forecast series.

19

Forecasting with AR Terms (cont.)

Page 20: Models with EViews Res. Asst. Gizem Uzunerfbemoodle.emu.edu.tr/pluginfile.php/47098/mod_resource/content/1...Models with EViews Asst. Prof. Dr. Kemal Bagzibagli Department of Economic

20

Forecasting with AR Terms (cont.)4. Under Forecast Sample set

the sample to sample_for. Under Method, select Dynamic forecast (for the dynamic series), and Static forecast (for the static series). Set the rest of the parameters as shown here.

5. Click OK.

Page 21: Models with EViews Res. Asst. Gizem Uzunerfbemoodle.emu.edu.tr/pluginfile.php/47098/mod_resource/content/1...Models with EViews Asst. Prof. Dr. Kemal Bagzibagli Department of Economic

• The Forecast Output for both methods is shown here. To produce forecasts with AR terms, EViews adds forecasts of the residuals to the forecasts of the structural model (structural model is based solely on explanatory variables).

• As expected, the static forecast

(bottom graph) goes up to 2013m04, and performs better than the dynamic forecast. 21

Forecasting with AR Terms (cont.)

Page 22: Models with EViews Res. Asst. Gizem Uzunerfbemoodle.emu.edu.tr/pluginfile.php/47098/mod_resource/content/1...Models with EViews Asst. Prof. Dr. Kemal Bagzibagli Department of Economic

● In the dynamic forecast (top graph), the lagged residuals are forecasted dynamically. This means that future values of lagged residuals are formed using the forecasted values of the dependent variable.

● In contrast, the static forecast uses actual lagged residuals and actual values for the dependent variable to produce forecasts.

22

Forecasting with AR Terms (cont.)

Page 23: Models with EViews Res. Asst. Gizem Uzunerfbemoodle.emu.edu.tr/pluginfile.php/47098/mod_resource/content/1...Models with EViews Asst. Prof. Dr. Kemal Bagzibagli Department of Economic

Estimation with MA terms 1.Let’s first specify a model with one MA term. Type in the command window: smpl sample_est ls payroll c ma(1) @trend @expand(@month, @droplast)

23

Forecasting with MA Terms

Page 24: Models with EViews Res. Asst. Gizem Uzunerfbemoodle.emu.edu.tr/pluginfile.php/47098/mod_resource/content/1...Models with EViews Asst. Prof. Dr. Kemal Bagzibagli Department of Economic

24

Forecasting with MA Terms (cont.)2.Press Enter (the second command should be typed in one line).

Page 25: Models with EViews Res. Asst. Gizem Uzunerfbemoodle.emu.edu.tr/pluginfile.php/47098/mod_resource/content/1...Models with EViews Asst. Prof. Dr. Kemal Bagzibagli Department of Economic

• Let’s produce dynamic and static forecast for the MA(1) model we just estimated.

1. Open equation and click the button. As usual, the Forecast dialog box opens up. Name the series eq08_dyn and eq08_stdev_dyn for the dynamic series and eq08_stat and eq08_stdev_stat for the static forecast series.

2. Under Forecast Sample set the sample to sample_for. 25

Forecasting with MA Terms (cont.)

Page 26: Models with EViews Res. Asst. Gizem Uzunerfbemoodle.emu.edu.tr/pluginfile.php/47098/mod_resource/content/1...Models with EViews Asst. Prof. Dr. Kemal Bagzibagli Department of Economic

1. Note that a new field MA backcast appears. Here you can choose either of two options: Estimation period (the default) and Forecast available (v5). Let’s choose Estimation period.

2. Click OK.

26

Forecasting with MA Terms (cont.)

Page 27: Models with EViews Res. Asst. Gizem Uzunerfbemoodle.emu.edu.tr/pluginfile.php/47098/mod_resource/content/1...Models with EViews Asst. Prof. Dr. Kemal Bagzibagli Department of Economic

2. Volatility Models

Page 28: Models with EViews Res. Asst. Gizem Uzunerfbemoodle.emu.edu.tr/pluginfile.php/47098/mod_resource/content/1...Models with EViews Asst. Prof. Dr. Kemal Bagzibagli Department of Economic

• ARCH–Autoregressive Conditional

Heteroscedasticity

• GARCH–Generalized ARCH

Modeling Volatility

28

Page 29: Models with EViews Res. Asst. Gizem Uzunerfbemoodle.emu.edu.tr/pluginfile.php/47098/mod_resource/content/1...Models with EViews Asst. Prof. Dr. Kemal Bagzibagli Department of Economic

The full model would be

where, • We can easily extend this to the general case where

the error variance depends on q lags of squared errors:

• This is an ARCH(q) model.29

Autoregressive Conditionally Heteroscedastic (ARCH) Models

Page 30: Models with EViews Res. Asst. Gizem Uzunerfbemoodle.emu.edu.tr/pluginfile.php/47098/mod_resource/content/1...Models with EViews Asst. Prof. Dr. Kemal Bagzibagli Department of Economic

30

Autoregressive Conditionally Heteroscedastic (ARCH) Models (cont.)

• Instead of calling the variance , in the literature it is usually called ht, so the model is

where,

Page 31: Models with EViews Res. Asst. Gizem Uzunerfbemoodle.emu.edu.tr/pluginfile.php/47098/mod_resource/content/1...Models with EViews Asst. Prof. Dr. Kemal Bagzibagli Department of Economic

• For illustration, consider an ARCH(1). Instead of the above, we can write

yt = β1 + β2x2t + ... + βkxkt + ut , ut = vtσt

, vt ∼ N(0,1) • The two are different ways of expressing exactly the same model.

The first form is easier to understand while the second form is required for simulating from an ARCH model, for example.

31

Another Way of Writing ARCH Models

Page 32: Models with EViews Res. Asst. Gizem Uzunerfbemoodle.emu.edu.tr/pluginfile.php/47098/mod_resource/content/1...Models with EViews Asst. Prof. Dr. Kemal Bagzibagli Department of Economic

1. First, run any postulated linear regression of the form given in the equation above, e.g. yt = β1 + β2x2t + ... + βkxkt + ut

saving the residuals, .

2. Then square the residuals, and regress them on q own lags to test for ARCH

of order q, i.e. run the regression

where vt is iid. Obtain R2 from this regression

32

Testing for “ARCH Effects”

Page 33: Models with EViews Res. Asst. Gizem Uzunerfbemoodle.emu.edu.tr/pluginfile.php/47098/mod_resource/content/1...Models with EViews Asst. Prof. Dr. Kemal Bagzibagli Department of Economic

33

Testing for “ARCH Effects” (cont.)

3. The test statistic is defined as TR2 (the number of observations multiplied by the coefficient of multiple correlation) from the last regression, and is distributed as a χ2(q).

Page 34: Models with EViews Res. Asst. Gizem Uzunerfbemoodle.emu.edu.tr/pluginfile.php/47098/mod_resource/content/1...Models with EViews Asst. Prof. Dr. Kemal Bagzibagli Department of Economic

4. The null and alternative hypotheses areH0 : γ1 = 0 and γ2 = 0 and γ3 = 0 and ... and γq = 0H1 : γ1 ≠ 0 or γ2 ≠ 0 or γ3 ≠ 0 or ... or γq ≠ 0.

If the value of the test statistic is greater than the critical value from

the χ2 distribution, then reject the null hypothesis.

• Note that the ARCH test is also sometimes applied directly to returns instead of the residuals from Stage 1 above.

34

Testing for “ARCH Effects” (cont.)

Page 35: Models with EViews Res. Asst. Gizem Uzunerfbemoodle.emu.edu.tr/pluginfile.php/47098/mod_resource/content/1...Models with EViews Asst. Prof. Dr. Kemal Bagzibagli Department of Economic

• How do we decide on q?• The required value of q might be very large• Non-negativity constraints might be violated.

– When we estimate an ARCH model, we require αi >0 ∀ i=1,2,...,q (since variance cannot be negative)

• A natural extension of an ARCH(q) model which gets around some of these problems is a GARCH model.

35

Problems with ARCH(q) Models

Page 36: Models with EViews Res. Asst. Gizem Uzunerfbemoodle.emu.edu.tr/pluginfile.php/47098/mod_resource/content/1...Models with EViews Asst. Prof. Dr. Kemal Bagzibagli Department of Economic

•• Bollerslev (1986): Allow the conditional variance to be dependent

upon previous own lags• The variance equation is now

(1)• This is a GARCH(1,1) model, which is like an ARMA(1,1) model for

the variance equation.• We could also write

36

Generalised ARCH (GARCH) Models

Page 37: Models with EViews Res. Asst. Gizem Uzunerfbemoodle.emu.edu.tr/pluginfile.php/47098/mod_resource/content/1...Models with EViews Asst. Prof. Dr. Kemal Bagzibagli Department of Economic

• By iterative substitution of σt-i

2 , for i = 2, 3, …, t into (1)• GARCH(1,1) model can be written as an infinite order ARCH model.

37

Generalised ARCH (GARCH) Models (cont.)

Page 38: Models with EViews Res. Asst. Gizem Uzunerfbemoodle.emu.edu.tr/pluginfile.php/47098/mod_resource/content/1...Models with EViews Asst. Prof. Dr. Kemal Bagzibagli Department of Economic

38

• But in general a GARCH(1,1) model will be sufficient to capture the volatility clustering in the data.

• Why is GARCH better than ARCH?

- more parsimonious - avoids overfitting- less likely to breach non-negativity constraints

Generalised ARCH (GARCH) Models (cont.)

Page 39: Models with EViews Res. Asst. Gizem Uzunerfbemoodle.emu.edu.tr/pluginfile.php/47098/mod_resource/content/1...Models with EViews Asst. Prof. Dr. Kemal Bagzibagli Department of Economic

39

The Unconditional Variance under the GARCH Specification

• The unconditional variance of ut is given by

when• is termed “non-stationarity” in variance

• is termed integrated GARCH

• For non-stationarity in variance, the conditional variance forecasts will not converge on their unconditional value as the horizon increases.

Page 40: Models with EViews Res. Asst. Gizem Uzunerfbemoodle.emu.edu.tr/pluginfile.php/47098/mod_resource/content/1...Models with EViews Asst. Prof. Dr. Kemal Bagzibagli Department of Economic

• Since the model is no longer of the usual linear form, we cannot use OLS.

• We use another technique known as maximum likelihood.

• The method works by finding the most likely values of the parameters given the actual data.

• More specifically, we form a log-likelihood function and maximise it.

40

Estimation of ARCH / GARCH Models

Page 41: Models with EViews Res. Asst. Gizem Uzunerfbemoodle.emu.edu.tr/pluginfile.php/47098/mod_resource/content/1...Models with EViews Asst. Prof. Dr. Kemal Bagzibagli Department of Economic

• Since the GARCH model was developed, a huge number of extensions and variants have been proposed. Three of the most important examples are EGARCH, GJR, and GARCH-M models.

• Problems with GARCH(p,q) Models:

- Non-negativity constraints may still be violated- GARCH models cannot account for leverage effects

• Possible solutions: the exponential GARCH (EGARCH) model or the

GJR model, which are asymmetric GARCH models.

41

Extensions to the Basic GARCH Model

Page 42: Models with EViews Res. Asst. Gizem Uzunerfbemoodle.emu.edu.tr/pluginfile.php/47098/mod_resource/content/1...Models with EViews Asst. Prof. Dr. Kemal Bagzibagli Department of Economic

• Suggested by Nelson (1991). The variance equation is given by

• Advantages of the model- Since we model the log(σt

2), then even if the parameters are negative, σt

2

will be positive.- We can account for the leverage effect: if the relationship between volatility and returns is negative, γ, will be negative.

42

The EGARCH Model

Page 43: Models with EViews Res. Asst. Gizem Uzunerfbemoodle.emu.edu.tr/pluginfile.php/47098/mod_resource/content/1...Models with EViews Asst. Prof. Dr. Kemal Bagzibagli Department of Economic

• Due to Glosten, Jaganathan and Runkle

where It-1 = 1 if ut-1 < 0 = 0 otherwise

• For a leverage effect, we would see γ > 0. • We require α1 + γ ≥ 0 and α1 ≥ 0 for non-negativity.

43

The GJR Model

Page 44: Models with EViews Res. Asst. Gizem Uzunerfbemoodle.emu.edu.tr/pluginfile.php/47098/mod_resource/content/1...Models with EViews Asst. Prof. Dr. Kemal Bagzibagli Department of Economic

44

Estimation of ARCH Models in EViews

Page 45: Models with EViews Res. Asst. Gizem Uzunerfbemoodle.emu.edu.tr/pluginfile.php/47098/mod_resource/content/1...Models with EViews Asst. Prof. Dr. Kemal Bagzibagli Department of Economic

The Mean Equationyou should enter the specification of the mean equation

Class of models● To estimate one of the

standard GARCH models as described above, select the GARCH/ TARCH entry in the Model dropdown menu.

● The other entries (EGARCH, PARCH, and Component ARCH(1, 1)) correspond to more complicated variants of the GARCH specification.

45

Estimation of ARCH Models in EViews (cont.)

Page 46: Models with EViews Res. Asst. Gizem Uzunerfbemoodle.emu.edu.tr/pluginfile.php/47098/mod_resource/content/1...Models with EViews Asst. Prof. Dr. Kemal Bagzibagli Department of Economic

Variance repressorslist variables you wish to include in the variance specification.

Estimation Options

46

Estimation of ARCH Models in EViews (cont.)

Page 47: Models with EViews Res. Asst. Gizem Uzunerfbemoodle.emu.edu.tr/pluginfile.php/47098/mod_resource/content/1...Models with EViews Asst. Prof. Dr. Kemal Bagzibagli Department of Economic

The main output from ARCH estimation is divided into two sections—the upper part provides the standard output for the mean equation, while the lower part, labeled“Variance Equation”,

47

Output

Page 48: Models with EViews Res. Asst. Gizem Uzunerfbemoodle.emu.edu.tr/pluginfile.php/47098/mod_resource/content/1...Models with EViews Asst. Prof. Dr. Kemal Bagzibagli Department of Economic

GARCH Graph/Conditional Standard Deviation and GARCH Graph/Conditional Variance plots the one-step ahead standard deviation or variance for each observation in the sample

48

Views of ARCH Models

Page 49: Models with EViews Res. Asst. Gizem Uzunerfbemoodle.emu.edu.tr/pluginfile.php/47098/mod_resource/content/1...Models with EViews Asst. Prof. Dr. Kemal Bagzibagli Department of Economic

Residual Diagnostics/ ARCH LM Test carries out Lagrange multiplier tests to test whether the standardized Residuals exhibit additional ARCH.

49

Views of ARCH Models (cont.)

Page 50: Models with EViews Res. Asst. Gizem Uzunerfbemoodle.emu.edu.tr/pluginfile.php/47098/mod_resource/content/1...Models with EViews Asst. Prof. Dr. Kemal Bagzibagli Department of Economic

Forecast uses the estimated ARCH model to compute static and dynamic forecasts of the mean, its forecast standard error, and the conditional variance.

50

Views of ARCH Models (cont.)

Page 51: Models with EViews Res. Asst. Gizem Uzunerfbemoodle.emu.edu.tr/pluginfile.php/47098/mod_resource/content/1...Models with EViews Asst. Prof. Dr. Kemal Bagzibagli Department of Economic

3. Markov Regime Switching Models

Page 52: Models with EViews Res. Asst. Gizem Uzunerfbemoodle.emu.edu.tr/pluginfile.php/47098/mod_resource/content/1...Models with EViews Asst. Prof. Dr. Kemal Bagzibagli Department of Economic

● Allowing for periodic shifts in the parameters that describe the system’s dynamics and volatility

● Examples include:○ dynamics and volatility differ between recessions and expansions

○ predictability and volatility in asset returns vary across subsamples

○ money demand functions are notoriously unstable and heteroskedastic

52

Regime Switching Models

Page 53: Models with EViews Res. Asst. Gizem Uzunerfbemoodle.emu.edu.tr/pluginfile.php/47098/mod_resource/content/1...Models with EViews Asst. Prof. Dr. Kemal Bagzibagli Department of Economic

● State-space models in which switching between regimes occurs stochastically according to a Markov process

● BusinessDictionary.com○ “Process whose future behavior cannot be accurately predicted

from its past behavior (except the current or present behavior) and which involves random chance or probability”■ e.g. behavior of a business or economy, flow of traffic, progress of

an epidemic

○ “Named after the inventor of Markov analysis, the Russian mathematician Andrei Andreevich Markov (1856-1922)” 53

Markov Regime Switching Models

Page 54: Models with EViews Res. Asst. Gizem Uzunerfbemoodle.emu.edu.tr/pluginfile.php/47098/mod_resource/content/1...Models with EViews Asst. Prof. Dr. Kemal Bagzibagli Department of Economic

Hamilton (1989)● a two-state Markov switching model ● the mean growth rate of GNP is subject to regime

switching● errors follow a regime-invariant AR(4) process➢ Generalisation of the simple dummy variables approach

➢ Allows regimes (called states) to occur several periods over time

➢ In each period t (the state) is denoted by st

➢ There can be m possible states: st = 1,... , m54

Markov Regime Switching Models (cont.)

Page 55: Models with EViews Res. Asst. Gizem Uzunerfbemoodle.emu.edu.tr/pluginfile.php/47098/mod_resource/content/1...Models with EViews Asst. Prof. Dr. Kemal Bagzibagli Department of Economic

Garcia and Perron (1996)● Time series behavior of the U.S. real interest rate from 1961

to 1986

● Three possible regimes affecting both the mean and variance

● States: high - middle - low

● Probabilities of being in the different states at each point of the sample

55

Markov Regime Switching Models (cont.)

Page 56: Models with EViews Res. Asst. Gizem Uzunerfbemoodle.emu.edu.tr/pluginfile.php/47098/mod_resource/content/1...Models with EViews Asst. Prof. Dr. Kemal Bagzibagli Department of Economic

56

Garcia and Perron (1996) - cont.Ex-post Real Interest Rate Inflation Rate

Low

Middle

High

Page 57: Models with EViews Res. Asst. Gizem Uzunerfbemoodle.emu.edu.tr/pluginfile.php/47098/mod_resource/content/1...Models with EViews Asst. Prof. Dr. Kemal Bagzibagli Department of Economic

Markov Regime Switching Models (cont.)● Let yt denote the GDP growth rate● Simple model with m = 2 (only 2 regimes)

yt = μ1 + et when St = 1yt = μ2 + et when St = 2

e t i.i.d. N(0, σ2)● Notation using dummy variables:

yt = μ1 D1t + μ2 (1-D1t) + et where D1t = 1 when St = 1, = 0 when St = 2

57

Page 58: Models with EViews Res. Asst. Gizem Uzunerfbemoodle.emu.edu.tr/pluginfile.php/47098/mod_resource/content/1...Models with EViews Asst. Prof. Dr. Kemal Bagzibagli Department of Economic

Markov Regime Switching Models (cont.)

How does st evolve over time?

Model: Markov switching :P[St | S1, S2, ..., St-1] = P[St | St-1]

Probability of moving from state i to state j:pij = P[St= j| St-1= i]

58

Page 59: Models with EViews Res. Asst. Gizem Uzunerfbemoodle.emu.edu.tr/pluginfile.php/47098/mod_resource/content/1...Models with EViews Asst. Prof. Dr. Kemal Bagzibagli Department of Economic

Markov Regime Switching Models (cont.)

● Unconditional probabilities:○ Prob[St = 1] = (1-p22 )/(2 - p11 - p22 )○ Prob[St = 2] = 1 - Prob[St = 1]

● Examples: If p11 = 0.9 and p22 = 0.7 then Prob[st = 1] = 0.75

If p11 = 0.9 and p22 = 0.9 then Prob[st = 1] = 0.5

59

Page 60: Models with EViews Res. Asst. Gizem Uzunerfbemoodle.emu.edu.tr/pluginfile.php/47098/mod_resource/content/1...Models with EViews Asst. Prof. Dr. Kemal Bagzibagli Department of Economic

Markov Regime Switching Models (cont.)

Example with only 2 possible states: m = 2Switching (or conditional) probabilities:● Prob[St = 1 | St-1 = 1] = p11● Prob[St = 2 | St-1 = 1] = 1 - p11● Prob[St = 2 | St-1 = 2] = p22● Prob[St = 1 | St-1 = 2] = 1 – p22

Expected Duration: 1/(1-pjj)● Expected duration of state j, for j = 1, 2 60

Page 61: Models with EViews Res. Asst. Gizem Uzunerfbemoodle.emu.edu.tr/pluginfile.php/47098/mod_resource/content/1...Models with EViews Asst. Prof. Dr. Kemal Bagzibagli Department of Economic

Markov Regime Switching Models (cont.)

Estimation● Maximize Log-Likelihood● Hamilton filter - Filtered probabilities:

π 1, t = Prob[St = 1 | y1, y2, …, yt ]π 2 , t = Prob[St = 2 | y1, y2, …, yt ] = 1- π 1 ,t

for t=1, …, T

61

Page 62: Models with EViews Res. Asst. Gizem Uzunerfbemoodle.emu.edu.tr/pluginfile.php/47098/mod_resource/content/1...Models with EViews Asst. Prof. Dr. Kemal Bagzibagli Department of Economic

Yilmazkuday and Akay (2008)● Analysis of the business cycles of the Turkish economy over

the period 1987–2002

● Three-state univariate Markov switching

● Decomposition of the non-recessionary state into two sub-states: high-growth and low-growth states

● Aim: generate regime probabilities from the real GDP data and make comparisons about the sequence of these states

62

Empirical Application

Page 63: Models with EViews Res. Asst. Gizem Uzunerfbemoodle.emu.edu.tr/pluginfile.php/47098/mod_resource/content/1...Models with EViews Asst. Prof. Dr. Kemal Bagzibagli Department of Economic

: unobserved MS variable such that

● Sjt = 1 if Sjt= j, and Sjt = 0 otherwise, for j = 0, 1, 2

63

Empirical ApplicationYilmazkuday and Akay (2008) - cont.

yt: percentage change in output

State-dependent Mean State-dependent Variance

Page 64: Models with EViews Res. Asst. Gizem Uzunerfbemoodle.emu.edu.tr/pluginfile.php/47098/mod_resource/content/1...Models with EViews Asst. Prof. Dr. Kemal Bagzibagli Department of Economic

St evolves according to the transition probabilities:

64

Empirical ApplicationYilmazkuday and Akay (2008) - cont.

Page 65: Models with EViews Res. Asst. Gizem Uzunerfbemoodle.emu.edu.tr/pluginfile.php/47098/mod_resource/content/1...Models with EViews Asst. Prof. Dr. Kemal Bagzibagli Department of Economic

65

Recession period: -0.88%Low growth regime: 0.65%High growth regime: 3.09%

Q/Q

Empirical ApplicationYilmazkuday and Akay (2008) - cont.

Page 66: Models with EViews Res. Asst. Gizem Uzunerfbemoodle.emu.edu.tr/pluginfile.php/47098/mod_resource/content/1...Models with EViews Asst. Prof. Dr. Kemal Bagzibagli Department of Economic

66

Empirical ApplicationYilmazkuday and Akay (2008) - cont.

Filtered probability of a recession

Page 67: Models with EViews Res. Asst. Gizem Uzunerfbemoodle.emu.edu.tr/pluginfile.php/47098/mod_resource/content/1...Models with EViews Asst. Prof. Dr. Kemal Bagzibagli Department of Economic

67

Empirical ApplicationYilmazkuday and Akay (2008) - cont.

Filtered probabilities of regimes with high-growth and low-growth

High growth regimeLow growth regimeHigh- and low-growth regimes do not move in a parallel fashion but follow each other!

Justification of the 3-state model

Page 68: Models with EViews Res. Asst. Gizem Uzunerfbemoodle.emu.edu.tr/pluginfile.php/47098/mod_resource/content/1...Models with EViews Asst. Prof. Dr. Kemal Bagzibagli Department of Economic

68

Empirical ApplicationYilmazkuday and Akay (2008) - cont.

Expected Durations of the States

0.803251

0.152326

0.156481 = 1 - 0.000165 - 0.843354 (Slides 17-18)

quarters

Expected durations vs. slide #20!

Page 69: Models with EViews Res. Asst. Gizem Uzunerfbemoodle.emu.edu.tr/pluginfile.php/47098/mod_resource/content/1...Models with EViews Asst. Prof. Dr. Kemal Bagzibagli Department of Economic

Comparison of AR(2) and Markov-switching AR(2)

69

Empirical ApplicationYilmazkuday and Akay (2008) - cont.

Page 70: Models with EViews Res. Asst. Gizem Uzunerfbemoodle.emu.edu.tr/pluginfile.php/47098/mod_resource/content/1...Models with EViews Asst. Prof. Dr. Kemal Bagzibagli Department of Economic

Applications with EViewsEstimation of the MS Models

Choose Switching Regression as the method of estimation.

70

Page 71: Models with EViews Res. Asst. Gizem Uzunerfbemoodle.emu.edu.tr/pluginfile.php/47098/mod_resource/content/1...Models with EViews Asst. Prof. Dr. Kemal Bagzibagli Department of Economic

Applications with EViewsEstimation of the MS Models (cont.)

The equation specification consists of a two-state Markov switching model ● with a single switching mean regressor C ● and the four non-switching AR terms.

71

Page 72: Models with EViews Res. Asst. Gizem Uzunerfbemoodle.emu.edu.tr/pluginfile.php/47098/mod_resource/content/1...Models with EViews Asst. Prof. Dr. Kemal Bagzibagli Department of Economic

Applications with EViewsEstimation of the MS Models (cont.)

● The error variance: assumed to be common across the regimes. ● The only probability regressor is the constant C since we have time-

invariant regime transition probabilities.

72

Page 73: Models with EViews Res. Asst. Gizem Uzunerfbemoodle.emu.edu.tr/pluginfile.php/47098/mod_resource/content/1...Models with EViews Asst. Prof. Dr. Kemal Bagzibagli Department of Economic

Applications with EViewsEstimation of the MS Models (cont.)

The top portion of the output ● describes the estimation settings

73

Page 74: Models with EViews Res. Asst. Gizem Uzunerfbemoodle.emu.edu.tr/pluginfile.php/47098/mod_resource/content/1...Models with EViews Asst. Prof. Dr. Kemal Bagzibagli Department of Economic

MS Models Estimation OutputThe middle section ● displays the coefficients for the regime specific mean

and the invariant error distribution coefficient

74

Page 75: Models with EViews Res. Asst. Gizem Uzunerfbemoodle.emu.edu.tr/pluginfile.php/47098/mod_resource/content/1...Models with EViews Asst. Prof. Dr. Kemal Bagzibagli Department of Economic

MS Models Estimation Output (cont.)The remaining results ● show the parameters of the transition matrix and

summary statistics for the estimated equation

75

Page 76: Models with EViews Res. Asst. Gizem Uzunerfbemoodle.emu.edu.tr/pluginfile.php/47098/mod_resource/content/1...Models with EViews Asst. Prof. Dr. Kemal Bagzibagli Department of Economic

MS Models Estimation Output (cont.)Transition matrix probabilities: View/Regime Results/Transition Results... OK

Default summary view:

76

Page 77: Models with EViews Res. Asst. Gizem Uzunerfbemoodle.emu.edu.tr/pluginfile.php/47098/mod_resource/content/1...Models with EViews Asst. Prof. Dr. Kemal Bagzibagli Department of Economic

MS Models Estimation Output (cont.)To display the filtered and full sample (smoothed) estimates of the probabilities of being in the two regimes.

● First select View/Regime Results/Regime Probabilities, and choose the filtered results.

● Results for the second regime

● Then repeat the procedure choosing the smoothed results.

EViews Tutorials77

Page 78: Models with EViews Res. Asst. Gizem Uzunerfbemoodle.emu.edu.tr/pluginfile.php/47098/mod_resource/content/1...Models with EViews Asst. Prof. Dr. Kemal Bagzibagli Department of Economic

References● EViews 8.1 User Guideline (http://www.eviews.

com/EViews8/ev8ecswitch_n.html#MarkovAR) ● Garcia, R., & Perron, P. (1996). An analysis of the real interest rate under

regime shifts. The Review of Economics and Statistics, 111-125.● Hamilton, J. D. (1989). A new approach to the economic analysis of

nonstationary time series and the business cycle. Econometrica: Journal of the Econometric Society, 357-384.

● Kim, C. J., & Nelson, C. R. (1999). State-space models with regime switching: classical and Gibbs-sampling approaches with applications (Vol. 2). Cambridge: MIT press.

● Yilmazkuday, H., & Akay, K. (2008). An analysis of regime shifts in the Turkish economy. Economic Modelling, 25(5), 885-898.

78