Artur T. schrieb:
> Allin Cottrell schrieb:
>
>> 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.
>> _______________________________________________
>> Gretl-users mailing list
>> Gretl-users(a)lists.wfu.edu
>>
http://lists.wfu.edu/mailman/listinfo/gretl-users
>>
>>
> Thanks for all the versions - they all do their job properly.
>
> @Allin
> I was also surprised how often the null is rejected. But actually, as is
> known, the result depends heavily on the number of observations and how
> close %alpha is to the unit.
>
>
What actually are you trying to analyze? Are you aware that the adf test
with --nc is mis-specified, or is this the whole point?
cheers,
sven
_______________________________________________
Gretl-users mailing list
Gretl-users(a)lists.wfu.edu
http://lists.wfu.edu/mailman/listinfo/gretl-users
Yes, actually I wanted to test the validity of the test under
misspecification, sample size and structural breaks. The code was only
one part of the total story.
Artur