model objects, policy simulations and forecasting: a step ... · out of sample forecasting eviews...

49
Model objects, Policy simulations and Forecasting in E-views: a step by step approach By Tinashe Bvirindi [email protected]

Upload: others

Post on 19-Mar-2020

10 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Model objects, Policy simulations and Forecasting: a step ... · Out of sample forecasting Eviews uses a Monte Carlo simulation technique to generate the uncertainty surrounding our

Model objects, Policy simulations and Forecasting in

E-views: a step by step approach

By

Tinashe Bvirindi

[email protected]

Page 2: Model objects, Policy simulations and Forecasting: a step ... · Out of sample forecasting Eviews uses a Monte Carlo simulation technique to generate the uncertainty surrounding our

Layout

• Model object creation

• Solving a model (in sample)

• Forecasting out of sample

• Conducting policy simulations and ploting response functions

Page 3: Model objects, Policy simulations and Forecasting: a step ... · Out of sample forecasting Eviews uses a Monte Carlo simulation technique to generate the uncertainty surrounding our

Modelling in E-views

•A model consists of a set of equations that jointly describe the relationship between a set of variables.

•The equations can be:• Simple Identities,•Results of single equations, or•Results of multiple equation estimators

Page 4: Model objects, Policy simulations and Forecasting: a step ... · Out of sample forecasting Eviews uses a Monte Carlo simulation technique to generate the uncertainty surrounding our

Modelling in E-views

• The equations are combined in a single object to derivedeterministic or stochastic joint forecasts or simulationsfor all the variables in the model.• Deterministic setting: model inputs are fixed at known values

and a single path is calculated for the output variable• Stochastic setting: uncertainty is incorporated into the model

by adding a random element to the coefficients, equationresiduals or exogenous variables

•Models allow us to conduct policy simulations

Page 5: Model objects, Policy simulations and Forecasting: a step ... · Out of sample forecasting Eviews uses a Monte Carlo simulation technique to generate the uncertainty surrounding our

Modelling in Eviews

• In Eviews for the model to have a unique solution, there should typically be as many equations as there are endogenous variables

• Each equatin in the model must have a unique endogenous variable assigned to it.

• Any variable that is not assigned as an endogenous variable is considered exogenous to the model.

Page 6: Model objects, Policy simulations and Forecasting: a step ... · Out of sample forecasting Eviews uses a Monte Carlo simulation technique to generate the uncertainty surrounding our

Creating a model object

To create a model object, click on Object, in the main window and select New Object

Page 7: Model objects, Policy simulations and Forecasting: a step ... · Out of sample forecasting Eviews uses a Monte Carlo simulation technique to generate the uncertainty surrounding our

Building a model

Now on the type of object, select Model and click OK

Give the model a name of your choice

Page 8: Model objects, Policy simulations and Forecasting: a step ... · Out of sample forecasting Eviews uses a Monte Carlo simulation technique to generate the uncertainty surrounding our

Model object

Page 9: Model objects, Policy simulations and Forecasting: a step ... · Out of sample forecasting Eviews uses a Monte Carlo simulation technique to generate the uncertainty surrounding our

Model object

• Equations in Eviews can either be inline or linked • Inline - the equation is specified as text within the model

• linked – the equation brings its specification into the model from an external eviews object e.g. a single equation object

• The advantage of linking is that it allows coupling of the model with the estimation procedure underlying the equations.

• Equations can either be stochastic equations or identities

Page 10: Model objects, Policy simulations and Forecasting: a step ... · Out of sample forecasting Eviews uses a Monte Carlo simulation technique to generate the uncertainty surrounding our

Creating a linked equation

To create a linked equation, right click on the equation of choice then copy it

Page 11: Model objects, Policy simulations and Forecasting: a step ... · Out of sample forecasting Eviews uses a Monte Carlo simulation technique to generate the uncertainty surrounding our

Creating a linked equation

Now take the copied equation and then paste it in this window

Page 12: Model objects, Policy simulations and Forecasting: a step ... · Out of sample forecasting Eviews uses a Monte Carlo simulation technique to generate the uncertainty surrounding our

