RATS 10.1
RATS 10.1

Instructions /

UFORECAST Instruction

Home Page

← Previous Next →

UFORECAST(equation=equation, other options)  series start end

Computes dynamic or static forecasts for a single equations. For more flexible forecasting, including for multi-equation systems, see FORECAST.

Wizard

You can use the Time Series—Single-Equation Forecast Wizard to generate forecasts.

Parameters

series

The series into which you wish to save the forecasts. RATS will create this series if it doesn’t already exist.

start, end

The range over which the forecasts are to be computed. You can also use the FROM, TO and STEPS options instead.

Options

EQUATION=equation to forecast

The name or number of the equation to forecast. If you omit this option, UFORECAST will compute forecasts based on the most recent regression.

 

FROM=starting period of the forecast interval

TO=ending period of the forecast interval

STEPS=number of forecast steps to compute

These determine the periods for which forecasts will be computed. If you have set a SMPL, these default to forecast over that range. Otherwise you can use:

 

FROM and TO to set the starting and ending periods for the forecasts, or

FROM and STEPS to set the starting date and number of steps (periods)

 

If you use STEPS, but not FROM, the default for FROM will be one entry past the end of the estimation range that was used last.

 

STATIC/[NOSTATIC]

Use STATIC if you want static forecasts rather than dynamic forecasts.

 

PRINT/[NOPRINT]

PRINT will display the forecasted and actual values in the output window.

 

WINDOW="Title for window" [unused]

The WINDOW option will create a (read-only) spreadsheet window showing the forecasted values. You can use File—Export... to export these to a file.

 

ERRORS=series of forecast errors [unused]

STDERRS=standard errors of forecast [unused]

ERRORS saves the forecast errors (differences between actual and forecasted values) into a series, while STDERRS computes and saves the the standard errors of forecast. See the ERRORS instruction for technical details on the standard errors of forecast computation.

 

SIMULATE/[NOSIMULATE]

SIMULATE draws independent \(N\left( {0,{\sigma ^2}} \right)\) shocks over the forecast period where \({\sigma ^2}\) is the residual variance for the equation or regression being forecast.

 

BOOTSTRAP/[NOBOOTSTRAP]

BOOTSTRAP draws shocks over the forecast period randomly with replacement from the residuals associated with the equation or regression being forecast. Because this is a simple shuffling of the residuals, it would not be completely appropriate for a model with moving average terms if you’re bootstrapping an entire sample.

Variables Defined

%FSTART

Starting entry of forecasts (INTEGER)

%FEND

Ending entry of forecasts (INTEGER)


Examples

The command below forecasts an equation called GDPEQ for the four quarters of 2004. The forecasts are saved into GDPFORE.
 

uforecast(equation=gdpeq,from=2004:1,steps=4) gdpfore

 

 

The next example, from Tsay (2010), uses the @UForeErrors procedure to get benchmark forecasts using the sample mean, then compares the errors with those from an AR(1) estimation. See TSAY3P203.RPF for the full example.

 

stats ibmln * 1997:12

set benchfore 1998:1 1999:12 = %mean

@uforeerrors ibmln benchfore

 

linreg(define=ar1eq) ibmln * 1997:12

# constant ibmln{1}

 

uforecast(equation=ar1eq,static) ar1fore 1998:1 1999:12

@uforeerrors ibmln ar1fore

 

 

This example, taken from Diebold (2004), uses UFORECAST to generate forecasts from an ARIMA model. See the file DIEB3P216.RPF for the full example.

 

boxjenk(regressors,ar=3,noconstant,define=ar3eq) lsales $

  1968:1 1993:12 resids

# time time2 seasons{0 to -11}

*

* Compute the forecasts, and their standard errors over the year 1994.

* Generate upper and lower 95% confidence bands

*

ufore(stderrs=stderrs,equation=ar3eq) fcst 1994:1 1994:12

set upper 1994:1 1994:12 = fcst+1.96*stderrs

set lower 1994:1 1994:12 = fcst-1.96*stderrs

*

* Create a dummy variable to be used in shading the forecast period.

* Since we’re doing forecasts out to 1998:12 later on, we create this

* over that entire period.

*

set forezone * 1998:12 = t>=1994:1

graph(header="History and 12-Month-Ahead Forecast",$

      shading=forezone) 4

# lsales 1992:1 1993:12

# fcst   1994:1 1994:12

# upper  1994:1 1994:12

# lower  1994:1 1994:12


 


Copyright © 2025 Thomas A. Doan