From d98910d82321f5b31c3d3cd9cf7e0e005ba90f57 Mon Sep 17 00:00:00 2001 From: markus Date: Wed, 10 Feb 2021 12:00:05 +0100 Subject: [PATCH] document lognormal --- cara/montecarlo.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/cara/montecarlo.py b/cara/montecarlo.py index dc6d7fa2..e26c94cc 100644 --- a/cara/montecarlo.py +++ b/cara/montecarlo.py @@ -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))