@UForeErrors computes error statistics on a series of in-sample one-step forecasts. You supply the series of actual data and forecasts and it computes statistics such as the mean and root mean square errors.
@UForeErrors( options ) actual forecast start end
Parameters
actual |
series of actual values |
forecast |
series of forecasts |
start, end |
range of forecasts to analyze (by default, the range of the series forecast) |
Options
THEILDECOMP/[NOTHEILDECOMP]
If THEILDECOMP, the Theil decomposition of forecast errors is calculated and displayed.
[PRINT]/NOPRINT
TITLE="title for report"
WINDOW="title for report window" [not used]
Variables Defined
%%FERRMEAN |
mean forecast error (REAL) |
%%FERRMAE |
mean absolute error (REAL) |
%%FERRMSE |
root mean square error (REAL) |
%%FERRMPE |
mean percentage error (REAL) |
%%FERRMAPE |
mean absolute percentage error (REAL) |
%%FERRMSPE |
root mean square percentage error (REAL) |
The last three are defined only if the actual series is positive throughout the range.
Example
*
* Pindyck & Rubinfeld, Econometric Models and Economic Forecasts, 4th edition
* Example 8.2 from page 213
*
open data ex42.xls
calendar(m) 1959:1
data(format=xls,org=columns) 1959:1 1996:2 fygn3 ip fm2 pw
*
* This generates period over period growth rates. Note that these aren't
* annualized.
*
set gm2 = (fm2-fm2{1})/fm2{1}
set gpw = (pw-pw{1})/pw{1}
*
* The regression is run over a specific time interval. Just as with the
* transformations, you indicate a lagged regressor by including the {lag}
* notation after the series.
*
linreg fygn3 1960:1 1995:8
# constant ip gm2 gpw{1}
*
uforecast(static) forecast 1995:1 1996:2
graph(key=attached,klabels=||"Forecast","Actual"||) 2
# forecast
# fygn3 1994:6 1996:2
@uforeerrors(theil) forecast fygn3
Sample Output
This is the output from the example. This rather strongly indicates a very poor forecasting model; mean error can only be equal to mean absolute error if all the forecast errors have the same sign. A Theil's U of 9 means that a naive forecast taking the last observed value does better (in RMSE) by a factor of 9. The Theil breakdown has the bias being responsible for almost the entire mean square error.
Note that the "Pct Error" group of statistics is only computed if the actual series is positive throughout the range and the "Theil Inequality Measure" group is only computed if you use the THEIL option.
Forecast Analysis for FORECAST
From 1995:01 to 1996:02
Mean Error 2.47043669
Mean Absolute Error 2.47043669
Root Mean Square Error 2.50409236
Mean Square Error 6.270479
Theil's U 9.025926
Mean Pct Error 0.311664
Mean Abs Pct Error 0.311664
Root Mean Square Pct Error 0.314664
Theil's Relative U 9.276018
Theil Inequality Measure 0.187605
Bias 0.973300
Variance 0.000043
Covariance 0.026657