RATS 10.1
RATS 10.1

Why Don’t I Get Forecasted Values?

At some point, you may discover that you are getting NA’s (missing values) for one or more of the periods for which you expected to get forecasts. Almost without exception, this will be because required right-hand-side values were not available, either due to missing values in the data set, a mistake in specifying the forecast range, or (for simultaneous equation systems) a mistake in the model specification itself.

 

Consider a simple forecast model where series \(y\) at time \(t\) depends only on series \(x\) at time \(t\) plus a constant term, a model you could estimate using:

 

linreg(define=yeq) y

# constant x

 

Remember, if you are forecasting this as a single-equation model (rather than as part of a system), you cannot possibly compute a forecasted value for \(Y_t\) unless the series \(X\) already contains a valid number at time \(t\). Suppose these are quarterly data, and you have data for \(X\) through 2018:2. If you do:

 

uforecast(equation=yeq,print) yhat 2018:3 2018:4

 

the forecasts will be reported as “NA” because \(X\) (upon which \(Y\) depends) is itself undefined (NA) for these periods. To get out-of-sample forecasts for \(Y\), you will need to supply values for \(X\) yourself over the forecast range (using SET or COMPUTE or by reading them in from a data file), or you will need to define and estimate a model for \(X\) and compute forecasts, either independently, or as part of a system which also includes the equation for \(Y\).

 

Finding the Problem

First, turn on the PRINT option on your forecasting instruction so you can see the forecasts as RATS is calculating them.

 

If these look correct, but the series in which you save the forecasts have NA’s, then you have a problem with the way you are saving or using the forecasts. Make sure that you’re using variable names in the correct positions.

 

If the displayed forecasts coming out of the forecasting instruction show problems, there’s a problem with either your data or the model (or both). Check the following:

1.If you are forecasting a multiple-equation system, make sure your equations have been defined and estimated properly, and that you’ve remembered to include all the required equations on supplementary cards or in the MODEL. In particular, make sure that you’ve included any required identity equations.

2.Check your data! Many users have wasted a great deal of time searching for programming mistakes when the real problem was simply missing data in one or more right-hand-side variables. If you are having trouble getting forecast values, do yourself a favor and check the right-hand-side data series carefully, by using the PRINT instruction or double-clicking the series in the Series Window list to display the actual series used in the model. A common mistake is verifying that original series are OK, forgetting that transformations (such as log of a negative number) can produce NA’s. Check the data that are actually being used in the model!

3.Check the range for which you are trying to compute forecasts—make sure you aren’t starting your forecasts too far beyond the end of your available data. Suppose you have a simple ARIMA model for a monthly series:

boxjenk(ar=1,define=areq) y

 

and you have data for Y through 2017:12. You could produce forecasts out to any horizon if you start forecasting at entry 2018:1 (or earlier). However, if you tried to start at 2018:2 (or later), you would get NA’s at every forecast horizon. That’s because Y at 2018:2 depends on Y at 2018:1 and you don’t have data for that observation.


Copyright © 2025 Thomas A. Doan