Creating a linked equation

Select the yes to all option

Page 13: Model objects, Policy simulations and Forecasting: a step ... · Out of sample forecasting Eviews uses a Monte Carlo simulation technique to generate the uncertainty surrounding our

Linked equations

In this equation window all the pasted equations will appear, with a list of their explanatory variables

The scenario in question appears here

List of variables

Page 14: Model objects, Policy simulations and Forecasting: a step ... · Out of sample forecasting Eviews uses a Monte Carlo simulation technique to generate the uncertainty surrounding our

Linked equations

To views the variable dependencies and their classifications click on the Variables button

Exogenous variables are labelled and have an X

Endogenous variables are equation variables and have and En

Adds stands for add factors

Page 15: Model objects, Policy simulations and Forecasting: a step ... · Out of sample forecasting Eviews uses a Monte Carlo simulation technique to generate the uncertainty surrounding our

Advantage of linking the equations• Once we added our equations as linked equations we can go back and

re-estimate our equations and automatically update the model to the new estimates as follows:

Click on Proc, then select the Links button and click update all links and recompile

Page 16: Model objects, Policy simulations and Forecasting: a step ... · Out of sample forecasting Eviews uses a Monte Carlo simulation technique to generate the uncertainty surrounding our

Adding identities

• In order to add identities, right click the mouse while in the VIEW equation window.

Right click anywhere in this window and click on insert

Page 17: Model objects, Policy simulations and Forecasting: a step ... · Out of sample forecasting Eviews uses a Monte Carlo simulation technique to generate the uncertainty surrounding our

Adding identities

Once you select insert this dialogue box will appear and then you enter the identityinto the model source edit window and click OK

Page 18: Model objects, Policy simulations and Forecasting: a step ... · Out of sample forecasting Eviews uses a Monte Carlo simulation technique to generate the uncertainty surrounding our

Creating inline equations• To create an inline equation first copy the equation representations

First open the equation of choice and click on view, then select representations

Page 19: Model objects, Policy simulations and Forecasting: a step ... · Out of sample forecasting Eviews uses a Monte Carlo simulation technique to generate the uncertainty surrounding our

Creating inline equations

Once this output comes out copy the substituted coefficients

Page 20: Model objects, Policy simulations and Forecasting: a step ... · Out of sample forecasting Eviews uses a Monte Carlo simulation technique to generate the uncertainty surrounding our

Creating an inline equation

Click on the text toggle/ button and paste the copied equation into this window

Page 21: Model objects, Policy simulations and Forecasting: a step ... · Out of sample forecasting Eviews uses a Monte Carlo simulation technique to generate the uncertainty surrounding our

Inline equations

In order to view the dependence structure of the variables, click on variables

Then click Yes to save modifications and compile

Page 22: Model objects, Policy simulations and Forecasting: a step ... · Out of sample forecasting Eviews uses a Monte Carlo simulation technique to generate the uncertainty surrounding our

Inline equations

Click on view to see the equations or the block structure of the model

Block structure

Inline text equation

Page 23: Model objects, Policy simulations and Forecasting: a step ... · Out of sample forecasting Eviews uses a Monte Carlo simulation technique to generate the uncertainty surrounding our

Solving equations

• Once you have inputed all the equations into the model the next stepis to solve the model

• There are many options available for solving the model in Eviews• For now we concentrate on the basic techniques

• To solve the model simpy click on solve

• However, before we solve the data we may want to input theexogenous variables we wish to use in policy simulations as in linetext

Page 24: Model objects, Policy simulations and Forecasting: a step ... · Out of sample forecasting Eviews uses a Monte Carlo simulation technique to generate the uncertainty surrounding our

Solving the model

Click on text and type the variable you wish to employ in policy simulationsNB: this technique

is a shortcut and is sometimes not advisable

Page 25: Model objects, Policy simulations and Forecasting: a step ... · Out of sample forecasting Eviews uses a Monte Carlo simulation technique to generate the uncertainty surrounding our

Solving the model

Click on solve and then click on YesTo save and compile modifications

