Created
July 9, 2021 17:13
-
-
Save g-leech/3bf3072e8521a8c479c353cd105e6f0a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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