On 03-01-2010, at 22:27, Sven Schreiber wrote:
still it's a strange setup;
AFAICS the lines
>>>> genr a = 10*uniform()
>>>> genr y = 1*a + normal()
only determine the initial condition of y at t=0, because you're
overwriting all other values of y in the following line anyway. The
influence of "unusual" initial conditions on unit root tests is known
and there is a literature about that. IMO that would explain the
"overrejection" that you're seeing. BTW, here the DGP does not have a
unit root so we all should be happy that the test is rejecting :-)
You beat me to it.
I was getting some doubts about the genr's.
So I decided to initialise y to 0.
The modified script then is
<script>
nulldata 100
# directory of this script and where to store data
string Rundir = "adfcount"
scalar alpha = 0.99
scalar reject = 0
scalar rlevel = 0.05
scalar N = 1000
set stopwatch
loop N --progressive --quiet
series y = 0
genr y = alpha*y(-1) + normal()
adf 1 y --c --quiet
genr pv = $pvalue
reject += (pv<rlevel)
store @Rundir/coeffs.gdt pv
print pv
endloop
time=$stopwatch
printf "Rejections = %d (%.2f%%)\n", reject,100*(reject/N)
printf "CPU seconds used %.2f\n",time
</script>
I've run this several times. The rejection rate still seems to reach 6 or 7 %.
Berend