naginterfaces.library.stat.prob_binomial_vector¶
- naginterfaces.library.stat.prob_binomial_vector(n, p, k)[source]¶
prob_binomial_vector
returns a number of the lower tail, upper tail and point probabilities for the binomial distribution.For full information please refer to the NAG Library document for g01sj
https://support.nag.com/numeric/nl/nagdoc_30.2/flhtml/g01/g01sjf.html
- Parameters
- nint, array-like, shape
, the first parameter of the binomial distribution.
- pfloat, array-like, shape
, the second parameter of the binomial distribution.
- kint, array-like, shape
, the integer which defines the required probabilities.
- Returns
- plekfloat, ndarray, shape
, the lower tail probabilities.
- pgtkfloat, ndarray, shape
, the upper tail probabilities.
- peqkfloat, ndarray, shape
, the point probabilities.
- ivalidint, ndarray, shape
indicates any errors with the input arguments, with
No error.
On entry, .
On entry, , or, .
On entry, , or, .
On entry, is too large to be represented exactly as a real number.
On entry, the variance () exceeds .
- Raises
- NagValueError
- (errno )
On entry, .
Constraint: .
- (errno )
On entry, .
Constraint: .
- (errno )
On entry, .
Constraint: .
- Warns
- NagAlgorithmicWarning
- (errno )
On entry, at least one value of , or was invalid.
Check for more information.
- Notes
Let denote a vector of random variables each having a binomial distribution with parameters and ( and ). Then
The mean of the each distribution is given by and the variance by .
prob_binomial_vector
computes, for given , and , the probabilities: , and using an algorithm similar to that described in Knüsel (1986) for the Poisson distribution.The input arrays to this function are designed to allow maximum flexibility in the supply of vector arguments by re-using elements of any arrays that are shorter than the total number of evaluations required. See the G01 Introduction for further information.
- References
Knüsel, L, 1986, Computation of the chi-square and Poisson distribution, SIAM J. Sci. Statist. Comput. (7), 1022–1036