Thanks, I’ll post it in the github repo asap. Let me clarify for future users (myself included) the changes:
with pm.Model() as d_model:
# Specify the covariance function.
vert = 1*pm.HalfNormal("vert", sigma=1)
l = pm.HalfNormal(name='l', sigma=1)
cov_func = vert**2 * pm.gp.cov.Matern32(1, ls=l)
# Specify the GP. The default mean function is zero.
#gp = pm.gp.Marginal(mean_init, cov_func=cov_func)
gp = pm.gp.Marginal(cov_func=cov_func)
# Place a GP prior over the function f and do the noise:
sigma = pm.HalfNormal("sigma", sigma=1)
y_ = gp.marginal_likelihood("y_", X=X, y=y.flatten(), noise=sigma)
# MCMC:
trace = pm.sample(1000, chains=3, tune=1000, target_accept=0.99)
X_new = np.linspace(-1.5, 1.5, 100)
X_new = X_new.reshape(-1,1)
with d_model:
f_p = gp.conditional("f_p", X_new)
#Important to add var_names in the next one:!!
pred_samples = pm.sample_posterior_predictive(trace, var_names=["f_p"])