P.S. This is the code just as a reference
#### modeling part using the MutableData so that I could predict new y values given new x values
x = x_values
y = mag
with pm.Model() as model_final:
x_final = pm.MutableData("x_final", x)
y_mag = pm.MutableData("y_mag", y)
err_odr = pm.HalfNormal('err_odr', 5.)
err_param = pm.HalfNormal('err_param', 1.)
x_lat = pm.Normal('x_mu', 0, 5., shape=x_final.shape[0])
x_obs = pm.Normal('x_obs', mu=x_lat, sigma=err_odr, observed=x_final, shape=x_final.shape[0])
offset = pm.Normal('Intercept', 0, err_param)
slope = pm.Normal('Slope', 0, err_param)
y_pred = pm.Deterministic('y_pred', offset + slope * x_lat)
y_obs = pm.Normal('y', mu=y_pred, sigma=err_odr, observed=y_mag)
trace_final = pm.sample(4000, tune=2500, chains=8, cores=8, init='jitter+adapt_diag', random_seed= 42)
### prediction part
with model_final:
pm.set_data({"x_final" : [-2,-1,1.5,2.5,4,5,7]})
pred = pm.sample_posterior_predictive(trace_final)
### This is how I look at the std and mean values for each x_final value prediction
pred.posterior_predictive['y'].mean(('chain', 'draw'))
pred.posterior_predictive['y'].std(('chain', 'draw'))