On Sat, 20 Mar 2010, Sven Schreiber wrote:
Ricardo Gonçalves Silva schrieb:
> Hi,
>
> Can Gretl forecast 1 to 3 periods ahead an estimated panel
> data(fixed-effects with no iterations) model?
sorry this is not an answer to your question: I wanted to try it out
myself and got a crash with this little script (on today's cvs version):
<script>
open abdata
smpl +0 -3
panel n 0 w --fixed-effects
fcast
</script>
Forecasting via the "fcast" command in association with panel
models (other than pooled OLS) is not implemented at this point,
sorry. The crash from the script above is now fixed in CVS and the
snapshots, simply by flagging a "not implemented" error.
Note that the effect of doing
smpl ; -3
with panel data is to discard the last 3 panel units, not the last
3 time-series observations for each unit (which could not be done
simply by moving the sample end-points).
It is, however, possible to generate a forecast manually based on
fixed-effects estimates. The following script illustrates.
<script>
open greene14_1.gdt
# number of cross-sectional units
nunits = max($unit)
# number of time periods
T = $nobs/nunits
logs C Q PF
list X = l_Q l_PF LF
# estimate on data up to 1979
smpl year < 1980 --restrict
panel l_C 0 X
# retrieve fitted values
series yh = $yhat
# plus the per-unit intercepts
series ah = $ahat
# and the coefficients on X
matrix b = $coeff[2:]
# restore full time-series length
smpl --full
# expand the per-unit intercepts
loop i=1..nunits
loop t=11..T
k = T*(i-1)+t
ah[k] = ah[k-1]
endloop
endloop
series Xb = {X}*b + ah
print -o yh Xb
</script>
This script shows that the constructed forecast series "Xb"
agrees with the fitted values obtained via $yhat within sample.
Allin Cottrell