Artur T. schrieb:
I've got two questions left:
1. What is "?1:0" exactly doing?
=> is the expression before the '?' true? then assign the value before
the colon (1); otherwise assign the value after the colon (0). It's like
condensend if-elif-endif block.
2. Why is it not possible to set a sample smaller than the number of
loops any more? If I set nulldata 100 for loop 1000 I get the following
output: "Observation number out of bounds
'[i]': bad observation specifier
>> genr rejected[i]=(pv<=confidence_lvl)?1:0"
Since I want to study the sample properties of the ADF test this is not
quite useful :)
I'm not sure but maybe it's because of the --progressive loop option. I
would actually remove all dependences on nulldata, samples, series, and
so on and do it with scalars (and in general matrices, but probably not
needed here) only.
something like:
numberofruns = 1000
siglevel = 0.05
counter = 0
loop numberofruns --quiet
.. blahblah...
adf ...blah
pv = $pvalue
if pv<siglevel
counter += 1
endif
...blah
endloop
printf "Got %d rejections out of %d trials\n", counter, numberofruns
good night,
sven