Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
# You can get your own copy of the MCMC trace: https://github.com/g-leech/masks_v_mandates#run
# but I've included the quantiles in this script for reproducibility.
import numpy as np
sns.set_style("whitegrid")
def exp_reduction(a, x):
reductions = 1 - np.exp((-1.0) * a * x)
return reductions.mean()
a = 0.290 #exp_trace.Wearing_Alpha
r = exp_reduction
x = np.arange(-0.2,1,0.01)
y = [ 1- r(i, a) for i in x ]
plt.plot(x * 100, y, label="mean mask effect")
#plt.gca().yaxis.set_major_locator(plt.MaxNLocator(5))
plt.yticks(ticks=[-2, -1, 0, 1, 2])
plt.ylim(-2, 2)
plt.xlim(-15, 50)
plt.axhline(0, color="black", linestyle="--")
plt.axvline(0, color="black", linestyle="--")
plt.ylabel("factor reduction in $R_t$")
plt.xlabel("mask %")
plt.legend()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment