Skip to content

Instantly share code, notes, and snippets.

@g-leech
Created July 9, 2021 17:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save g-leech/3bf3072e8521a8c479c353cd105e6f0a to your computer and use it in GitHub Desktop.
Save g-leech/3bf3072e8521a8c479c353cd105e6f0a to your computer and use it in GitHub Desktop.
# 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