application_vnd.jupyter.stderr_output_1.png image_output_1.png
from scipy.stats import binom

import numpy as np # linear algebra

import seaborn as sns

import matplotlib.pyplot as plt
import seaborn as sns
sns.set(color_codes=True)
sns.set(rc={'figure.figsize': (1.6 * 8, 8)})
from scipy.stats import binom

x = np.arange(0, 1, 0.01)
L = binom.pmf(k=301, n=1000, p=x)
prior_prob = 1 / len(L)
delta_theta = 0.01
D = np.sum(L * prior_prob * delta_theta)
P = L * prior_prob / D
ax = sns.lineplot(x, P)
ax.set(xlabel='x', ylabel='f(x)', title=f'Probability Density Function for p (constant prior)')