Naive forecasting problem

Questions and discussions on Time Series Analysis
Snow
Posts: 5
Joined: Fri May 18, 2012 9:16 am

Naive forecasting problem

Unread post by Snow »

Hi all,
I'm trying to build some simple forecasting models but I don't know how to do that with Rats. What I'm supposed to is to build two naive models and have tests for the out-of sample forecast:
model 1: No-change model. The forecast for period t+1 will simply be the observation at time t.
model 2: Historical mean model. The forecast for period t+1 will simpley be the historical mean of the data computed up to period t.
Does anyone know how to bulid these two sample model with Rats? I do need to get the root mean squared error for the out of sample part. Thanks
TomDoan
Posts: 7814
Joined: Wed Nov 01, 2006 4:36 pm

Re: Naive forecasting problem

Unread post by TomDoan »

Snow wrote:Hi all,
I'm trying to build some simple forecasting models but I don't know how to do that with Rats. What I'm supposed to is to build two naive models and have tests for the out-of sample forecast:
model 1: No-change model. The forecast for period t+1 will simply be the observation at time t.
model 2: Historical mean model. The forecast for period t+1 will simpley be the historical mean of the data computed up to period t.
Does anyone know how to bulid these two sample model with Rats? I do need to get the root mean squared error for the out of sample part. Thanks
Model 1 has x=x{1} with no estimated parameters. The equation to represent that is

equation(coeffs=1.0) eqn1 x
# x{1}

though if all you need is the one-step-ahead-forecasts, you can do

set naive1 = x{1}

Model 2 has x=mu x CONSTANT (that is, CONSTANT is the only explanatory variable). The simplest way to estimate the rolling values for that is with recursive least squares:

rls(cohistory=mu) x
# constant

The one-step-forecasts would be the lagged value of the mu(1) series:

set naive2 = mu(1){1}

You can use the @UFORERRORS procedure to analyze the forecast errors. That's described in the RATS User's Guide and also at http://www.estima.com/forum/viewtopic.php?f=7&t=1489.
Snow
Posts: 5
Joined: Fri May 18, 2012 9:16 am

Re: Naive forecasting problem

Unread post by Snow »

TomDoan wrote:
Snow wrote:Hi all,
I'm trying to build some simple forecasting models but I don't know how to do that with Rats. What I'm supposed to is to build two naive models and have tests for the out-of sample forecast:
model 1: No-change model. The forecast for period t+1 will simply be the observation at time t.
model 2: Historical mean model. The forecast for period t+1 will simpley be the historical mean of the data computed up to period t.
Does anyone know how to bulid these two sample model with Rats? I do need to get the root mean squared error for the out of sample part. Thanks
Model 1 has x=x{1} with no estimated parameters. The equation to represent that is

equation(coeffs=1.0) eqn1 x
# x{1}

though if all you need is the one-step-ahead-forecasts, you can do

set naive1 = x{1}

Model 2 has x=mu x CONSTANT (that is, CONSTANT is the only explanatory variable). The simplest way to estimate the rolling values for that is with recursive least squares:

rls(cohistory=mu) x
# constant

The one-step-forecasts would be the lagged value of the mu(1) series:

set naive2 = mu(1){1}

You can use the @UFORERRORS procedure to analyze the forecast errors. That's described in the RATS User's Guide and also at http://www.estima.com/forum/viewtopic.php?f=7&t=1489.
Thanks Tom. That's what I've done for model 1:
set fqgdp 2000:1 2011:1 = qgdp{1}
uforecast fqgdp 2000:1 2011:1
print
@uforeerrors fqgdp qgdp

qgdp is the original data I got. Am I right? your equation for model 1 is not right. When I print out your equation, the forcast resulet is unchanged and I want the forecast result be the last period observation value.
TomDoan
Posts: 7814
Joined: Wed Nov 01, 2006 4:36 pm

Re: Naive forecasting problem

Unread post by TomDoan »

The default behavior of UFORECAST is "dynamic" forecasts, which would (for model 1) give you the last observed value before the forecast period for all entries. If you're looking for one-step forecasts, you would need UFORECAST(STATIC) ...
Post Reply