SlideShare a Scribd company logo
EViews Training
Basic Forecasting
Note: Data and workfiles for this tutorial are provided in:
 Data: Data.xls
 Results: Results.wf1
 Practice Workfile: Data.wf1
Data and Workfile Documentation
2
• Data.wf1 and Data.xls have monthly data from January 1960-March 2013.
 payroll – employment levels, thousands of employees (source: Bureau of Labor
Statistics)
 IP –industrial production, index levels (source: Board of Governors of the Federal
Reserve)
 ISM – The Institute for Supply Management Manufacturing Index, Index level
(source: St. Louis’ FRED Database).
 Tbill 3M– 3-month US Treasury rate (source: Board of Governors of the Federal
Reserve)
Data and Workfile Documentation (cont’d)
3
• The spreadsheet produced here
shows the data series at the end of
the workfile range.
• Note that historical data are
available for all data series up until
March 2013.
• From 2013m04 until the end of the
workfile range, we have provided
forecasts for series IP, ISM, TBill3m.
• We will create a few equations to
forecast the payroll series using
EViews.
Forecasting
• EViews offers a powerful and easy-to-use forecasting tool that allows you to
obtain forecasts from your estimated models.
• Of course, the accuracy of the forecasts depends on the model used to
produce the forecasts: EViews simply handles the mechanics of producing the
forecasts.
• This tutorial explains the basic procedures for forecasting from a single
equation. The tutorial assumes knowledge of estimating equations in EViews.
• The main topics of this tutorial are:
 Forecast Basics (Static vs. Dynamic, Forecast Evaluation, Errors and Variances)
 With exogenous variables
 With lagged dependent variables
 With lagged dependent variables and ARMA terms
Forecasting with Auto-series
4
Forecasting with Exogenous Variables
Example 1
• 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.
5
Example 1: Estimation
1. Type in the command window:
ls payroll c @trend @expand(@month, @dropfirst)
2. Press Enter (save this equation as eq01).
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.
*Note: This equation is saved as eq01 in
Results.wf1 workfile.
Forecasting with Exogenous Variables
Example 1 (cont’d)
• Estimation output is shown here. Note that
EViews has estimated the model over the
period 1960m01 to 2013m03, for which we
have payroll data.
• We also plot the actual and fitted values of
the model (shown below), by pressing
View → Actual, Fitted, Residual →
Actual Fitted Residual Graph.
6
Forecasting with Exogenous Variables
Example 1: Forecasting
• Now, let’s produce a forecast for the payroll series based on our model.
• For this, all we have to do is press the button in the equation toolbar.
7
Example 1: Forecasting
1. Open eq01. On the equation box toolbar,
press the button. The Forecast
dialog box opens up.
2. 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.
3. Under Forecast sample, select the sample
over which the forecast will be carried out.
Here we type, 2013m04 @last.
4. Check “Insert actuals for out-of-sample
observations.”
5. Under Method, notice that EViews indicates
this is a Static forecast (no dynamics in the
equation) (more details later).
6. Under Output, check Forecast graph and
Forecast evaluation.
7. Click OK.
Forecasting with Exogenous Variables
Example 1: Forecasting (cont’d)
• The Forecast Output is shown here.
Notice that EViews shows the series
Eq01_f over the forecast sample,
together with 2 standard error bands.
8
*Note: This output is saved as graph01 in
Results.wf1 workfile.
Forecasting with Exogenous Variables
Example 1: Forecasting (cont’d)
• Note also that there is now a new series eq01_f saved in
the workfile. Let’s open this series and the original payroll
series as a group to inspect them more closely.
• Notice that the two series are identical when looking at the
historical data. This is because we elected to check the
box “Insert actuals for out-of-sample observations”
which instructs EViews to use actual payroll data for the
out-of-forecast sample.
• However, the eq01_f series contains actual forecasts of
the payroll series for future periods. How does EViews
compute these values?
• Recall that the explanatory variables in this model are
@trend and seasonal factors. EViews computes the
forecast for April 2013 as follows:
 @trendApril 2013 = 639; @trend coefficient=144.4909
 @month=4; @month=4 coefficient 1,476.381.
 constant=51,730.04
 eq01_f April 2013= 51,730.04+144.4909*639+1,476.381*1
=145,536.076
9
Forecasting with Exogenous Variables:
Example 1: Forecast Sample Changes
• What would happen if we set the forecast sample to be the entire range of the
workfile?
10
Example 1: Forecast Sample Changes
1. Open eq01 and press the button. The
Forecast dialog box opens up.
2. Under Series name, name the new
forecasted series eq01_f3.
3. Set all the other options as we did before
(check Forecast graph and Forecast
evaluation, check “Insert actuals for out-
of-sample observations.”
4. Under Forecast Sample, set the sample to
the entire workfile range (1960m01
2014m12).
5. Click OK.
Forecasting with Exogenous Variables
Example 1: Forecast Evaluation
• The Forecast Output is shown here. Notice that EViews has computed eq01_f3 and the
corresponding standard error bands over the entire sample. Notice also that, in addition to
the graph, EViews has produced a small table: this is the Forecast Evaluation table.
11
Although, we had checked the
Forecast evaluation box in the
previous illustrations, EViews was
unable to produce an output
when the forecast sample was
set for future periods (2013m04
to 2014m012).
This is because EViews could not
check how well the forecasting
model works since the payroll
data beyond 2013m03 is missing.
We would have to wait until a
future date when payroll data
becomes available in order to
compare our forecasts with what
actually happens.
When we set the forecast sample to the entire workfile range (or
a sample that includes actual historical data), it is possible to
check for forecast accuracy. EViews compares the forecasted
(predicted) values from the model (over the period 1960m01 to
2013m03) to the actual data and computes the forecast
evaluation table.
*Note: This output is saved as
graph02 in
Results.wf1 workfile.
Forecasting with Exogenous Variables
Example 1: Forecast Evaluation (cont’d)
• We can inspect in more detail the
differences between the actual
payroll series and the forecasted
eq01_f3 series. We can open them
as a group and plot them together.
• As seen from the graph, values
differ over the historical range
(1960m01 to 2013m03) because
eq01_f3 series comes from the fitted
values of eq01, whereas the payroll
series contains actual data.
• Of course, the eq01_f3 series is
also longer because it includes the
future (predicted values) over the
period 2013m04 to 2014m12.
12
Forecasting with Exogenous Variables
In-Sample vs. Out-of-Sample Forecasts
• Notice that the Forecast evaluation in the previous example, simply compares the
predicted values from the model to the actual data over the “historical” period
(1960m01 to 2013m03).
• Note also that our model was estimated over the same period (1960m01 to 2013m03).
In a sense, the “forecast” evaluation was carried out in-sample and not out-of-sample.
• In fact, since we don’t have “actual” payroll data over the 2013m03 to 2014m12 period
(the “true” forecast period), it is impossible for us to see how well our model performs
out-of-sample.
• This is problematic because the history of forecasting is replete with cases when
models work well in-sample but perform extremely poorly out-of-sample.
• A common practice to address this issue is to reserve part of the data by not including it
in the estimation sample, effectively pretending that the history ends sooner and the
reserved data is part of the future (part of forecasts).
• We can then produce forecasts over the reserved sample and perform forecast
evaluation by comparing the out-of-sample forecast values to the actual history.
13
Forecasting with Exogenous Variables
Example 2: Out-of-Sample Forecasts
• Let’s carry out Example 1 by breaking down the sample as follows:
Estimation Sample: 1960m01 to 2008m12
Forecast Sample: 2009m1 to 2014m12
14
Example 2: Estimation
1. Type in the command window:
smpl 1960m01 2008m12
ls payroll c @trend
@expand(@month,@dropfirst)
2. Press Enter after each command
line (the second command should
be typed in one line). Save this
equation as eq02.
Forecasting with Exogenous Variables
Example 2: Out-of-Sample Forecasts (cont’d)
• Now, let’s produce a forecast for the payroll series using the forecast sample.
15
Example 2: Forecasting
1. Open eq02. On the equation box toolbar,
press the button. The Forecast
dialog box opens up.
2. Under Series name, name the series
eq02_f.
3. Under the Forecast sample, type the
forecast sample (here, 2009m1
2014m12).
4. Set all the other options as we did
previously (check Forecast graph,
Forecast evaluation, and Insert actuals
for out-of-sample observations).
5. Click OK.
Forecasting with Exogenous Variables
Example 2: Out-of-Sample Forecasts (cont’d)
• The Forecast Output is shown here (note that we have removed the forecast evaluation
table, which we discuss next).
• 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 ).
16
Forecast Graph Payroll vs eq02_f
*Note: This output is saved as graph04 in
Results.wf1 workfile.
*Note: This output is saved as graph05 in
Results.wf1 workfile.
Forecasting with Exogenous Variables
Example 2: Forecast Evaluation Details
• Let’s take a closer look at the Forecast Evaluation Table shown here.
17
Forecast Evaluation
First, notice that the forecast evaluation is
saved in two formats. If you check the box
(Forecast graph), the forecast evaluation table
is included along with the forecast graph (the
first table shown here is copied from this
option). If you uncheck Forecast graph, the
Forecast evaluation is shown in a separate
table (the second table shown here).
EViews indicates the number of observations
used to perform the forecast evaluation. Here
we have 51 periods, which span the period
from 2009m01 to 2013m03. Note that for the
remaining period (2013m03 to 2014m12),
EViews does not carry out a forecast
evaluation because the values of the
dependent variable (payroll) are missing.
*Note: This output is saved as table01 in
Results.wf1 workfile.
Forecasting with Exogenous Variables
Example 2: Forecast Evaluation Details (cont’d)
18
Forecast Evaluation (cont’d)
The reported forecast statistics indicate that our forecasting
model does not perform well out-of-sample.
The Root Mean Squared Error (RMSE) is the standard
deviation of the forecast errors. This is quite large when
compared to the standard deviation of payroll series.
Note that RMSE and Mean Absolute Error depend on
the scale of the dependent variable, while the next two
statistics (Mean Abs. Percent Error and Theil
Inequality Coefficient) are scale invariant. The Theil
Coefficient lies between 0 and 1, with 0 indicating a
perfect fit.
Bias Proportion – indicates how far is the mean of the
forecast from the mean of the actual series.
 Variance Proportion – indicates how far is the variance
