How would I take this prior distribution and evidence and plug it into pymc3? – Questions

Hi, I’m familiar with Bayesian updates using discrete data – but I’m confused on how to do the same thing for continuous data, and someone recommended PyMC3. Here’s my example:

My somewhat informative prior distribution of outcomes is this:

import numpy as np
import matplotlib.pyplot as plt
from scipy.stats import norm

prior = np.array([20.5,15.25,5.0,29.0,11.75,8.5,8.25,14.5,14.25,
 23.25,31.75,44.5,9.75,2.75, 14.25, 7.0])
prior.sort()
plt.plot(prior, norm.pdf(prior, prior.mean(), prior.std()))

figure

And my observed evidence is:

evidence = np.array([27, 20.75, 24.5]

How would I update this very specific prior distribution, given 3 samples of evidence, using PyMC3? I would expect it to lower the density of outcomes below 20 and above 30 and increase the concentration between 20 and 30.

Thanks so much!

Read more here: Source link