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.