june.infection.transmission¶
-
class
june.infection.transmission.
Transmission
¶ -
__init__
()¶ Initialize self. See help(type(self)) for accurate signature.
-
classmethod
object_from_config
()¶ Loads the default Transmission class from the general.ini config file and returns the class as object (not as an instance). This is used to set up the epidemiology model in world.py via configs if an input is not provided.
-
update_infection_probability
(time_from_infection)¶
-
probability
¶
-
-
class
june.infection.transmission.
TransmissionConstant
(probability=0.3)¶ -
__init__
(probability=0.3)¶ Initialize self. See help(type(self)) for accurate signature.
-
classmethod
from_file
(config_path: str = PosixPath('/home/sadie/JUNE/configs/defaults/transmission/TransmissionConstant.yaml')) → june.infection.transmission.TransmissionConstant¶
-
classmethod
object_from_config
()¶ Loads the default Transmission class from the general.ini config file and returns the class as object (not as an instance). This is used to set up the epidemiology model in world.py via configs if an input is not provided.
-
update_infection_probability
(time_from_infection)¶
-
probability
¶
-
-
class
june.infection.transmission.
TransmissionGamma
(max_infectiousness: float = 1.0, shape: float = 2.0, rate: float = 3.0, shift: float = - 2.0, max_symptoms: Optional[str] = None, asymptomatic_infectious_factor: Optional[float] = None, mild_infectious_factor: Optional[float] = None)¶ - Module to simulate the infectiousness profiles found in :
- max_infectiousness:
value of the infectiousness at its peak
- shape:
shape parameter of the gamma distribution (a for scipy stats)
- rate:
rate parameter of the gamma distribution (1/rate = scale for scipy stats)
- shift:
location parameter of the gamma distribution
- max_symptoms:
maximum symptoms the individual will develop, used to reduce the infectiousness of asymptomatic and mild individuals if wanted
- asymptomatic_infectious_factor:
factor to reduce the infectiousness of asymptomatic individuals
- mild_infectious_factor:
factor to reduce the infectiousness of mild individuals
-
__init__
(max_infectiousness: float = 1.0, shape: float = 2.0, rate: float = 3.0, shift: float = - 2.0, max_symptoms: Optional[str] = None, asymptomatic_infectious_factor: Optional[float] = None, mild_infectious_factor: Optional[float] = None)¶ - max_infectiousness:
value of the infectiousness at its peak
- shape:
shape parameter of the gamma distribution (a for scipy stats)
- rate:
rate parameter of the gamma distribution (1/rate = scale for scipy stats)
- shift:
location parameter of the gamma distribution
- max_symptoms:
maximum symptoms the individual will develop, used to reduce the infectiousness of asymptomatic and mild individuals if wanted
- asymptomatic_infectious_factor:
factor to reduce the infectiousness of asymptomatic individuals
- mild_infectious_factor:
factor to reduce the infectiousness of mild individuals
-
_modify_infectiousness_for_symptoms
(max_symptoms: str, asymptomatic_infectious_factor=None, mild_infectious_factor=None)¶ Lowers the infectiousness of asymptomatic and mild cases, by modifying the norm of the distribution
- max_symptoms:
maximum symptom severity the person will ever have
- asymptomatic_infectious_factor:
factor to reduce the infectiousness of asymptomatic individuals
- mild_infectious_factor:
factor to reduce the infectiousness of mild individuals
-
classmethod
from_file
(max_symptoms: str = None, config_path: str = PosixPath('/home/sadie/JUNE/configs/defaults/transmission/nature.yaml')) → june.infection.transmission.TransmissionGamma¶ Generate transmission class reading parameters from config file
- max_symptoms:
maximum symptoms the individual will develop, used to reduce the infectiousness of asymptomatic and mild individuals if wanted
- config_path:
path to config parameters
TransmissionGamma instance
-
classmethod
from_file_linked_symptoms
(time_to_symptoms_onset: float, max_symptoms: str = None, config_path: str = PosixPath('/home/sadie/JUNE/configs/defaults/transmission/nature.yaml')) → june.infection.transmission.TransmissionGamma¶ Generate transmission class reading parameters from config file, linked to the time of symptoms onset
- time_to_symptoms_onset:
time (from infection) at which the person becomes symptomatic
- max_symptoms:
maximum symptoms the individual will develop, used to reduce the infectiousness of asymptomatic and mild individuals if wanted
- config_path:
path to config parameters
TransmissionGamma instance
-
classmethod
object_from_config
()¶ Loads the default Transmission class from the general.ini config file and returns the class as object (not as an instance). This is used to set up the epidemiology model in world.py via configs if an input is not provided.
-
update_infection_probability
(time_from_infection: float)¶ Performs a probability update given time from infection
- time_from_infection:
time elapsed since person became infected
-
norm
¶
-
probability
¶
-
scale
¶
-
shape
¶
-
shift
¶
-
property
time_at_maximum_infectivity
¶ Computes the time at which the individual is maximally infectious (in this case for a gamma distribution
- t_max:
time at maximal infectiousness
-
june.infection.transmission.
gamma_pdf
(x: float, a: float, loc: float, scale: float) → float¶ Implementation of gamma PDF in numba
- x:
x variable
- a:
shape factor
- loc:
denominator in exponential
scale:
evaluation fo gamma pdf
-
june.infection.transmission.
gamma_pdf_vectorized
(x: float, a: float, loc: float, scale: float) → float¶ Implementation of gamma PDF in numba
- x:
x variable
- a:
shape factor
- loc:
denominator in exponential
scale:
evaluation fo gamma pdf