From 90437cf69c73d218337f00a691335d05e492ae5d Mon Sep 17 00:00:00 2001 From: markus Date: Thu, 18 Feb 2021 12:30:13 +0100 Subject: [PATCH] make integration sampling more coarse --- cara/montecarlo.py | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/cara/montecarlo.py b/cara/montecarlo.py index 3e0c208e..e10d7bd0 100644 --- a/cara/montecarlo.py +++ b/cara/montecarlo.py @@ -344,7 +344,7 @@ class MCExposureModel: exposure = np.zeros(self.concentration_model.infected.samples) for start, stop in self.exposed.presence.boundaries(): - times = np.arange(start, stop, 0.001) + times = np.arange(start, stop, 0.01) concentrations = np.asarray([self.concentration_model.concentration(t) for t in times]) integrals = np.trapz(concentrations, times, axis=0) exposure += integrals @@ -878,11 +878,10 @@ exposure_models = [MCExposureModel( generate_cdf_curves_vs_qr(masked=False) -# rs = [model.expected_new_cases() for model in large_population_baselines] -# -# print(f"R0 - original variant:\t{np.mean(rs[0])}") -# print(f"R0 - english variant:\t{np.mean(rs[1])}") -# print(f"Ratio between R0's:\t\t{np.mean(rs[1]) / np.mean(rs[0])}") +rs = [model.expected_new_cases() for model in large_population_baselines] +print(f"R0 - original variant:\t{np.mean(rs[0])}") +print(f"R0 - english variant:\t{np.mean(rs[1])}") +print(f"Ratio between R0's:\t\t{np.mean(rs[1]) / np.mean(rs[0])}") # # compare_infection_probabilities_vs_viral_loads(*exposure_models) #