I was interested in trying this code out , but all I get is
gretl version 2019b-git
Current session: 2019-03-02 17:50
? set verbose off
Sorry, command not available for this estimator
which is a bit rubbish, and my gretl is fully up to date!
C
On Thu, 28 Feb 2019 at 22:45, Allin Cottrell <cottrell(a)wfu.edu> wrote:
On Tue, 26 Feb 2019, Sven Schreiber wrote:
> Am 26.02.2019 um 20:06 schrieb Allin Cottrell:
>> BTW, I see that Stata is very restrictive in this department. With
>> "predict" after "xtreg" you can't get an out of sample
forecast even in
the
>> time dimension when no time dummies are present -- other than plain
"xb"
>> which omits individual effects, whether fixed or random.
>
> Well for small-T (standard micro panel assumption) the unit
> effects are not well estimated, are they? That might be the reason
> they ban it. (And probably a good reason.)
Interesting point.
I doubt that's the rationale in Stata's case, since the "ban" is not
conditional on the time-series length of the panel. I suspect it's
because Stata doesn't really make a distinction between
out-of-sample in the cross-sectional dimension and out-of-sample in
the time dimension: it's all just in or out of sample.
But whatever Stata's up to, it's worth assessing whether individual
fixed effects estimated with small T are actually any use in
forecasting out of sample in the time dimension. I show below a
Monte Carlo experiment, comparing out-of-sample MSE for forecasts
computed with and without individual effects. (In the "without" case
I use the global constant, as in Stata's "xb" forecast for fixed
effects.) I simulate 100 individuals observed over T periods, T-1 of
which are used in estimation leaving the last for an out-of-sample
forecast, with T = 4 as baseline.
Executive summary: As Sven suggests, if T is small enough (and the
fixed effects are moderate in size, even if statistically
significant at the usual level on a joint test), then the estimated
effects are just noise so far as forecasting is concerned; the
forecast MSE tends to be smaller without them. But if T is a bit
larger (even just 5 as opposed to the 4 in the script), or if the
scale of the fixed effects passes a certain threshold[*], then
inclusion of the estimated fixed effects enhances the forecast
accuracy quite substantially.
[*] in the script below, with fixed effects simulated by drawings
from U(0,1) * fe_scale, an fe_scale value of 2.5 is sufficient to
make inclusion of the estimated fixed clearly beneficial, even with
a scanty T = 4.
<hansl>
set verbose off
# set seed 87564427
T = 4
N = 100
NT = N*T
nulldata NT --preserve
setobs T 1:1 --stacked-time-series
genr time
series x = normal()
list X = 0 x
series u = normal()
# generate scaled uniform random fixed effect
fe_scale = 2.5
matrix am = fe_scale * muniform(N,1)
series a = pexpand(am)
K = 10000
matrix MSE = zeros(K, 2)
matrix fepv = zeros(K, 1)
loop i=1..K -q
series u = normal()
series y = 5 + x + u + a
smpl time < T --restrict
panel y 0 x --quiet
fepv[i] = $model.fixed_effects_F.pvalue
matrix b = $coeff
fcast --out-of-sample --quiet
smpl time == T --restrict --replace
series fca = $fcast
series fc0 = lincomb(X, b)
MSE[i,1] = sum((y - fca)^2) / $nobs
MSE[i,2] = sum((y - fc0)^2) / $nobs
smpl full
endloop
printf "Forecast MSEs\n"
means = meanc(MSE)
sds = sdc(MSE)
printf "Including fixed effects: mean %g, sd %g\n", means[1], sds[1]
printf "Excluding fixed effects: mean %g, sd %g\n", means[2], sds[2]
printf "memo: average p-value for fixed effects: %g\n", meanc(fepv)
</hansl>
Allin
_______________________________________________
Gretl-users mailing list
Gretl-users(a)lists.wfu.edu
http://lists.wfu.edu/mailman/listinfo/gretl-users
--
Clive Nicholas
"My colleagues in the social sciences talk a great deal about methodology.
I prefer to call it style." -- Freeman J. Dyson