of the forecasts from the variance of the actual series.
Covariance Proportion – measures the remaining
unsystematic forecasting errors.
If the forecasts are “good” the bias and variance
proportions should be small (which is not the case here).
Note that the Bias, Variance and Covariance Proportions
add up to 1 (they are given as proportions out of 1).
Forecasting with Exogenous Variables
Example 3: Forecasted Explanatory Variables
• In order to be able to produce an out-of-sample forecast, we need to know the future values
for all explanatory (right-hand-side) variables.
• This was easy enough so far, because we used @trend and seasonal factors to forecast our
dependent variable. EViews easily produces “forecasts” for trend variable, and seasonal
factors are set as @month=1, @month=2, etc.
• However, for most explanatory variables, we need to provide values over the forecast period.
• For example, suppose we want to forecast payroll using ip, ism and tbill3m as additional
explanatory variables. As shown previously (and in the graphs below), we have provided data for
the explanatory variables over the forecast period (2009m01 to 2014m12).
19
Forecasting with Exogenous Variables
Example 3
• Let’s define the sample objects by typing in the command window:
sample sample_est @first 2008m12
sample sample_for 2009m01 @last
20
Example 3: Estimation
1. Type in the command window:
smpl sample_est
ls payroll c ip ism tbill3m
@trend @expand(@month,@droplast)
2. Press Enter after each command line (the
second command should be typed in one
line).
*Note: This equation is saved as eq03 in
Results.wf1 workfile.
Forecasting with Exogenous Variables
Example 3: Forecasting
• Now, let’s produce a forecast for the payroll series with this model.
21
Example 3: Forecasting
1. Open eq03. On the equation box toolbar,
press the button. The Forecast
dialog box opens up.
2. Under Series names, type the name of
the forecasted series eq03_f in the
Forecast name field.
3. Under Series names, S.E. (optional)
field, type the name of standard errors
series. This creates and saves a new
series eq03_stdev.
4. Under Forecast sample, type the forecast
sample sample_for.
5. Set all the other options as follows: check
Forecast graph, Forecast evaluation,
and uncheck Insert actuals for out-of-
sample observations.
6. Click OK.
Forecasting with Exogenous Variables
Example 3: Forecasting (cont’d)
• The Forecast Output is shown here (note that we have removed the forecast evaluation
table, which we discuss below).
• We can also plot the actual forecast series against the forecast and the two standard error
bands by typing in the command window:
smpl 2009m01 @last
plot payroll eq03_f eq03_f+2*eq03_stdev eq03_f-2*eq03_stdev
22
Forecast Graph Payroll, eq03_f and Confidence Bands
*Note: This output is saved as graph06 in
Results.wf1 workfile. *Note: This output is saved as graph07 in
Results.wf1 workfile.
Forecasting with Exogenous Variables
Example 3: Forecast Evaluation
• The Forecast Evaluation output
from this model is shown here. As
you can see, the Bias Proportion is
still large, indicating that the
forecast is not “very good.”
• Nonetheless, this model performs
considerably better than eq02
(RMSE is lower than eq02, the
Mean Absolute Percentage Error is
lower, and even the Bias Proportion
is lower).
23
*Note: This output is saved as table02 in
Results.wf1 workfile.
Forecasting with Lagged Dependent
Variables
Forecasting with Lagged Dependent Variables
• Oftentimes, time series models used for forecasting include a lagged
dependent variable.
• The presence of a lagged dependent variable complicates forecasting
because there is an issue as to how to evaluate the dependent variable
that appears on the right-hand side of the equation.
• EViews offers two ways to deal with lagged dependent variables:
Dynamic Forecasting
Static Forecasting
• Dynamic forecasting uses the forecasted value of the lagged dependent
variable.
• Static forecasting uses the actual value of the lagged dependent
variable (if it is available).
• For out of sample forecasting, dynamic forecasting is usually the only
possible approach (due to the lack of actual data, static forecasting is
impossible).
25
Forecasting with Lagged Dependent Variables
Example 4
26
Example 4: Estimation
1. Let’s first specify a model with lagged dependent variable on the right-hand side of the equation.
Type in the command window:
smpl sample_est
ls payroll c payroll(-1) payroll(-2) @trend @expand(@month, @droplast)
2. Press Enter.
*Note: This equation is saved as eq04
in Results.wf1 workfile.
Forecasting with Lagged Dependent Variables
Example 4 (cont’d)
• We also plot the actual and the fitted
values of the model (shown below), by
pressing View → Actual, Fitted, Residual
→ Actual Fitted Residual Graph. The
model seems to perform better now (the fit
appears better) when a lagged dependent
variable is included.
27
Forecasting with Lagged Dependent Variables
Example 4: Dynamic Forecast
• Now, let’s produce a Dynamic Forecast for the payroll series based on our model.
28
Example 4: Dynamic Forecast
1. Open eq04. On the equation box toolbar,
press the button. The Forecast
dialog box opens up.
2. Under Series names, name the series
eq04_dyn in Forecast name field. Under
S.E. (optional) field, type the name of
standard errors series eq04_stdev_dyn.
3. Under Forecast sample, type the forecast
sample sample_for. Set all the other
options as follows: check Forecast graph,
Forecast evaluation, and check Insert
actuals for out-of-sample observations.
4. Notice that under Method, you now can
choose between Dynamic Forecast and
Static Forecast. Let’s choose Dynamic
Forecast here.
5. Click OK.
Forecasting with Lagged Dependent Variables
Example 4: Dynamic Forecast (cont’d)
• The Forecast Output is shown here. Notice that EViews produces forecast values for
payroll series over the entire forecast sample: 2009m1 to 2014m12.
• You can also see that the confidence error bands widen dramatically towards the end of
the forecast sample. This is because dynamic forecasting uses the forecast values of the
lagged dependent variables. The forecast errors tend to compound over time resulting in
larger error bands the further out we are in the forecast sample.
29
How are Dynamic Forecasts Performed?
The first forecasted value (2009m01)
uses the actual value of 2008m12
(payroll(-1)) and the actual value of
2008m11 (payroll (-2)).
The second forecasted value
(2009m02) uses the forecasted value
of 2009m01 (payroll (-1); estimated
previously) and the actual value of
2008m12 (payroll(-2)).
 The third forecasted value (2009m03)
