distributions.Binomial
Binomial claim counts: n risks, each claiming with probability
Usage
distributions.Binomial()p.
Parameters
n: int-
Number of trials.
p: float-
Claim probability in
[0, 1).
Examples
>>> from prospicio.distributions import Binomial
>>> Binomial(10, 0.3).mean()3.0
Attributes
| Name | Description |
|---|---|
| n | Number of trials. |
| p | Claim probability per trial. |
n
Number of trials.
n: int
p
Claim probability per trial.
p: float
Methods
| Name | Description |
|---|---|
| cdf() |
P(N <= k).
|
| mean() | Mean of the claim count. |
| pmf() |
P(N = k).
|
| quantile() |
Smallest k with P(N <= k) >= p.
|
| sample() |
n claim counts from stream stream of the generator keyed by
|
| variance() | Variance of the claim count. |
cdf()
P(N <= k).
Usage
cdf(k)Parameters
k: int
Returns
float
mean()
Mean of the claim count.
Usage
mean()Returns
float
pmf()
P(N = k).
Usage
pmf(k)Parameters
k: int
Returns
float
quantile()
Smallest k with P(N <= k) >= p.
Usage
quantile(p)Parameters
p: float
Returns
int
sample()
n claim counts from stream stream of the generator keyed by
Usage
sample(n, seed, stream=0)seed.
Parameters
n: intseed: intstream: int = 0
Returns
list of int
variance()
Variance of the claim count.
Usage
variance()Returns
float