On Wed, Jun 20, 2012 at 12:29 PM, Allin Cottrell <cottrell@wfu.edu> wrote:
On Wed, 20 Jun 2012, Skipper Seabold wrote:

> I was playing around and I think I noticed a bug in ARMA prediction, or I
> am missing something. You can find the data to replicate here
>
> http://www.pastie.org/4120330 [...]

(Annual sun activity data, 1700 to 2008, attached in gretl
format for reference)

Thanks, you're right. There was an off-by-one error in the
code that decides when a dynamic ARMA forecast can start using
previously computed forecast values in place of the observed
data. In your case, with an AR order of 9, gretl didn't start
using computed values until the forecast for 1711, whereas it
should start with the forecast for 1710.

With this point corrected (in CVS), gretl agrees with Stata.

Thanks.
 

<hansl>
open sun-activity.gdt
arima 9 0 0 ; sunactivity
fcast 1709 1720 gretl_fc --dynamic
smpl 1709 1719
print sunactivity gretl_fc --byobs

smpl --full
genr year = time + 1699

foreign language=stata --send-data
  tsset year
  arima sunactivity, arima(9,0,0)
  predict stata_fc, dyn(1709)
  list year sunactivity stata_fc in 10/20
end foreign
</hansl>


Oh, I didn't know about foreign language. Interesting.

Skipper