On Sun, 22 Jul 2012, yadong li wrote:
is there any way to obtain out of sample R square using Gretl ?
I tried many time but couldn't figure it out.
R-squared is not a commonly used statistic for assessing out of
sample forecasts, since nothing guarantees that it lies in the range
0 to 1; it may well be negative. However, if you really want it,
here's an example:
<hansl>
open data9-7.gdt
smpl ; 1988:4
ols QNC 0 PRICE INCOME PRIME
smpl 1989:1 1990:4
fcast QNC_hat
ESS = sum((QNC - QNC_hat)^2)
R2 = 1 - (ESS/sst(QNC))
</hansl>
Note that if you replace "fcast QNC_hat" above with plain "fcast"
you will get the standard range of forecast evaluation statistics
(not including R-squared).
Allin Cottrell