uses the forecasted value of 2009m02
(payroll (-1); estimated in step 2) and
the forecasted value of 2009m01
(payroll(-2); estimated in step 1).
*Note: This output is saved as graph09 in
Results.wf1 workfile.
Forecasting with Lagged Dependent Variables
Example 4: Static Forecast
• Let’s now produce a Static Forecast of the payroll series based on the same
model.
30
Example 4a: Static Forecast
1. Open eq04. Follow steps 1-3 as in the
previous example (naming the forecast
series eq04_stat and its standard
deviation eq04_stdev_stat).
2. Under Method, select Static Forecast.
3. Click OK.
Forecasting with Lagged Dependent Variables
Example 4: Static Forecast (cont’d)
• The Forecast Output is shown here. A few things stand out.
• First, notice that the forecast sample is adjusted to include the period only from 2009m01
to 2013m04 and not the entire forecast sample (2009m01 to 2014m12).
• This is because static forecasts are one-step ahead forecasts only. They use actual
values of lagged dependent variables in order to perform the forecast. Since we have
actual data for payroll series only up until 2013m03, EViews can only produce forecasts
for the period from 2009m01 to 2013m04 .
31
How are Static Forecasts Performed?
The first forecasted value (2009m01)
uses the actual value of 2008m12
(payroll(-1)) and the actual value of
2009m11 (payroll (-2)).
The second forecasted value
(2009m02) uses the actual value of
2009m01 (payroll (-1)) and the actual
value of 2008m12 (payroll(-2)).
The third forecasted value (2009m03)
uses the actual value of 2009m02
(payroll (-1)) and the actual value of
2009m01 (payroll(-2)). *Note: This output is saved as graph10 in
Results.wf1 workfile.
Forecasting with Lagged Dependent Variables
Example 4: Dynamic vs. Static Forecast
• Let’s compare the two forecasts more directly. For this, open series payroll, eq04_dyn
and eq94_stat as a group and plot the series against each other (you can change the
sample by typing smpl @all in the command line to get the entire sample and smpl
sample_for for the forecast sample).
The static forecast performs much better than the dynamic forecast because it uses actual
instead of the forecasted lagged values over the forecast period.
The historical values are the same because we checked Insert actuals for out-of-sample
observations in both cases.
32
*Note: This output is saved as graph11 in
Results.wf1 workfile.
*Note: This output is saved as graph12 in
Results.wf1 workfile.
Forecasting with ARMA Errors
Forecasting with AR terms
Example 6
• Models with ARMA terms are also widely used in forecasting.
• The presence ARMA terms involve some additional complexities in forecasting, which we
highlight in this section.
34
Example 6: 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)
2. Press Enter (the second command
should be typed in one line).
*Note: This equation is saved as eq06
in Results.wf1 workfile.
Forecasting with AR Terms
Example 6: Forecasting with AR terms
• Let’s produce dynamic and static forecast for the AR(2) model we just
estimated.
35
Example 6: Forecasting with AR terms
1. 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.
2. 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.
3. Click OK.
Forecasting with AR Terms
Example 6: Forecasting with AR terms (cont’d)
• 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.
• In the dynamic forecast (top graph), the
lagged residuals are forecasted
dynamically. This means that future values
of lagged residuals are formed using the
36
Forecasting with AR Terms
Example 6: Forecasting with AR terms (cont’d)
• There are cases when you may wish to assume that the ARMA errors are zero.
• For this, we can select the Structural (ignore ARMA) box under Method.
37
Example 6a: Forecasting with AR terms
1. Open eq06 and click the button.
As usual, the Forecast dialog box opens
up. Name the series eq06_dyn2 for the
dynamic series and eq06_stat2 for the
static forecast series.
2. 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.
3. Check Structure (ignore ARMA) box
under Method.
4. Click OK.
Forecasting with AR Terms
Example 6: Forecasting with AR terms (cont’d)
• The graphs shown here plot the forecasted
values for both methods (dynamic and static)
when ARMA terms are included (eq06_dyn or
eq06_stat) or ignored (eq06_dyn2 or
eq06_stat2).
• First, it is important to note that the static and
dynamic forecasts obtained by ignoring ARMA
terms are identical (you can see this by plotting
eq06_dyn2 against eq06_stat2; not shown here).
This is expected, since static and dynamic
forecasts differ only if there are lagged dependent
variables or ARMA terms. If we choose to ignore
the ARMA terms, there are no differences
between the two.
• Note also that the static forecasts when ARMA
terms are ignored are provided for the entire
forecast period (bottom graph). This was possible
since we know the values of all exogenous
variables over the entire forecast sample.
• For both dynamic and static forecasts, ignoring
ARMA terms produces “worse” forecasts than
when ARMA terms are included.
38
Forecasting with MA terms
Example 8
• It is just as easy in EViews to produce forecasts from models with MA errors.
39
Example 8: 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)
2. Press Enter (the second command
should be typed in one line).
*Note: This equation is saved as eq08
in Results.wf1 workfile.
Forecasting with MA Terms
Example 8: Forecasting
• Let’s produce dynamic and static forecast for the MA(1) model we just estimated.
40
Example 8: Forecasting with MA terms
1. Open eq08 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.
3. 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.
4. Click OK.
Forecasting with MA Terms
A Few (technical) Notes
41
• A few notes before we show the results:
• The Estimation period method for MA backcasting uses data for the estimation sample
to compute backcast estimates.
 Innovations beyond the estimation sample are set to 0. EViews then uses the unconditional