Page 26: Model objects, Policy simulations and Forecasting: a step ... · Out of sample forecasting Eviews uses a Monte Carlo simulation technique to generate the uncertainty surrounding our

Solving the model Once you click save this dialogue box will appear

Choose baseline scenarioClick on deterministic

Select static solution for model evaluation

Adjust the sample size over which to solve the model to avoid initialising the model on missing values

Page 27: Model objects, Policy simulations and Forecasting: a step ... · Out of sample forecasting Eviews uses a Monte Carlo simulation technique to generate the uncertainty surrounding our

Solving the model

• Once you have set all the conditions click OK to solve the model

• You will then receive the following solution message

Page 28: Model objects, Policy simulations and Forecasting: a step ... · Out of sample forecasting Eviews uses a Monte Carlo simulation technique to generate the uncertainty surrounding our

Workfile appearance after initial solve

The solution of the baseline scenario is saved with and underscore of zero in the workfile

Page 29: Model objects, Policy simulations and Forecasting: a step ... · Out of sample forecasting Eviews uses a Monte Carlo simulation technique to generate the uncertainty surrounding our

Forecasting- static solution

Plot the baseline lm3 from the static solution against the actual lm3

Page 30: Model objects, Policy simulations and Forecasting: a step ... · Out of sample forecasting Eviews uses a Monte Carlo simulation technique to generate the uncertainty surrounding our

Forecast- dynamic solution (recursive)

Re-solve the model but this time selecting the dynamic solution and plot the baseline from the dynamic solution against the actual

This result shows how the model Would have performed if we had used it back in 2000

If satisfied with performance of the model against historical date we can use the model to forecast future values of endogenous variables

Page 31: Model objects, Policy simulations and Forecasting: a step ... · Out of sample forecasting Eviews uses a Monte Carlo simulation technique to generate the uncertainty surrounding our

Forecasting out of sample• First step is to decide on the value of exogenous variables.

• If they are not available the re is need to provide these.

Page 32: Model objects, Policy simulations and Forecasting: a step ... · Out of sample forecasting Eviews uses a Monte Carlo simulation technique to generate the uncertainty surrounding our

Out of sample forecasting Eviews uses a Monte Carlo simulation technique to generate the uncertainty surrounding our forecasts

To generate this graph, click the solve button and in the model solution dialogue select stochastic, and tick the standard deviation box in Active and click OK

Then go to Proc, Make graph, and in the solution series box select mean+2s.d and reset sample period to 2003Q1 to 2011Q4, and click OK

Page 33: Model objects, Policy simulations and Forecasting: a step ... · Out of sample forecasting Eviews uses a Monte Carlo simulation technique to generate the uncertainty surrounding our

Policy simulations • Having satisfied ourselves of our model’s capabilities in and outside

the sample we may conduct policy simulations

• In the policy simulations, we are mainly interested in the impact that the exogenous variable will have on the endogenous variables and ultimately on our model• Economists- interest is to assess the effect of policy variable on

macroeconomic aggregates

• Risk manager/ supervisor- interest is to determine the level of stress that an external event may induce on the endogenous variables

Page 34: Model objects, Policy simulations and Forecasting: a step ... · Out of sample forecasting Eviews uses a Monte Carlo simulation technique to generate the uncertainty surrounding our

Policy simulations

• Step 1: create a scenario

In the model object window click on View, then select Scenarios

Page 35: Model objects, Policy simulations and Forecasting: a step ... · Out of sample forecasting Eviews uses a Monte Carlo simulation technique to generate the uncertainty surrounding our

Policy simulations

Click on create new and then OK

Page 36: Model objects, Policy simulations and Forecasting: a step ... · Out of sample forecasting Eviews uses a Monte Carlo simulation technique to generate the uncertainty surrounding our

Policy simulations

Click on the Variables button

Page 37: Model objects, Policy simulations and Forecasting: a step ... · Out of sample forecasting Eviews uses a Monte Carlo simulation technique to generate the uncertainty surrounding our

Policy simulations

Right click on the exogenous variable of interest and the select properties on the drop down menu

Page 38: Model objects, Policy simulations and Forecasting: a step ... · Out of sample forecasting Eviews uses a Monte Carlo simulation technique to generate the uncertainty surrounding our

