Page 1 of 1

Forecasting problem

PostPosted: Sun Feb 03, 2013 5:25 pm
by student
Hello guys!

I just started using rats and don't fully understand it. Basically, that's what I need to do:

3. The task: take the estimation data set as the complete data set except for the last four years (referred to as the forecast period).

o On the estimation data set estimate your chosen model and interpret the coefficients.
o Use PRJ to project the data over the forecast period.
o Print and graph the actual and forecasts.

4. Evaluation

o Obtain the forecast error defined as: actual minus forecast.
o Square the forecast errors.
o Obtain the mean of the squared forecast errors (hint: use STATISTICS).
o Obtain the square root of the mean of the squared forecast errors (the root mean squared error).

I put this for the evaluation question:

# ydetrend 2005:1 2008:1
smpl 2005:1 2008:1
set ferrory = ydetrend
print / ferrory
set ferrory = ferrory^2
statistics ferrorysq
compute meansqerrory = %mean
compute rmse = %mean^0.5
display 'root mean squared error is' rmse

but I keep getting error, I'm not sure what I'm doing wrong. Hope you can help me! Thank you

Re: Forecasting problem

PostPosted: Sun Feb 03, 2013 6:14 pm
by TomDoan
set ferrory = ferrory^2

Don't you mean set ferrorysq on the left side?

Also, you might want to look at the @UFORERRORS procedure (page UG-166 of the RATS 8 User's Guide) which will do the calculation of the statistics on the forecast errors. There are many examples of its use in the textbook examples:

http://www.estima.com/cgi-bin/bookbrowser.cgi?Subject=Any&RATSReference=@UFOREERRORS&Level=Any&Textbook=Any