diff --git a/cara/montecarlo.py b/cara/montecarlo.py index 5dececbf..8e6cf49c 100644 --- a/cara/montecarlo.py +++ b/cara/montecarlo.py @@ -476,7 +476,7 @@ def print_qr_info(log_qr: np.ndarray) -> None: f"Median of qR = {np.quantile(qr_values, 0.5)}\n") print(f"Percentiles of qR:") - for quantile in (0.01, 0.05, 0.25, 0.50, 0.75, 0.95, 0.99): + for quantile in (0.01, 0.05, 0.25, 0.50, 0.55, 0.65, 0.75, 0.95, 0.99): print(f"qR_{quantile} = {np.quantile(qr_values, quantile)}") def present_qR_values(model: MCConcentrationModel) -> None: @@ -490,6 +490,19 @@ def present_qR_values(model: MCConcentrationModel) -> None: print_qr_info(np.asarray(qRs)) +def present_qR_quantiles(model: MCConcentrationModel, quantile: float = 0.5) -> None: + """ + Displays a handful of key parameters and results of qR from a given MCConcentrationModel + :param model: The MCConcentrationModel representing the scenario to be presented + :param quantile: the quantile of qR + :return: Nothing, parameters are printed + """ + + qRs = (np.log10(model.infected.emission_rate_when_present())) + log_qr = np.asarray(qRs) + qr_values = 10 ** log_qr + print(f"qR_{quantile} = {np.quantile(qr_values, quantile)}") + def present_model(model: MCConcentrationModel, bins: int = 200, title: str = 'Summary of $qR$ model parameters') -> None: """