Hello,
I am building a Bayesian Regression model (see the code bellow) using the PyMC library. When trying to get summary statistics, trace plot and posterior plot I get an error.
I am using Google Colab. Here is the version I am using of PyMC and arviz:
Name: pymc
Version: 5.7.2
Name: arviz
Version: 0.15.1
Code:
with pm.Model() as model:
#priors for unknown model parameters
alpha = pm.Normal('alpha', mu=global_mean_performance, sigma=global_std_performance)
beta = pm.Normal('beta', mu=0, sigma=10)
sigma = pm.HalfNormal('sigma', sigma=10)
#expected value of outcome
mu = alpha + beta * X
#likelihood (sampling distribution) of observations
Y_obs = pm.Normal('Y_obs', mu=mu, sigma=sigma, observed=Y)
#model fitting
trace = pm.sample(100, return_inferencedata=False)
Error:
ValueError: Can only convert xarray dataarray, xarray dataset, dict, netcdf filename, numpy array, pystan fit, emcee fit, pyro mcmc fit, numpyro mcmc fit, cmdstan fit csv filename, cmdstanpy fit to InferenceData, not MultiTrace