Reproducing Residuals

For questions that don't fall into one of the categories above, such as working with the RATS interface, using Wizards, etc.
Gregory
Posts: 20
Joined: Mon Nov 13, 2006 8:05 am

Reproducing Residuals

Unread post by Gregory »

As a quick check of my work, I like to replicate the series of residuals returned by RATS by recalculating them using the estimated coefficients from the model I've run (from a GARCH model in this particular case). I find that my residuals are the same up to about five decimal places. Does this rounding error appear because RATS displays estimated coefficients at a lower precision than it uses internally? I notice too that when I save %BETA to a file, I get six decimal places, which is fewer than displayed in the results window. Can anyone tell me how I can get at the coefficients in full precision?

Regards,
"You sound pretty good, kid, but can your mom recognize you on the radio?"
- Les Paul
moderator
Site Admin
Posts: 269
Joined: Thu Oct 19, 2006 4:33 pm

Unread post by moderator »

"Does this rounding error appear because RATS displays estimated coefficients at a lower precision than it uses internally? "

Sure. On most types of computers, you'll have 15 digits of precision. Depending on the scale of your coefficient values, the GARCH output is probably showing just over half of those digits.

With respect to writing %BETA (or any array) to a file, there are a lot of ways to do that in RATS. You can use DISPLAY or WRITE, or use MEDIT to display the array in a window and then do File-Export, or create a REPORT and write that to a file.

With DISPLAY, you can use "picture codes" to control the formatting of the output. For example:

open betaout coeffs.txt
display(unit=betaout) ##.############## %beta

If you want to export to an Excel file, I would probably suggest just copying the data into a series:

set coeffs 1 %rows(%beta) = %beta(t)
open copy coeffs.xls
copy(for=xls,org=cols) / coeffs

That will give you the full precision.
Gregory
Posts: 20
Joined: Mon Nov 13, 2006 8:05 am

Unread post by Gregory »

Good stuff. Thanks.
"You sound pretty good, kid, but can your mom recognize you on the radio?"
- Les Paul
Post Reply