On Sat, 2 Jan 2010, Artur T. wrote:
I programmed the following loop and wanted to count how often the
null
is rejected for the ADF test. Unfortunately I do not know whether there
is a simple function for this.
loop 1000 --progressive --quiet
genr a = 10*uniform()
genr y = 1*a + normal()
alpha = 0.99
genr y = alpha*y(-1) + normal()
adf 1 y --nc --quiet
genr pv = $pvalue
print pv
store coeffs.gdt pv
endloop
<script>
nulldata 100 # or whatever
scalar alpha = 0.99
scalar level = 0.05 # or whatever
scalar reject = 0
scalar replics = 1000
loop replics --progressive --quiet
genr a = 10*uniform()
genr y = 1*a + normal()
genr y = alpha*y(-1) + normal()
adf 1 y --nc --quiet
genr pv = $pvalue
reject += (pv < level)
print pv
store pvals.gdt pv
endloop
printf "rejections = %d (%.2f%%)\n", reject, 100*reject/replics
</script>
From running this a few times, it looks as if this test is
over-rejecting quite seriously (if I'm interpreting the results
correctly). I'll look into this further.
Allin.