cdfBinomialInv#
Purpose#
Computes the binomial quantile or inverse cumulative distribution function.
Format#
- s = cdfBinomialInv(p, trials, prob)#
- Parameters:
p (NxK matrix, Nx1 vector or scalar) – Probabilities at which to compute the inverse of the Binomial cumulative distribution function. \(0 \lt p \lt 1\).
trials (LxM matrix) – ExE conformable with p. \(trials > 0\).
prob (PxQ matrix) – The probability of success on any given trial. ExE conformable with p. \(0 < prob < 1\).
- Returns:
s (NxK matrix, Nx1 vector or scalar) – The number of successes.
Examples#
What is a reasonable range of wins for a basketball team playing 82 games in a season, with a 60% chance of winning any game? For our example we will define a reasonable range as falling between the top and bottom deciles.
// Probability range
range = { .10, .9 };
// Number of trials
trials = 82;
// Probabiliy of success
prob = 0.6
// Call cdfBinomialInv
s = cdfBinomialInv(range, trials, prob);
print "s = " s;
After above code,
s =
43
55
This means that a team with a 60% chance of winning any one game would win between 43 and 55 games in 80% of seasons.
Remarks#
For invalid inputs, cdfBinomialInv()
will return a scalar error code
which, when its value is assessed by function scalerr()
, corresponds to
the invalid input. If the first input is out of range, scalerr()
will
return a 1; if the second is out of range, scalerr()
will return a 2; etc.
See also
Functions cdfBinomial()
, pdfBinomial()
, cdfNegBinomial()
, cdfNegBinomialInv()