Certainly,
I have this model (that I’m still figuring out):
with pm.Model() as model:
# Priors
home_intercept = pm.Poisson('home_ntercept', mu=2)
away_intercept = pm.Poisson('away_intercept', mu=2)
home_coeff = pm.Normal('home_coeff', mu=0, sigma=1, shape=home_train.shape[1])
away_coeff = pm.Normal('away_coeff', mu=0, sigma=1, shape=away_train.shape[1])
home_imp = pm.Normal("home_imp", mu=0, sigma=3, observed = home_train)
away_imp = pm.Normal("away_imp", mu=0, sigma=3, observed = away_train)
# Model error
eps = pm.HalfCauchy('eps', beta=1)
# Likelihood function
mu = (home_intercept + pm.math.dot(home_coeff, home_imp.T)) - \
(away_intercept + pm.math.dot(away_coeff, away_imp.T))
likelihood = pm.Normal('y', mu=mu, sigma=eps, observed = y_train)
# Inference
trace = pm.sample(draws=1000, tune=1000, chains=4)
And I train it with x_train, y_train, but I would like to be able to then make predictions with some data I have stored as x_test to investigate how well it fits y_test.