Am 16.10.2014 um 05:24 schrieb Alecos Papadopoulos:
Good afternoon.
I run gretl 1.9.92 64-bit for Windows.
For 0.05 < prob < 0.95
The function
critical(B, prob, 1, p=0.05)
returns the value "1".
As the Help says, the function "returns x such that P(X > x) = p". Since
This part of the doc looks wrong for discrete distributions anyway,
because in general you will not be able to hit an x/p-combination with
equality if the function is not continuous.
number of trials is equal to 1, we just have a Bernoulli, with P(X=0)
=
1-prob and P(X=1) =prob. So by returning "1" the function asserts that
P(X > 1) = 0.05 > 0
If the function returned "0" it would assert that P(X > 0) = 0.05 < prob
=P(X=1)
I take note of the asymmetry (in the first case, the function "sends
some probability to the right"), -can this be the rule that leads to the
function returning "1"?
I would argue that a function named 'critical' is related to hypothesis
testing, so let's think about these tests in a discrete framework. The
pre-specified significance level alpha is *not* in general equal to the
type-I error of the test, because given the discreteness ("lumpiness")
of the prob. distribution that equality is not always possible. So
instead the standard definition is that "choose a rejection region such
that the type-I error is as large as possible but does not exceed alpha".
So with Bernoulli if your H0 is P(X=1) = prob, and you pre-specify your
alpha, whenever prob > alpha, you must not include the value 1 in your
rejection region, because you would violate your significance level.
Since in the definition of 'critical' it says X>x, returning the value 1
does the right thing because it is just barely not included in the
rejection region.
The more exact definition (perhaps also should be in the docs) would
probably be something like this:
" returns the minimal possible value x such that still P(X > x) <= p
holds". Of course, for the standard continuous case this is probably
more confusing than helpful.
Now, the function
invcdf(B, prob, 1, 0.05)
returns "NA"
A CDF for discrete variables is not strictly increasing and thus not
invertible. This could be the rationale for NA. Perhaps alternative
conventions could be used for invcdf(), but you would have to argue that
it's useful or necessary.
hth,
sven