> I am bit eager to know the formula.
The following script illustrates how gretl calculates the forecast
standard errors for an AR(1) model estimated via Prais-Winsten.
<script>
open data9-7
# reserve a couple of observations
smpl ; 1990:2
ar1 QNC 0 INCOME --pwe
# save the Standard Error of Regression and rho-hat
SER = $sigma
rho = $rho
# set forecast range
smpl 1989:1 1990:4
fcast
# save forecast standard errors
series fcerr = $fcerr
# calculate standard errors manually and check
err1 = SER
check1 = fcerr[1990:3] - err1
err2 = sqrt((1 + rho^2) * SER^2)
check2 = fcerr[1990:4] - err2
</script>
Allin Cottrell
Thank you very much Allin, but I still have another question, do you apply a
small sample correction or something else? Because I tried to double check
this formula and is not the same, in my sample I only have 7 years, let me
show some of my numbers:
My prediction in GRETL is:
2007 166.82 0.693 164.89 - 168.74
2008 181.81 0.709 179.84 - 183.77
And Rho and SER:
gretl console: type 'help' for a list of commands
? rho=$rho
Generated scalar rho = -0.883014
? SER=$sigma
Generated scalar SER = 0.693017
?
So applying your formula, I have err2=SQRT((1+(-0.883014^2))*(0.693017^2)),
But I have a result of 0.924526, when it should be 0.709, shouldn't it? Do
you know why I have such a difference?
By the way, the error for the third prediction is the same for the second
on, err3=err2?
Thank you very much for your time.
Good evening