Risk Exposure Distribution Models

This module contains tools for modeling several different risk exposure distributions.

exception vivarium_public_health.risks.distributions.MissingDataError[source]
class vivarium_public_health.risks.distributions.SimulationDistribution(risk)[source]

Wrapper around a variety of distribution implementations.

Parameters:

risk (str) –

setup(builder)[source]

Defines custom actions this component needs to run during the setup lifecycle phase.

This method is intended to be overridden by subclasses to perform any necessary setup operations specific to the component. By default, it does nothing.

Parameters:

builder (Builder) – The builder object used to set up the component.

Return type:

None

ppf(q)[source]
class vivarium_public_health.risks.distributions.EnsembleSimulation(risk, weights, mean, sd)[source]
property columns_created: List[str]

Provides names of columns created by the component.

Returns:

Names of the columns created by this component, or an empty list if none.

Return type:

List[str]

property initialization_requirements: Dict[str, List[str]]

Provides the names of all values required by this component during simulant initialization.

Returns:

A dictionary containing the additional requirements of this component during simulant initialization. An omitted key or an empty list for a key implies no requirements for that key during initialization.

Return type:

Dict[str, List[str]]

setup(builder)[source]

Defines custom actions this component needs to run during the setup lifecycle phase.

This method is intended to be overridden by subclasses to perform any necessary setup operations specific to the component. By default, it does nothing.

Parameters:

builder (Builder) – The builder object used to set up the component.

Return type:

None

get_parameters(weights, mean, sd)[source]
on_initialize_simulants(pop_data)[source]

Method that vivarium will run during simulant initialization.

This method is intended to be overridden by subclasses if there are operations they need to perform specifically during the simulant initialization phase.

Parameters:

pop_data (SimulantData) – The data associated with the simulants being initialized.

Return type:

None

ppf(q)[source]
class vivarium_public_health.risks.distributions.ContinuousDistribution(risk, mean, sd, distribution=None)[source]
setup(builder)[source]

Defines custom actions this component needs to run during the setup lifecycle phase.

This method is intended to be overridden by subclasses to perform any necessary setup operations specific to the component. By default, it does nothing.

Parameters:

builder (Builder) – The builder object used to set up the component.

Return type:

None

get_parameters(mean, sd)[source]
ppf(q)[source]
class vivarium_public_health.risks.distributions.PolytomousDistribution(risk, exposure_data)[source]
Parameters:
setup(builder)[source]

Defines custom actions this component needs to run during the setup lifecycle phase.

This method is intended to be overridden by subclasses to perform any necessary setup operations specific to the component. By default, it does nothing.

Parameters:

builder (Builder) – The builder object used to set up the component.

Return type:

None

get_categories()[source]
Return type:

List[str]

get_exposure_parameters(builder)[source]
Parameters:

builder (Builder) –

Return type:

Pipeline

ppf(x)[source]
Parameters:

x (Series) –

Return type:

Series

class vivarium_public_health.risks.distributions.DichotomousDistribution(risk, exposure_data)[source]
Parameters:
setup(builder)[source]

Defines custom actions this component needs to run during the setup lifecycle phase.

This method is intended to be overridden by subclasses to perform any necessary setup operations specific to the component. By default, it does nothing.

Parameters:

builder (Builder) – The builder object used to set up the component.

Return type:

None

exposure(index)[source]
Parameters:

index (Index) –

Return type:

Series

ppf(x)[source]
Parameters:

x (Series) –

Return type:

Series

vivarium_public_health.risks.distributions.get_distribution(risk, distribution_type, exposure, exposure_standard_deviation, weights)[source]
vivarium_public_health.risks.distributions.clip(q)[source]

Adjust the percentile boundary casses.

The risk distributions package uses the 99.9th and 0.001st percentiles of a log-normal distribution as the bounds of the distribution support. This is bound up in the GBD risk factor PAF calculation process. We’ll clip the distribution tails so we don’t get NaNs back from the distribution calls