document lognormal

This commit is contained in:
markus 2021-02-10 12:00:05 +01:00
parent e88c4b8e99
commit d98910d823

View file

@ -90,6 +90,13 @@ log_viral_load_frequencies = scoeh_vl_frequencies if USE_SCOEH else symptomatic_
def lognormal(csi: float, lamb: float, samples: int) -> np.ndarray:
"""
Generates a number of samples from a specified lognormal distribution
:param csi: A parameter used to specify the lognormal distribution
:param lamb: A parameter used to specify the lognormal distribution
:param samples: The number of samples to be generated
:return: A numpy-array containing
"""
sf_norm = sct.norm.sf(np.random.normal(size=samples))
return sct.lognorm.isf(sf_norm, csi, loc=0, scale=np.exp(lamb))