On 24/11/2024 12:58, Brian Revell wrote:
My concept here of recursive in an Arima model (2 0 1) for
simplicity, with signifnt coeffcts on all parameters would be
Xft+1=b1Xt+b2Xt-1+gErr t
Xft+2=b1Xft+1 +b2Xt
Xft+3 =b1Xft+2 +b2Xft+1 etc
ie the forecasts are endogenous.
Of course with a difference operator in the Arima spec, the forecast
equation becomes more complex when multiplied out.
Sven and Artur have already pointed out that this is exactly what the
--out-of-sample option does.
At the risk of being redundant, here's a demonstration where the same
calculations are also performed explicitly via hansl commands:
<hansl>
set verbose off
clear
set seed 251124
nulldata 64
setobs 4 2010:1
series y = filter(normal(), {1, 0.5}, 0.95)
series u = 0
smpl ; -6
arima 1 1 ; y
T = $t2
printf "native:\n"
fcast --out-of-sample --no-stats
printf "by hand:\n\n"
smpl full
phihat = $coeff[2]
thetahat = $coeff[3]
muhat = $coeff[1] * (1 - phihat)
u = $uhat
ylag = y[T]
ulag = u[T]
loop t = T+1 .. $nobs
yf = muhat + phihat * ylag + thetahat * ulag
ylag = yf
ulag = 0
printf "%s %11.6f %11.6f\n", obslabel(t), y[t], yf
endloop
</hansl>
-------------------------------------------------------
Riccardo (Jack) Lucchetti
Dipartimento di Scienze Economiche e Sociali (DiSES)
Università Politecnica delle Marche
(formerly known as Università di Ancona)
r.lucchetti(a)univpm.it
http://www2.econ.univpm.it/servizi/hpp/lucchetti
-------------------------------------------------------