A Guide To Simulation With EVIEWS: November 2015
A Guide To Simulation With EVIEWS: November 2015
net/publication/315776479
CITATIONS READS
0 9,095
1 author:
Afees A. Salisu
Centre for Econometrics and Applied Research
331 PUBLICATIONS 6,946 CITATIONS
SEE PROFILE
All content following this page was uploaded by Afees A. Salisu on 04 April 2017.
(Version 7.0)
Afees A. Salisu
1.0 Preamble
Simulation involves solving for unknown values of the endogenous
variables in a model. A model in Eviews is a set of simultaneous
equations that are used for forecasting and simulation. Unlike other
objects in Eviews that contain system of equations, models do not
contain unknown coefficients to be estimated. Instead, models use
estimated coefficients and projected values of the exogenous variables to
simulate the unknown values for the endogenous variables.
1
Contacts: Department of Economics, Federal University of Agriculture Abeokuta & Centre for
Econometric & Allied Research, University of Ibadan, Ibadan, Nigeria. Email:
[email protected]; [email protected]. Phone: +2348034711769. Previous versions of this
guide using Eviews 3.1 and 4.1 were respectively written by Mathieu Lequain and Jung Hoon
Kim.
1
A Workfile Range window appears
Choose Workfile structure type, Frequency, Start date and End date
When you click OK, an Untitled Workfile appears with 2 items: C
and RESID
2
Load your data into Eviews
We can use the “drag & drop” method since all the variables are of
interest to us (see my presentation on Getting Started with Eviews 7).
The Eviews workfile is updated to include the new variables as shown
below:
3
The new variables included are cn - consumption, i - investment, m –
money supply, pc – personal consumption, ir – interest rate, and y –
income.
Click Objects in the Workfile toolbar / New Object / System. When you
click OK, an empty System Window should appear. In the dialog that
appears, type in a name for your model (say “CEAR”)
4
3.0 SPECIFYING A MODEL
5
In addition to the behavioural equations, some models may have
identities that allow the model to solve for the endogenous
variables.
Before trying to solve the model, we must make sure we have at
least as many equations as there are endogenous variables to solve
for in the model. We must set up our equations in a way that each
equation has a different endogenous variable as the first series on
the left-hand side.
6
PC, I and IR are endogenous variables; Y(-1), PC(-1), IR(-1), and
IR(-2) are predetermined variables while M and Y are exogenous
variables.
The estimation output obtained after applying OLS should appear like
the one shown below:
We have been previously taught how to estimate simultaneous-
equation models. Nonetheless, to estimate our model with OLS, click
estimate from the System Window / choose OLS estimator / OK
7
4.0 Model Simulation
This will require using the estimated coefficients above to predict all the
endogenous variables. Also, it allows for the consideration of different
scenario analyses. The following steps are involved:
To view all the equations, click Proc / Links / Break All Links
Note that the variables on the left hand side of the equations are the
endogenous variables while those on the right hand side are the
explanatory variables.
8
To view all the equations with their estimated coefficients, Click text
Note that these are the coefficients obtained after applying OLS.
9
4.2 Solving a Model
Having viewed the estimated equations, the next stage is to solve for the
endogenous variables. To do this, click on the solve button in the model
window button bar.
Let us consider the basic options shown in the dialog box above:
Simulation type:
Stochastic: With this option, the equations of the model are solved
and simulated with residuals. Also, the coefficients and exogenous
variables of the model are varied randomly. For stochastic
simulation, the model solution generates a distribution of
10
outcomes for the endogenous variables in every period. We
approximate the distribution by solving the model many times
using different draws for the random components in the model
then calculating statistics over all the different outcomes.
Dynamics
11
model). The predictive ability of the model can be evaluated based
on the in-sample simulation.
(i) Naive Method: The forecast for next period (say period T+1)
will be equal to the current period’s ( period T) value.
For example:
YT 1 YT
YT 2 YT 1
YT n YT n1
(ii) Simple Average Method: The forecast for next period (say
period T+1) will be equal to the average of all past historical
values.
For example:
T
1
YT 1
T
Y
t 1
t
12
1 T 1
YT 2 Yt
T 1 t 1
1 Tn1
YTn
T n 1 t1
Yt
(iii) Simple Moving Average Method: The forecast for next period
(say period T+1) will be equal to the average of a specified
number of the most recent observations, with each observation
receiving the same emphasis (weight).
For example:
YT YT 1 YT 2
YT 1
3
Y Y YT 1
YT 2 T 1 T
3
YT n1 YT n2 YT n3
YT n
3
(iv) Weighted Moving Average Method: The forecast for next period
(say period T+1) will be equal to a weighted average of a specified
number of the most recent observations.
For example:
13
we can assume w1 0.5; w2 0.3; w3 0.2
Or
Ft = At-1 + (1-)Ft-1
14
Solution sample:
16
You will observe that the solution is already saved as
“CEAR_SOLVE”
Check the workfile to view the baseline results for the endogenous
variables. The updated workfile should appear like this:
17
Note that _0 denotes Static-Deterministic Solution and it
distinguishes the baseline from the actual
We can compare the actual with the baseline graphically. To do
this, double click the filename for model solution “cear_solve” then
click Proc / Make Graph
18
11
10
4
80 82 84 86 88 90 92 94 96 98 00 02 04 06 08 10 12
I I (Baseline)
19
40
35
30
25
20
15
10
5
80 82 84 86 88 90 92 94 96 98 00 02 04 06 08 10 12
IR IR (Baseline)
13
12
11
10
5
80 82 84 86 88 90 92 94 96 98 00 02 04 06 08 10 12
PC PC (Baseline)
An Illustration:
21
The updated workfile is shown below:
22
Note _0m and _0s are for Static-Stochastic Solution.
Let us now consider out-of-sample simulation. Under this, we can
evaluate the impact of different scenarios on the endogenous
variables.
Recall, we have to first of all determine the future paths for all the
exogenous variables.
In the case of our model, we have two exogenous variables namely
Income (y) and Money Supply (m).
We can choose y as our policy variable while we allow m to follow
its natural pattern (Do nothing).
We can assume a three-year weighted moving average for
Money Supply with the most recent year, 0.5; year prior to
that, 0.3; year prior to that, 0.2:
23
The formula: m=0.5*m(-1)+0.3*m(-2)+0.2*m(-3)
To do this in Eviews, from the workfile window click genr
and type the formula.
Note that our out-of-sample period is 2011 to 2012
24
We can now simulate the endogenous variables given the projected
future paths of exogenous variables.
To do this, we need to first create a scenario to distinguish our
results from the previous ones.
We can use the default scenario (scenario 1) for the solution and
therefore simulation results produced under this will be suffixed
by _1
Let us now proceed to the out-of-sample simulation
From the model solution “cear_solve”,
Click solve /Deterministic / Dynamic solution / 2011 2012 / Solver
/ Gauss-Seidel / OK
25
By viewing the workfile, we can see that the number of objects has
increased to include the new results. Note the variables with _1;
they represent the out-of-sample forecasts for our endogenous
variables.
26
We can follow the same procedure for the second scenario which is to
reduce income by 5%
The formula: y=0.95*y(-1)
That is, from the workfile window, click genr and type the given
formula
27
The updated workfile is shown below with new results suffixed by _2
28
Allowing y to follow its natural path:
Like m, we can also assume a weighted moving average for y given
as: y=0.5*y(-1)+0.3*y(-2)+0.2*y(-3)
29
We can easily tabulate the simulation results and examine how the
endogenous variables respond to the three scenarios.
Period I_1 I_2 I_3 IR_1 IR_2 IR_3 PC_1 PC_2 PC_3
2010 10.01196 10.01196 10.01196 22.50833 22.50833 22.50833 12.30242 12.30242 12.30242
2011 15.98835 5.437221 10.39755 19.71778 25.89938 22.99327 12.86602 12.21942 12.5234
2012 21.5097 0.407454 10.44295 17.53704 27.99791 23.01273 13.65699 11.89575 12.73079
30
Thus, increasing the level of income appears to have beneficial
effects on the selected macroeconomic variables than reducing
it.
Also, increasing the level of y is preferred to leaving it to grow
naturally.
However, if the economy is not buoyant enough as to increase
the level of y by 5%; then, allowing it to follow its natural path is
preferred to reducing it by 5%.
I_1 > I_3 > I_2
IR_1 < IR_3 < IR_2
PC_1 > PC_3 > PC_2
Enjoy!!!!
31