Policy simulations

Tick in the use override series in scenario and click OK

Page 39: Model objects, Policy simulations and Forecasting: a step ... · Out of sample forecasting Eviews uses a Monte Carlo simulation technique to generate the uncertainty surrounding our

Policy simulation

Once the variable is set the text changes to red

Page 40: Model objects, Policy simulations and Forecasting: a step ... · Out of sample forecasting Eviews uses a Monte Carlo simulation technique to generate the uncertainty surrounding our

Policy simulation- temporary shock

• Lets assume a temporary shock of a sudden increase in nominal income of 10% per quarter for the period 2001Q1 to 2003Q3

• To do policy simulation we make use of a very simple command

Set the period over which the shock takes placeAnd calibrate the shock

Page 41: Model objects, Policy simulations and Forecasting: a step ... · Out of sample forecasting Eviews uses a Monte Carlo simulation technique to generate the uncertainty surrounding our

Policy simulation

• Once the sample size is set and the shock is specified then we proceed to solve the model

Click on solve in the model object window

Page 42: Model objects, Policy simulations and Forecasting: a step ... · Out of sample forecasting Eviews uses a Monte Carlo simulation technique to generate the uncertainty surrounding our

Policy simulation

Reset simulation type to deterministic

Set the interval over which you want to estimate

Make sure the set scenario is active and click ok

Page 43: Model objects, Policy simulations and Forecasting: a step ... · Out of sample forecasting Eviews uses a Monte Carlo simulation technique to generate the uncertainty surrounding our

Policy simulations

Solution message for the scenario

Page 44: Model objects, Policy simulations and Forecasting: a step ... · Out of sample forecasting Eviews uses a Monte Carlo simulation technique to generate the uncertainty surrounding our

Plotting the results

Whilst still in the model object click on the Proc Button and select the make graph option

Page 45: Model objects, Policy simulations and Forecasting: a step ... · Out of sample forecasting Eviews uses a Monte Carlo simulation technique to generate the uncertainty surrounding our

Policy simulation: shock vs baseline

Make sure that the actuals and scenario are selected

Reset horizon and click OK

Select list of variables and list endogenous variables

Page 46: Model objects, Policy simulations and Forecasting: a step ... · Out of sample forecasting Eviews uses a Monte Carlo simulation technique to generate the uncertainty surrounding our

Policy shock simulation

Page 47: Model objects, Policy simulations and Forecasting: a step ... · Out of sample forecasting Eviews uses a Monte Carlo simulation technique to generate the uncertainty surrounding our

IMPULSE RESPONSE OF LM3 TO LNGDP

Money supply has a lagged response to income, relationship is error correcting, shocks die down after about 5 years

Page 48: Model objects, Policy simulations and Forecasting: a step ... · Out of sample forecasting Eviews uses a Monte Carlo simulation technique to generate the uncertainty surrounding our

Class exercise1. Estimate the following error correction models:

• D(LSTCKPR) LSTCKPR(-1) LTDC(-1) LCPI(-1) LP_R(-1) C D(LTDC(-1)) D(LCPI(-4)) D(LP_R(-1)) D(LSTCKPR(-1))

• D(LM3) LM3(-1) LNGDP(-1) LCPI(-1) LP_R(-1) C D(LM3(-1)) D(LCPI(-3)) D(LNGDP(-4)) D(LP_R(-4))

• D(LTDC) LTDC(-1) LR(-1) LM3(-1) LNGDP(-1) LNEER(-1) C D(LR(-1)) D(LTDC(-1)) D(LM3(-1)) D(LNGDP(-3)) D(LNEER(-2))

2. Create a model object with the three equations and solve it.

3. Perform an in sample forecast and produce an out of sample forecast showing the level of uncertainty associated with the forecast.

4. Trace the impact of an increase in GDP on money demand, the stock price and domestic credit and comment

5. Plot the impulse response function

Page 49: Model objects, Policy simulations and Forecasting: a step ... · Out of sample forecasting Eviews uses a Monte Carlo simulation technique to generate the uncertainty surrounding our

References