exponential_distribution
ExponentialDistribution
Bases: BaseDistribution
This class represents an exponential distribution, a type of statistical distribution where the probability of an event decreases exponentially with time. An exponential distribution is defined by a single parameter: the mean, which represents the average time between events.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
mean
|
float
|
|
required |
Raises:
| Type | Description |
|---|---|
ValueError
|
If 'mean' argument is negative. |
Example
Create an ExponentialDistribution object.
ed = ExponentialDistribution(1)
The mean attribute can be accessed and updated.
ed.mean 1 ed.mean = 2 ed.mean 2
Source code in emod_api/utils/distributions/exponential_distribution.py
get_demographic_distribution_parameters()
Yield the flag and relevant values necessary for setting a demographics exponential distribution
Returns:
| Type | Description |
|---|---|
dict
|
a dict of the form: {'flag': X, 'value1': Y, 'value2': Z} |
Source code in emod_api/utils/distributions/exponential_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 |