poisson_distribution
PoissonDistribution
Bases: BaseDistribution
This class represents a Poisson distribution, a type of statistical distribution where the probability of a given number of events occurring in a fixed interval of time or space is proportional to the mean number of events.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
mean
|
float
|
|
required |
Raises:
| Type | Description |
|---|---|
ValueError
|
If 'mean' argument is negative. |
Example
Create a PoissonDistribution object.
pd = PoissonDistribution(1)
The mean attribute can be accessed and updated.
pd.mean 1 pd.mean = 2 pd.mean 2
Source code in emod_api/utils/distributions/poisson_distribution.py
get_demographic_distribution_parameters()
Yield the flag and relevant values necessary for setting a demographics poisson distribution
Returns:
| Type | Description |
|---|---|
dict
|
a dict of the form: {'flag': X, 'value1': Y, 'value2': Z} |
Source code in emod_api/utils/distributions/poisson_distribution.py
set_intervention_distribution(intervention_object, prefix)
Set the distribution parameters to the object.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
intervention_object
|
ReadOnlyDict
|
|
required |
prefix
|
str
|
|
required |