residuals to obtain the pre-estimation sample residuals.
• The Forecast available (v5) method for MA backcasting, proceeds with different
approaches for dynamic and static forecasting.
Dynamic forecasting – EViews applies the backcasting procedure using data from the
beginning of the estimation sample to either the beginning of the forecast period or the end of
the estimation sample (whichever comes first).
Static forecasting – EViews applies the backcasting procedure using data from the beginning of
the estimation sample to the end of the forecast period.
Forecasting with MA Terms
A Few (technical) Notes (cont’d)
• After obtaining the MA backcast estimates of the pre-estimation residuals (using
either Estimation period or Forecast available (v5)), forward recursion is used to
obtain values for the pre-forecast sample innovations.
Dynamic forecasting – We only need to obtain innovation values for the q periods (where q
denotes the order of the MA process) prior to the start of the forecast sample. All
subsequent innovations are set to 0. In the current example of MA(1) error terms, we need
only obtain innovation values 1 period prior to the start of the forecast sample.
Static forecasting – The forward recursion is carried out through the end of the forecast
period.
42
Forecasting with MA Terms
Example 8 (cont’d)
43
• The Forecast Output for both methods are
shown here.
• Because the forward recursion for static
forecasts are performed through the end of the
forecast period, EViews is able to produce
Static forecasts that cover the entire forecast
sample (2013m04 to 2014m12).
• Moreover, beyond 2013m04, forecasts from
Dynamic and Static model are identical (this is
because the forward recursion used to obtain
the pre-forecast sample innovations produces
same innovations after the end of the historical
in 2013m03).
Forecasting with Auto-Series
Forecasting with Auto-Series
Example 9
• One of the most useful features in EViews is the ability to estimate and forecast from
equations that are specified using expressions or auto-series.
• Issues with auto-series normally arise when the dependent variable is specified using an
expression. In this section we illustrate through a number of examples how EViews
performs forecasts in these cases.
45
Example 9: Auto-Series and Forecasting
1. Type in the command window:
smpl sample_est
ls log(payroll) c ip ism tbill3m
@trend @expand(@month, @dropfirst)
2. Press Enter (the second command should be
typed in one line).
*Note: This equation is saved as eq09
in Results.wf1 workfile.
Forecasting with Auto-Series
Example 9 (cont’d)
• Now let’s press the button. The Forecast dialog box offers a couple of
options now which we have not seen before.
46
Example 9: Auto-Series and Forecasting
1. Open eq09 and click the button.
As usual, the Forecast dialog box opens
up.
2. Notice here that at the top of the dialog box
there is a new section: Series to forecast.
Here you can choose to forecast either the
underlying series (payroll) or the auto-
series (log(payroll)). Let’s do both, first
forecasting levels and then logs (we name
the level forecast eq09_level and the log
eq09_log).
3. Notice that since this equation does not
have a dynamic structure, only the Static
method is available.
4. Click OK.
Forecasting with Auto-Series
Example 9 (cont’d)
47
• The Forecast Output for both level and log forecasts is shown here.
Forecast of Log(Payroll)
Forecast of
Levels
*Note: This output is saved as graph24
in Results.wf1 workfile.
*Note: This output is saved as graph25
in Results.wf1 workfile.
Forecasting with Auto-Series
Example 10
• We can just as easily estimate first differences using auto-series.
48
Example 10: Auto-Series and Forecasting
1. Type in the command window:
smpl sample_est
ls d(payroll) c ism tbill3m
@expand(@month, @droplast)
2. Press Enter (the second command should be typed
in one line). Save this as eq10.
3. Open eq10 and click the button. Notice that
in the Series to forecast section you can choose to
forecast either the underlying series (payroll) or the
auto-series (d(payroll)). Let’s try to forecast the first
differences.
4. It is important to note that now the Dynamic
forecast option is available; EViews is able to
determine that the forecast equation has dynamic
elements (we have saved the dynamic forecasts as
eq10_diff_dyn and static forecasts as
eq10_diff_stat).
5. Click OK.
*Note: This equation is saved as eq10
in Results.wf1 workfile.
Forecasting with Auto-Series
Example 10 (cont’d)
49
• The Forecast Output for both Dynamic
and Static methods are shown here.
• Note that the forecasts for both methods
are the same, since the equation is not
truly “dynamic” (the lagged dependent
variable is not a right-hand-side
variable). As expected, static forecasts
end in 2013m04, whereas dynamic
forecasts are provided for the entire
forecast sample.
• The standard deviation differ however.
The dynamic forecast standard errors
take into account the forecast
uncertainty from the lagged values of
the payroll series, whereas the static
forecast does not since it uses actual
values of the payroll series (more on
standard errors below).
Forecasting with Auto-Series
Example 11
• Static and Dynamic Forecasts differ however when we include a lagged dependent variable.
50
Example 11: Auto-Series and Forecasting
1. Type in the command window:
smpl sample_est
ls d(payroll) c d(payroll(-1)) ism
tbill3m @expand(@month, @droplast)
2. Press Enter (the second command should be
typed in one line). Save this as eq11. Note this
equation is similar to the previous example with
the exception that here we have a lagged
dependent variable.
3. Open eq11 and click the button.
Proceed as previously, producing to compute
dynamic and static forecasts. Let’s try to
forecast both levels (payroll) and first
differences (d(payroll))(we have named levels
as eq11_level_dyn and eq11_level_stat and
differences as eq11_diff_dyn and
eq11_diff_stat).
4. Click OK.
*Note: This equation is saved as eq11
in Results.wf1 workfile.
Forecasting with Auto-Series
Example 11 (cont’d)
51
• The graph for dynamic and static forecasts is shown here (both for first differences
and levels). They differ, because the dynamic forecast uses forecasted values of
payroll whereas the static forecast uses the actual values of the series.
• Standard errors for the dynamic forecast (not shown here) are also larger, because
they take into account the forecast uncertainty from the lagged value of payroll.
Forecast of Differences Forecast of Levels
Forecasting with Auto-Series
Example 11a
• If the model includes a lagged dependent variable, it matters for forecasting purposes
whether the dependent variable is an auto-series or not.
• Let’s re-estimate the previous example (eq11) when the dependent variable is not an
auto-series.
52
Example 11a: Auto-Series and Forecasting
1. Type in the command window:
smpl sample_est
series dpayroll=d(payroll)
ls dpayroll c dpayroll(-1) ism
tbill3m @expand(@month, @droplast)
2. Press Enter (the second command should be
typed in one line). Save this as eq11a. Notice
that the output from this regression is identical
to eq11. However, when we forecasts, the
dynamic and static forecasts will differ from
those produced with eq11.
3. Open eq11a and click the button.
Notice that now EViews treats DPAYROLL as
an ordinary series and is unable to forecast the
underlying data (payroll).
3. Click OK.
*Note: This equation is saved as eq11a
in Results.wf1 workfile.
Forecasting with Auto-Series
Example 11a (cont’d)
53
• The graphs of dynamic forecasts from eq11 and eq11a are identical (as shown here).
However, the static forecasts differ: for eq11a, EViews is able to produce the one-step-
ahead forecast for one period only: 2009m01. This is because dpayroll was derived from
d(payroll) over the estimation period (ending in 2008m12).
In contrast, in eq11, EViews knows that d(payroll) is a transformation of payroll, so it uses
actual values of payroll (which are known up until 2013m03) to compute the static forecast.
Dynamic Forecasts eq11 and eq11a Static Forecasts
Forecasting with Auto-Series
Example 12
• You can use more complicated expressions and EViews will be able to forecast the
underlying series if is able to normalize the dependent variable expression.
54
Example 12: Auto-Series and Forecasting
1. Type in the command window:
smpl sample_est
ls d(log(payroll)) c d(log(payroll(-1)))
ism tbill3m @expand(@month, @droplast)
2. Press Enter (the second command should be typed in
one line). Save this as eq12.
3. Open eq12 and click the button. Notice that
EViews understands that payroll is the underlying data
series and offers to forecast either the underlying series
or (d(log(payroll)).
3. Click OK.
*Note: This equation is saved as eq12
in Results.wf1 workfile.
Forecasting with Auto-Series
Example 13
• If the dependent variable is an auto-series derived from two or more series, EViews will offer
to provide forecasts of the level of the first series.
55
Example 13: Auto-Series and Forecasting
1. Type in the command window:
smpl sample_est
ls (payroll+ism) c @trend ism(-1)
2. Press Enter. Save this as eq13.
3. Open eq13 and click the button.
Notice that EViews now offers to forecasts
either the first series of the sum (payroll) or
the sum (payroll+ism). It is important to note
that even though a lag of ism is used as
right-hand-side variable, EViews does not
offer an option for Dynamic forecast. If
however, payroll(-1) was included as a right-
hand-side variable, the Dynamic option
would be available (that’s because EViews
solves for the first series in the expression).
4. Click OK.
*Note: This equation is saved as eq13
in Results.wf1 workfile.
Forecasting with Auto-Series
Example 14
• If EViews is unable to normalize the expression for the dependent variable, it will offer to
forecast the entire expression (and not the underlying series).
56
Example 14: Auto-Series and Forecasting
1. Type in the command window:
smpl sample_est
ls log(payroll+1/payroll) c @trend
payroll(-1)
2. Press Enter (the second command should be
typed in one line). Save this as eq14.
3. Open eq14 and click the button.
Notice that EViews now offers to forecasts only
the complex expression, since it is unable to
solve and normalize for payroll. Note also that
only static forecasts are available since
EViews is unable to solve for lagged values of
payroll on the right-hand-side.
4. Click OK.
*Note: This equation is saved as eq14
in Results.wf1 workfile.

More Related Content

PDF
50 MS Excel Tips and Tricks
DOCX
1 CMIS 102 Hands-On Lab Week 8 Overview Th.docx
PPTX
ARIMA - Statistical Analysis for Data Science
PDF
Oracle Compensation Management
PDF
Monte Carlo Simulation for project estimates v1.0
PPTX
Model simulation VHDL
PDF
Using microsoft excel for weibull analysis
PPTX
Model simulation VHDL
50 MS Excel Tips and Tricks
1 CMIS 102 Hands-On Lab Week 8 Overview Th.docx
ARIMA - Statistical Analysis for Data Science
Oracle Compensation Management
Monte Carlo Simulation for project estimates v1.0
Model simulation VHDL
Using microsoft excel for weibull analysis
Model simulation VHDL

Similar to Tutorial 14 Basic Forecasting with SAS Software (20)

DOC
Cmis 102 hands on/tutorialoutlet
PPT
PPTX
What is the Holt-Winters Forecasting Algorithm and How Can it be Used for Ent...
PDF
Quantitative Forecasting Techniques in SCM
DOCX
Sheet1HCM3002 Economics of HealthcareChoose a Health Plan (Part 2).docx
DOCX
Fin 351Project 2Derivation of the Efficient Frontier Part .docx
PPTX
Tutorial12_Estimation_PartA note Eview Traning
PPTX
DATA ANALYSIS AND BUSINESS MODELING LAB.pptx
PPTX
HR Cost Forecasting using ARIMA modelling
PPTX
Chapter-3_Heizer_S1.pptx
PPT
Forcast2
PPTX
Excel Function Training
PPTX
Forcasting methods
PPTX
Eviews Information for nature students.pptx
PPT
Forecasting
PPT
Forecasting for the UGSEM DEMAND FORECASTING.ppt
PPT
Forecasting FOR UGSEM Managerial Economics.ppt
DOCX
Lecture Capture Summary (LCS) #11. Chapter Title Containin.docx
DOCX
computer applications in business unit 3
PPTX
Empowerment Technology Lesson 4
Cmis 102 hands on/tutorialoutlet
What is the Holt-Winters Forecasting Algorithm and How Can it be Used for Ent...
Quantitative Forecasting Techniques in SCM
Sheet1HCM3002 Economics of HealthcareChoose a Health Plan (Part 2).docx
Fin 351Project 2Derivation of the Efficient Frontier Part .docx
Tutorial12_Estimation_PartA note Eview Traning
DATA ANALYSIS AND BUSINESS MODELING LAB.pptx
HR Cost Forecasting using ARIMA modelling
Chapter-3_Heizer_S1.pptx
Forcast2
Excel Function Training
Forcasting methods
Eviews Information for nature students.pptx
Forecasting
Forecasting for the UGSEM DEMAND FORECASTING.ppt
Forecasting FOR UGSEM Managerial Economics.ppt
Lecture Capture Summary (LCS) #11. Chapter Title Containin.docx
computer applications in business unit 3
Empowerment Technology Lesson 4
Ad

Recently uploaded (20)

PPTX
iec ppt-1 pptx icmr ppt on rehabilitation.pptx
PPTX
climate analysis of Dhaka ,Banglades.pptx
PDF
Lecture1 pattern recognition............
PPTX
mbdjdhjjodule 5-1 rhfhhfjtjjhafbrhfnfbbfnb
PDF
Galatica Smart Energy Infrastructure Startup Pitch Deck
PPT
Miokarditis (Inflamasi pada Otot Jantung)
PDF
Foundation of Data Science unit number two notes
PDF
Fluorescence-microscope_Botany_detailed content
PPTX
Microsoft-Fabric-Unifying-Analytics-for-the-Modern-Enterprise Solution.pptx
PPTX
Computer network topology notes for revision
PPTX
01_intro xxxxxxxxxxfffffffffffaaaaaaaaaaafg
PPTX
AI Strategy room jwfjksfksfjsjsjsjsjfsjfsj
PPTX
DISORDERS OF THE LIVER, GALLBLADDER AND PANCREASE (1).pptx
PDF
annual-report-2024-2025 original latest.
PPTX
Introduction to Firewall Analytics - Interfirewall and Transfirewall.pptx
PPTX
STUDY DESIGN details- Lt Col Maksud (21).pptx
PPTX
1_Introduction to advance data techniques.pptx
PPTX
The THESIS FINAL-DEFENSE-PRESENTATION.pptx
PDF
BF and FI - Blockchain, fintech and Financial Innovation Lesson 2.pdf
PDF
Recruitment and Placement PPT.pdfbjfibjdfbjfobj
iec ppt-1 pptx icmr ppt on rehabilitation.pptx
climate analysis of Dhaka ,Banglades.pptx
Lecture1 pattern recognition............
mbdjdhjjodule 5-1 rhfhhfjtjjhafbrhfnfbbfnb
Galatica Smart Energy Infrastructure Startup Pitch Deck
Miokarditis (Inflamasi pada Otot Jantung)
Foundation of Data Science unit number two notes
Fluorescence-microscope_Botany_detailed content
Microsoft-Fabric-Unifying-Analytics-for-the-Modern-Enterprise Solution.pptx
Computer network topology notes for revision
01_intro xxxxxxxxxxfffffffffffaaaaaaaaaaafg
AI Strategy room jwfjksfksfjsjsjsjsjfsjfsj
DISORDERS OF THE LIVER, GALLBLADDER AND PANCREASE (1).pptx
annual-report-2024-2025 original latest.
Introduction to Firewall Analytics - Interfirewall and Transfirewall.pptx
STUDY DESIGN details- Lt Col Maksud (21).pptx
1_Introduction to advance data techniques.pptx
The THESIS FINAL-DEFENSE-PRESENTATION.pptx
BF and FI - Blockchain, fintech and Financial Innovation Lesson 2.pdf
Recruitment and Placement PPT.pdfbjfibjdfbjfobj
Ad

Tutorial 14 Basic Forecasting with SAS Software

  • 1. EViews Training Basic Forecasting Note: Data and workfiles for this tutorial are provided in:  Data: Data.xls  Results: Results.wf1  Practice Workfile: Data.wf1
  • 2. Data and Workfile Documentation 2 • Data.wf1 and Data.xls have monthly data from January 1960-March 2013.  payroll – employment levels, thousands of employees (source: Bureau of Labor Statistics)  IP –industrial production, index levels (source: Board of Governors of the Federal Reserve)  ISM – The Institute for Supply Management Manufacturing Index, Index level (source: St. Louis’ FRED Database).  Tbill 3M– 3-month US Treasury rate (source: Board of Governors of the Federal Reserve)
  • 3. Data and Workfile Documentation (cont’d) 3 • The spreadsheet produced here shows the data series at the end of the workfile range. • Note that historical data are available for all data series up until March 2013. • From 2013m04 until the end of the workfile range, we have provided forecasts for series IP, ISM, TBill3m. • We will create a few equations to forecast the payroll series using EViews.
  • 4. Forecasting • EViews offers a powerful and easy-to-use forecasting tool that allows you to obtain forecasts from your estimated models. • Of course, the accuracy of the forecasts depends on the model used to produce the forecasts: EViews simply handles the mechanics of producing the forecasts. • This tutorial explains the basic procedures for forecasting from a single equation. The tutorial assumes knowledge of estimating equations in EViews. • The main topics of this tutorial are:  Forecast Basics (Static vs. Dynamic, Forecast Evaluation, Errors and Variances)  With exogenous variables  With lagged dependent variables  With lagged dependent variables and ARMA terms Forecasting with Auto-series 4
  • 5. Forecasting with Exogenous Variables Example 1 • 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. 5 Example 1: Estimation 1. Type in the command window: ls payroll c @trend @expand(@month, @dropfirst) 2. Press Enter (save this equation as eq01). 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. *Note: This equation is saved as eq01 in Results.wf1 workfile.
  • 6. Forecasting with Exogenous Variables Example 1 (cont’d) • Estimation output is shown here. Note that EViews has estimated the model over the period 1960m01 to 2013m03, for which we have payroll data. • We also plot the actual and fitted values of the model (shown below), by pressing View → Actual, Fitted, Residual → Actual Fitted Residual Graph. 6
  • 7. Forecasting with Exogenous Variables Example 1: Forecasting • Now, let’s produce a forecast for the payroll series based on our model. • For this, all we have to do is press the button in the equation toolbar. 7 Example 1: Forecasting 1. Open eq01. On the equation box toolbar, press the button. The Forecast dialog box opens up. 2. 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. 3. Under Forecast sample, select the sample over which the forecast will be carried out. Here we type, 2013m04 @last. 4. Check “Insert actuals for out-of-sample observations.” 5. Under Method, notice that EViews indicates this is a Static forecast (no dynamics in the equation) (more details later). 6. Under Output, check Forecast graph and Forecast evaluation. 7. Click OK.
  • 8. Forecasting with Exogenous Variables Example 1: Forecasting (cont’d) • The Forecast Output is shown here. Notice that EViews shows the series Eq01_f over the forecast sample, together with 2 standard error bands. 8 *Note: This output is saved as graph01 in Results.wf1 workfile.
  • 9. Forecasting with Exogenous Variables Example 1: Forecasting (cont’d) • Note also that there is now a new series eq01_f saved in the workfile. Let’s open this series and the original payroll series as a group to inspect them more closely. • Notice that the two series are identical when looking at the historical data. This is because we elected to check the box “Insert actuals for out-of-sample observations” which instructs EViews to use actual payroll data for the out-of-forecast sample. • However, the eq01_f series contains actual forecasts of the payroll series for future periods. How does EViews compute these values? • Recall that the explanatory variables in this model are @trend and seasonal factors. EViews computes the forecast for April 2013 as follows:  @trendApril 2013 = 639; @trend coefficient=144.4909  @month=4; @month=4 coefficient 1,476.381.  constant=51,730.04  eq01_f April 2013= 51,730.04+144.4909*639+1,476.381*1 =145,536.076 9
  • 10. Forecasting with Exogenous Variables: Example 1: Forecast Sample Changes • What would happen if we set the forecast sample to be the entire range of the workfile? 10 Example 1: Forecast Sample Changes 1. Open eq01 and press the button. The Forecast dialog box opens up. 2. Under Series name, name the new forecasted series eq01_f3. 3. Set all the other options as we did before (check Forecast graph and Forecast evaluation, check “Insert actuals for out- of-sample observations.” 4. Under Forecast Sample, set the sample to the entire workfile range (1960m01 2014m12). 5. Click OK.
  • 11. Forecasting with Exogenous Variables Example 1: Forecast Evaluation • The Forecast Output is shown here. Notice that EViews has computed eq01_f3 and the corresponding standard error bands over the entire sample. Notice also that, in addition to the graph, EViews has produced a small table: this is the Forecast Evaluation table. 11 Although, we had checked the Forecast evaluation box in the previous illustrations, EViews was unable to produce an output when the forecast sample was set for future periods (2013m04 to 2014m012). This is because EViews could not check how well the forecasting model works since the payroll data beyond 2013m03 is missing. We would have to wait until a future date when payroll data becomes available in order to compare our forecasts with what actually happens. When we set the forecast sample to the entire workfile range (or a sample that includes actual historical data), it is possible to check for forecast accuracy. EViews compares the forecasted (predicted) values from the model (over the period 1960m01 to 2013m03) to the actual data and computes the forecast evaluation table. *Note: This output is saved as graph02 in Results.wf1 workfile.
  • 12. Forecasting with Exogenous Variables Example 1: Forecast Evaluation (cont’d) • We can inspect in more detail the differences between the actual payroll series and the forecasted eq01_f3 series. We can open them as a group and plot them together. • As seen from the graph, values differ over the historical range (1960m01 to 2013m03) because eq01_f3 series comes from the fitted values of eq01, whereas the payroll series contains actual data. • Of course, the eq01_f3 series is also longer because it includes the future (predicted values) over the period 2013m04 to 2014m12. 12
  • 13. Forecasting with Exogenous Variables In-Sample vs. Out-of-Sample Forecasts • Notice that the Forecast evaluation in the previous example, simply compares the predicted values from the model to the actual data over the “historical” period (1960m01 to 2013m03). • Note also that our model was estimated over the same period (1960m01 to 2013m03). In a sense, the “forecast” evaluation was carried out in-sample and not out-of-sample. • In fact, since we don’t have “actual” payroll data over the 2013m03 to 2014m12 period (the “true” forecast period), it is impossible for us to see how well our model performs out-of-sample. • This is problematic because the history of forecasting is replete with cases when models work well in-sample but perform extremely poorly out-of-sample. • A common practice to address this issue is to reserve part of the data by not including it in the estimation sample, effectively pretending that the history ends sooner and the reserved data is part of the future (part of forecasts). • We can then produce forecasts over the reserved sample and perform forecast evaluation by comparing the out-of-sample forecast values to the actual history. 13
  • 14. Forecasting with Exogenous Variables Example 2: Out-of-Sample Forecasts • Let’s carry out Example 1 by breaking down the sample as follows: Estimation Sample: 1960m01 to 2008m12 Forecast Sample: 2009m1 to 2014m12 14 Example 2: Estimation 1. Type in the command window: smpl 1960m01 2008m12 ls payroll c @trend @expand(@month,@dropfirst) 2. Press Enter after each command line (the second command should be typed in one line). Save this equation as eq02.
  • 15. Forecasting with Exogenous Variables Example 2: Out-of-Sample Forecasts (cont’d) • Now, let’s produce a forecast for the payroll series using the forecast sample. 15 Example 2: Forecasting 1. Open eq02. On the equation box toolbar, press the button. The Forecast dialog box opens up. 2. Under Series name, name the series eq02_f. 3. Under the Forecast sample, type the forecast sample (here, 2009m1 2014m12). 4. Set all the other options as we did previously (check Forecast graph, Forecast evaluation, and Insert actuals for out-of-sample observations). 5. Click OK.
  • 16. Forecasting with Exogenous Variables Example 2: Out-of-Sample Forecasts (cont’d) • The Forecast Output is shown here (note that we have removed the forecast evaluation table, which we discuss next). • 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 ). 16 Forecast Graph Payroll vs eq02_f *Note: This output is saved as graph04 in Results.wf1 workfile. *Note: This output is saved as graph05 in Results.wf1 workfile.
  • 17. Forecasting with Exogenous Variables Example 2: Forecast Evaluation Details • Let’s take a closer look at the Forecast Evaluation Table shown here. 17 Forecast Evaluation First, notice that the forecast evaluation is saved in two formats. If you check the box (Forecast graph), the forecast evaluation table is included along with the forecast graph (the first table shown here is copied from this option). If you uncheck Forecast graph, the Forecast evaluation is shown in a separate table (the second table shown here). EViews indicates the number of observations used to perform the forecast evaluation. Here we have 51 periods, which span the period from 2009m01 to 2013m03. Note that for the remaining period (2013m03 to 2014m12), EViews does not carry out a forecast evaluation because the values of the dependent variable (payroll) are missing. *Note: This output is saved as table01 in Results.wf1 workfile.
  • 18. Forecasting with Exogenous Variables Example 2: Forecast Evaluation Details (cont’d) 18 Forecast Evaluation (cont’d) The reported forecast statistics indicate that our forecasting model does not perform well out-of-sample. The Root Mean Squared Error (RMSE) is the standard deviation of the forecast errors. This is quite large when compared to the standard deviation of payroll series. Note that RMSE and Mean Absolute Error depend on the scale of the dependent variable, while the next two statistics (Mean Abs. Percent Error and Theil Inequality Coefficient) are scale invariant. The Theil Coefficient lies between 0 and 1, with 0 indicating a perfect fit. Bias Proportion – indicates how far is the mean of the forecast from the mean of the actual series.  Variance Proportion – indicates how far is the variance of the forecasts from the variance of the actual series. Covariance Proportion – measures the remaining unsystematic forecasting errors. If the forecasts are “good” the bias and variance proportions should be small (which is not the case here). Note that the Bias, Variance and Covariance Proportions add up to 1 (they are given as proportions out of 1).
  • 19. Forecasting with Exogenous Variables Example 3: Forecasted Explanatory Variables • In order to be able to produce an out-of-sample forecast, we need to know the future values for all explanatory (right-hand-side) variables. • This was easy enough so far, because we used @trend and seasonal factors to forecast our dependent variable. EViews easily produces “forecasts” for trend variable, and seasonal factors are set as @month=1, @month=2, etc. • However, for most explanatory variables, we need to provide values over the forecast period. • For example, suppose we want to forecast payroll using ip, ism and tbill3m as additional explanatory variables. As shown previously (and in the graphs below), we have provided data for the explanatory variables over the forecast period (2009m01 to 2014m12). 19
  • 20. Forecasting with Exogenous Variables Example 3 • Let’s define the sample objects by typing in the command window: sample sample_est @first 2008m12 sample sample_for 2009m01 @last 20 Example 3: Estimation 1. Type in the command window: smpl sample_est ls payroll c ip ism tbill3m @trend @expand(@month,@droplast) 2. Press Enter after each command line (the second command should be typed in one line). *Note: This equation is saved as eq03 in Results.wf1 workfile.
  • 21. Forecasting with Exogenous Variables Example 3: Forecasting • Now, let’s produce a forecast for the payroll series with this model. 21 Example 3: Forecasting 1. Open eq03. On the equation box toolbar, press the button. The Forecast dialog box opens up. 2. Under Series names, type the name of the forecasted series eq03_f in the Forecast name field. 3. Under Series names, S.E. (optional) field, type the name of standard errors series. This creates and saves a new series eq03_stdev. 4. Under Forecast sample, type the forecast sample sample_for. 5. Set all the other options as follows: check Forecast graph, Forecast evaluation, and uncheck Insert actuals for out-of- sample observations. 6. Click OK.
  • 22. Forecasting with Exogenous Variables Example 3: Forecasting (cont’d) • The Forecast Output is shown here (note that we have removed the forecast evaluation table, which we discuss below). • We can also plot the actual forecast series against the forecast and the two standard error bands by typing in the command window: smpl 2009m01 @last plot payroll eq03_f eq03_f+2*eq03_stdev eq03_f-2*eq03_stdev 22 Forecast Graph Payroll, eq03_f and Confidence Bands *Note: This output is saved as graph06 in Results.wf1 workfile. *Note: This output is saved as graph07 in Results.wf1 workfile.
  • 23. Forecasting with Exogenous Variables Example 3: Forecast Evaluation • The Forecast Evaluation output from this model is shown here. As you can see, the Bias Proportion is still large, indicating that the forecast is not “very good.” • Nonetheless, this model performs considerably better than eq02 (RMSE is lower than eq02, the Mean Absolute Percentage Error is lower, and even the Bias Proportion is lower). 23 *Note: This output is saved as table02 in Results.wf1 workfile.
  • 24. Forecasting with Lagged Dependent Variables
  • 25. Forecasting with Lagged Dependent Variables • Oftentimes, time series models used for forecasting include a lagged dependent variable. • The presence of a lagged dependent variable complicates forecasting because there is an issue as to how to evaluate the dependent variable that appears on the right-hand side of the equation. • EViews offers two ways to deal with lagged dependent variables: Dynamic Forecasting Static Forecasting • Dynamic forecasting uses the forecasted value of the lagged dependent variable. • Static forecasting uses the actual value of the lagged dependent variable (if it is available). • For out of sample forecasting, dynamic forecasting is usually the only possible approach (due to the lack of actual data, static forecasting is impossible). 25
  • 26. Forecasting with Lagged Dependent Variables Example 4 26 Example 4: Estimation 1. Let’s first specify a model with lagged dependent variable on the right-hand side of the equation. Type in the command window: smpl sample_est ls payroll c payroll(-1) payroll(-2) @trend @expand(@month, @droplast) 2. Press Enter. *Note: This equation is saved as eq04 in Results.wf1 workfile.
  • 27. Forecasting with Lagged Dependent Variables Example 4 (cont’d) • We also plot the actual and the fitted values of the model (shown below), by pressing View → Actual, Fitted, Residual → Actual Fitted Residual Graph. The model seems to perform better now (the fit appears better) when a lagged dependent variable is included. 27
  • 28. Forecasting with Lagged Dependent Variables Example 4: Dynamic Forecast • Now, let’s produce a Dynamic Forecast for the payroll series based on our model. 28 Example 4: Dynamic Forecast 1. Open eq04. On the equation box toolbar, press the button. The Forecast dialog box opens up. 2. Under Series names, name the series eq04_dyn in Forecast name field. Under S.E. (optional) field, type the name of standard errors series eq04_stdev_dyn. 3. Under Forecast sample, type the forecast sample sample_for. Set all the other options as follows: check Forecast graph, Forecast evaluation, and check Insert actuals for out-of-sample observations. 4. Notice that under Method, you now can choose between Dynamic Forecast and Static Forecast. Let’s choose Dynamic Forecast here. 5. Click OK.
  • 29. Forecasting with Lagged Dependent Variables Example 4: Dynamic Forecast (cont’d) • The Forecast Output is shown here. Notice that EViews produces forecast values for payroll series over the entire forecast sample: 2009m1 to 2014m12. • You can also see that the confidence error bands widen dramatically towards the end of the forecast sample. This is because dynamic forecasting uses the forecast values of the lagged dependent variables. The forecast errors tend to compound over time resulting in larger error bands the further out we are in the forecast sample. 29 How are Dynamic Forecasts Performed? The first forecasted value (2009m01) uses the actual value of 2008m12 (payroll(-1)) and the actual value of 2008m11 (payroll (-2)). The second forecasted value (2009m02) uses the forecasted value of 2009m01 (payroll (-1); estimated previously) and the actual value of 2008m12 (payroll(-2)).  The third forecasted value (2009m03) uses the forecasted value of 2009m02 (payroll (-1); estimated in step 2) and the forecasted value of 2009m01 (payroll(-2); estimated in step 1). *Note: This output is saved as graph09 in Results.wf1 workfile.
  • 30. Forecasting with Lagged Dependent Variables Example 4: Static Forecast • Let’s now produce a Static Forecast of the payroll series based on the same model. 30 Example 4a: Static Forecast 1. Open eq04. Follow steps 1-3 as in the previous example (naming the forecast series eq04_stat and its standard deviation eq04_stdev_stat). 2. Under Method, select Static Forecast. 3. Click OK.
  • 31. Forecasting with Lagged Dependent Variables Example 4: Static Forecast (cont’d) • The Forecast Output is shown here. A few things stand out. • First, notice that the forecast sample is adjusted to include the period only from 2009m01 to 2013m04 and not the entire forecast sample (2009m01 to 2014m12). • This is because static forecasts are one-step ahead forecasts only. They use actual values of lagged dependent variables in order to perform the forecast. Since we have actual data for payroll series only up until 2013m03, EViews can only produce forecasts for the period from 2009m01 to 2013m04 . 31 How are Static Forecasts Performed? The first forecasted value (2009m01) uses the actual value of 2008m12 (payroll(-1)) and the actual value of 2009m11 (payroll (-2)). The second forecasted value (2009m02) uses the actual value of 2009m01 (payroll (-1)) and the actual value of 2008m12 (payroll(-2)). The third forecasted value (2009m03) uses the actual value of 2009m02 (payroll (-1)) and the actual value of 2009m01 (payroll(-2)). *Note: This output is saved as graph10 in Results.wf1 workfile.
  • 32. Forecasting with Lagged Dependent Variables Example 4: Dynamic vs. Static Forecast • Let’s compare the two forecasts more directly. For this, open series payroll, eq04_dyn and eq94_stat as a group and plot the series against each other (you can change the sample by typing smpl @all in the command line to get the entire sample and smpl sample_for for the forecast sample). The static forecast performs much better than the dynamic forecast because it uses actual instead of the forecasted lagged values over the forecast period. The historical values are the same because we checked Insert actuals for out-of-sample observations in both cases. 32 *Note: This output is saved as graph11 in Results.wf1 workfile. *Note: This output is saved as graph12 in Results.wf1 workfile.
  • 34. Forecasting with AR terms Example 6 • Models with ARMA terms are also widely used in forecasting. • The presence ARMA terms involve some additional complexities in forecasting, which we highlight in this section. 34 Example 6: 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) 2. Press Enter (the second command should be typed in one line). *Note: This equation is saved as eq06 in Results.wf1 workfile.
  • 35. Forecasting with AR Terms Example 6: Forecasting with AR terms • Let’s produce dynamic and static forecast for the AR(2) model we just estimated. 35 Example 6: Forecasting with AR terms 1. 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. 2. 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. 3. Click OK.
  • 36. Forecasting with AR Terms Example 6: Forecasting with AR terms (cont’d) • 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. • In the dynamic forecast (top graph), the lagged residuals are forecasted dynamically. This means that future values of lagged residuals are formed using the 36
  • 37. Forecasting with AR Terms Example 6: Forecasting with AR terms (cont’d) • There are cases when you may wish to assume that the ARMA errors are zero. • For this, we can select the Structural (ignore ARMA) box under Method. 37 Example 6a: Forecasting with AR terms 1. Open eq06 and click the button. As usual, the Forecast dialog box opens up. Name the series eq06_dyn2 for the dynamic series and eq06_stat2 for the static forecast series. 2. 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. 3. Check Structure (ignore ARMA) box under Method. 4. Click OK.
  • 38. Forecasting with AR Terms Example 6: Forecasting with AR terms (cont’d) • The graphs shown here plot the forecasted values for both methods (dynamic and static) when ARMA terms are included (eq06_dyn or eq06_stat) or ignored (eq06_dyn2 or eq06_stat2). • First, it is important to note that the static and dynamic forecasts obtained by ignoring ARMA terms are identical (you can see this by plotting eq06_dyn2 against eq06_stat2; not shown here). This is expected, since static and dynamic forecasts differ only if there are lagged dependent variables or ARMA terms. If we choose to ignore the ARMA terms, there are no differences between the two. • Note also that the static forecasts when ARMA terms are ignored are provided for the entire forecast period (bottom graph). This was possible since we know the values of all exogenous variables over the entire forecast sample. • For both dynamic and static forecasts, ignoring ARMA terms produces “worse” forecasts than when ARMA terms are included. 38
  • 39. Forecasting with MA terms Example 8 • It is just as easy in EViews to produce forecasts from models with MA errors. 39 Example 8: 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) 2. Press Enter (the second command should be typed in one line). *Note: This equation is saved as eq08 in Results.wf1 workfile.
  • 40. Forecasting with MA Terms Example 8: Forecasting • Let’s produce dynamic and static forecast for the MA(1) model we just estimated. 40 Example 8: Forecasting with MA terms 1. Open eq08 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. 3. 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. 4. Click OK.
  • 41. Forecasting with MA Terms A Few (technical) Notes 41 • A few notes before we show the results: • The Estimation period method for MA backcasting uses data for the estimation sample to compute backcast estimates.  Innovations beyond the estimation sample are set to 0. EViews then uses the unconditional residuals to obtain the pre-estimation sample residuals. • The Forecast available (v5) method for MA backcasting, proceeds with different approaches for dynamic and static forecasting. Dynamic forecasting – EViews applies the backcasting procedure using data from the beginning of the estimation sample to either the beginning of the forecast period or the end of the estimation sample (whichever comes first). Static forecasting – EViews applies the backcasting procedure using data from the beginning of the estimation sample to the end of the forecast period.
  • 42. Forecasting with MA Terms A Few (technical) Notes (cont’d) • After obtaining the MA backcast estimates of the pre-estimation residuals (using either Estimation period or Forecast available (v5)), forward recursion is used to obtain values for the pre-forecast sample innovations. Dynamic forecasting – We only need to obtain innovation values for the q periods (where q denotes the order of the MA process) prior to the start of the forecast sample. All subsequent innovations are set to 0. In the current example of MA(1) error terms, we need only obtain innovation values 1 period prior to the start of the forecast sample. Static forecasting – The forward recursion is carried out through the end of the forecast period. 42
  • 43. Forecasting with MA Terms Example 8 (cont’d) 43 • The Forecast Output for both methods are shown here. • Because the forward recursion for static forecasts are performed through the end of the forecast period, EViews is able to produce Static forecasts that cover the entire forecast sample (2013m04 to 2014m12). • Moreover, beyond 2013m04, forecasts from Dynamic and Static model are identical (this is because the forward recursion used to obtain the pre-forecast sample innovations produces same innovations after the end of the historical in 2013m03).
  • 45. Forecasting with Auto-Series Example 9 • One of the most useful features in EViews is the ability to estimate and forecast from equations that are specified using expressions or auto-series. • Issues with auto-series normally arise when the dependent variable is specified using an expression. In this section we illustrate through a number of examples how EViews performs forecasts in these cases. 45 Example 9: Auto-Series and Forecasting 1. Type in the command window: smpl sample_est ls log(payroll) c ip ism tbill3m @trend @expand(@month, @dropfirst) 2. Press Enter (the second command should be typed in one line). *Note: This equation is saved as eq09 in Results.wf1 workfile.
  • 46. Forecasting with Auto-Series Example 9 (cont’d) • Now let’s press the button. The Forecast dialog box offers a couple of options now which we have not seen before. 46 Example 9: Auto-Series and Forecasting 1. Open eq09 and click the button. As usual, the Forecast dialog box opens up. 2. Notice here that at the top of the dialog box there is a new section: Series to forecast. Here you can choose to forecast either the underlying series (payroll) or the auto- series (log(payroll)). Let’s do both, first forecasting levels and then logs (we name the level forecast eq09_level and the log eq09_log). 3. Notice that since this equation does not have a dynamic structure, only the Static method is available. 4. Click OK.
  • 47. Forecasting with Auto-Series Example 9 (cont’d) 47 • The Forecast Output for both level and log forecasts is shown here. Forecast of Log(Payroll) Forecast of Levels *Note: This output is saved as graph24 in Results.wf1 workfile. *Note: This output is saved as graph25 in Results.wf1 workfile.
  • 48. Forecasting with Auto-Series Example 10 • We can just as easily estimate first differences using auto-series. 48 Example 10: Auto-Series and Forecasting 1. Type in the command window: smpl sample_est ls d(payroll) c ism tbill3m @expand(@month, @droplast) 2. Press Enter (the second command should be typed in one line). Save this as eq10. 3. Open eq10 and click the button. Notice that in the Series to forecast section you can choose to forecast either the underlying series (payroll) or the auto-series (d(payroll)). Let’s try to forecast the first differences. 4. It is important to note that now the Dynamic forecast option is available; EViews is able to determine that the forecast equation has dynamic elements (we have saved the dynamic forecasts as eq10_diff_dyn and static forecasts as eq10_diff_stat). 5. Click OK. *Note: This equation is saved as eq10 in Results.wf1 workfile.
  • 49. Forecasting with Auto-Series Example 10 (cont’d) 49 • The Forecast Output for both Dynamic and Static methods are shown here. • Note that the forecasts for both methods are the same, since the equation is not truly “dynamic” (the lagged dependent variable is not a right-hand-side variable). As expected, static forecasts end in 2013m04, whereas dynamic forecasts are provided for the entire forecast sample. • The standard deviation differ however. The dynamic forecast standard errors take into account the forecast uncertainty from the lagged values of the payroll series, whereas the static forecast does not since it uses actual values of the payroll series (more on standard errors below).
  • 50. Forecasting with Auto-Series Example 11 • Static and Dynamic Forecasts differ however when we include a lagged dependent variable. 50 Example 11: Auto-Series and Forecasting 1. Type in the command window: smpl sample_est ls d(payroll) c d(payroll(-1)) ism tbill3m @expand(@month, @droplast) 2. Press Enter (the second command should be typed in one line). Save this as eq11. Note this equation is similar to the previous example with the exception that here we have a lagged dependent variable. 3. Open eq11 and click the button. Proceed as previously, producing to compute dynamic and static forecasts. Let’s try to forecast both levels (payroll) and first differences (d(payroll))(we have named levels as eq11_level_dyn and eq11_level_stat and differences as eq11_diff_dyn and eq11_diff_stat). 4. Click OK. *Note: This equation is saved as eq11 in Results.wf1 workfile.
  • 51. Forecasting with Auto-Series Example 11 (cont’d) 51 • The graph for dynamic and static forecasts is shown here (both for first differences and levels). They differ, because the dynamic forecast uses forecasted values of payroll whereas the static forecast uses the actual values of the series. • Standard errors for the dynamic forecast (not shown here) are also larger, because they take into account the forecast uncertainty from the lagged value of payroll. Forecast of Differences Forecast of Levels
  • 52. Forecasting with Auto-Series Example 11a • If the model includes a lagged dependent variable, it matters for forecasting purposes whether the dependent variable is an auto-series or not. • Let’s re-estimate the previous example (eq11) when the dependent variable is not an auto-series. 52 Example 11a: Auto-Series and Forecasting 1. Type in the command window: smpl sample_est series dpayroll=d(payroll) ls dpayroll c dpayroll(-1) ism tbill3m @expand(@month, @droplast) 2. Press Enter (the second command should be typed in one line). Save this as eq11a. Notice that the output from this regression is identical to eq11. However, when we forecasts, the dynamic and static forecasts will differ from those produced with eq11. 3. Open eq11a and click the button. Notice that now EViews treats DPAYROLL as an ordinary series and is unable to forecast the underlying data (payroll). 3. Click OK. *Note: This equation is saved as eq11a in Results.wf1 workfile.
  • 53. Forecasting with Auto-Series Example 11a (cont’d) 53 • The graphs of dynamic forecasts from eq11 and eq11a are identical (as shown here). However, the static forecasts differ: for eq11a, EViews is able to produce the one-step- ahead forecast for one period only: 2009m01. This is because dpayroll was derived from d(payroll) over the estimation period (ending in 2008m12). In contrast, in eq11, EViews knows that d(payroll) is a transformation of payroll, so it uses actual values of payroll (which are known up until 2013m03) to compute the static forecast. Dynamic Forecasts eq11 and eq11a Static Forecasts
  • 54. Forecasting with Auto-Series Example 12 • You can use more complicated expressions and EViews will be able to forecast the underlying series if is able to normalize the dependent variable expression. 54 Example 12: Auto-Series and Forecasting 1. Type in the command window: smpl sample_est ls d(log(payroll)) c d(log(payroll(-1))) ism tbill3m @expand(@month, @droplast) 2. Press Enter (the second command should be typed in one line). Save this as eq12. 3. Open eq12 and click the button. Notice that EViews understands that payroll is the underlying data series and offers to forecast either the underlying series or (d(log(payroll)). 3. Click OK. *Note: This equation is saved as eq12 in Results.wf1 workfile.
  • 55. Forecasting with Auto-Series Example 13 • If the dependent variable is an auto-series derived from two or more series, EViews will offer to provide forecasts of the level of the first series. 55 Example 13: Auto-Series and Forecasting 1. Type in the command window: smpl sample_est ls (payroll+ism) c @trend ism(-1) 2. Press Enter. Save this as eq13. 3. Open eq13 and click the button. Notice that EViews now offers to forecasts either the first series of the sum (payroll) or the sum (payroll+ism). It is important to note that even though a lag of ism is used as right-hand-side variable, EViews does not offer an option for Dynamic forecast. If however, payroll(-1) was included as a right- hand-side variable, the Dynamic option would be available (that’s because EViews solves for the first series in the expression). 4. Click OK. *Note: This equation is saved as eq13 in Results.wf1 workfile.
  • 56. Forecasting with Auto-Series Example 14 • If EViews is unable to normalize the expression for the dependent variable, it will offer to forecast the entire expression (and not the underlying series). 56 Example 14: Auto-Series and Forecasting 1. Type in the command window: smpl sample_est ls log(payroll+1/payroll) c @trend payroll(-1) 2. Press Enter (the second command should be typed in one line). Save this as eq14. 3. Open eq14 and click the button. Notice that EViews now offers to forecasts only the complex expression, since it is unable to solve and normalize for payroll. Note also that only static forecasts are available since EViews is unable to solve for lagged values of payroll on the right-hand-side. 4. Click OK. *Note: This equation is saved as eq14 in Results.wf1 workfile.