Skip to content

Instantly share code, notes, and snippets.

@galenseilis
Created October 16, 2022 01:39
Show Gist options
  • Select an option

  • Save galenseilis/6aed1b8ebeee1e29217a357737620202 to your computer and use it in GitHub Desktop.

Select an option

Save galenseilis/6aed1b8ebeee1e29217a357737620202 to your computer and use it in GitHub Desktop.
from scipy.stats import beta
import matplotlib.pyplot as plt
import numpy as np
params = [[81, 219],
[82, 219],
[81+100, 219+200]]
for a, b in params:
fig, ax = plt.subplots(1, 1)
x = np.linspace(0.15, 0.40, 10000)
y = beta.pdf(x, a, b)
ax.plot(x, y, 'k')
ax.set_xlabel('x')
if a != 181:
ax.set_ylabel(f'dbeta(x, {a}, {b})')
else:
ax.set_ylabel(f'dbeta(x, 81 + 100, 219 + 200)')
plt.show()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment