On Tue, 14 Nov 2017, Jules Davy wrote:
I'm using gretl 2017c and tried to use the pdf function with a
binomial distribution. According to the command reference, which says
refer to the cdf function for the required scalar arguments, there are
only 2 (apart from the string which identifies the distribution -- in
this base "B"). But shouldn't there be 3 arguments?
Yes, three arguments are needed. Maybe the doc isn't clear enough, but
for all the cdf and pdf cases we're dividing the arguments into two
categories: first the required parameters, then the "x" value or point
at which the function should be evaluated.
In the case of the binomial we need two parameters, probability and
number of trials, followed by "x" = number of successes. Similarly, we
say that the Student t case needs just one parameter (df), again
followed by an "x" value.
For example to find the probability of 3 successes in 5 flips of a
coin we need 0.5, 3, and 5. I got this command to work after messing
around for a while and first getting some errors:
x = pdf(B, 0.5, 5, 3)
Replaced scalar x = 0.3125
On page 114 of the command reference only the probability and the
number of trials are given as required arguments, not the number of
We say, "Between the arguments d and x, zero or more additional scalar
arguments are required to specify the parameters of the distribution."
The idea is that "x" is always required as the final argument.