Key Word(s): ??
In [1]:
import pandas as pd
import numpy as np
import pymc3 as pm
import warnings
warnings.filterwarnings('ignore')
from matplotlib import pyplot
%matplotlib inline
In [2]:
df = pd.read_csv('data3.csv')
df.head()
Out[2]:
In [0]:
### edTest(test_pm_model) ###
np.random.seed(109)
with pm.Model() as model:
#Set priors for unknown model parameters
alpha = pm.Normal('alpha',mu=0,tau=1000)
# Likelihood (sampling distribution) of observations
tau_obs = pm.Gamma('tau', alpha=0.001, beta=0.001)
obs = pm.Normal(____________) #Parameters to set: name, mu, tau, observed
# create trace plots
trace = pm.sample(2000, tune=2000)
pm.traceplot(trace, compact=False);
In [0]:
#posterior means
np.mean(trace['alpha']) , np.mean(trace['tau'])
In [0]:
In [0]: