discreteUniformCdf¶
Evaluates the discrete uniform cumulative distribution function (CDF).
Synopsis¶
discreteUniformCdf(ix, n)
Required Arguments¶
- int
ix(Input) - Argument for which the discrete uniform CDF is to be evaluated.
ixmust be positive. - int
n(Input) - Scale parameter.
nmust be positive.
Return Value¶
The probability that a discrete uniform random variable takes a value less
than or equal to ix. A value of NaN is returned if an input value is in
error.
Description¶
The function discreteUniformCdf evaluates the discrete uniform
cumulative distribution function (CDF) with scale parameter n, defined
\[F(I|N) = \frac{I}{N}, \phantom{...} 1 \leq I \leq N\]
where I = ix and N = n.
Example¶
In this example, we evaluate the discrete uniform CDF at ix = 3, n =
5.
from __future__ import print_function
from numpy import *
from pyimsl.stat.discreteUniformCdf import discreteUniformCdf
ix = 3
n = 5
p = discreteUniformCdf(ix, n)
print("The probability that a discrete uniform random variable")
print("with scale parameter n = %1i is less than " % n)
print("or equal to %i is %6.4f" % (ix, p))
Output¶
The probability that a discrete uniform random variable
with scale parameter n = 5 is less than
or equal to 3 is 0.6000