On 02-01-2010, at 20:43, Artur T. wrote:
Hello,
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
Do you know a solution for this?
How about
<script>
scalar rcount = 0
scalar cfdlev = 0.05
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
if pv <= cfdlev
rcount = rcount + 1
endif
store coeffs.gdt pv
endloop
print rcount
</script>
rcount is the number of rejections
Berend