arviz.from_pystan

arviz.from_pystan(posterior=None, *, posterior_predictive=None, prior=None, prior_predictive=None, observed_data=None, log_likelihood=None, coords=None, dims=None, posterior_model=None, prior_model=None)[source]

Convert PyStan data into an InferenceData object.

Parameters
posteriorStanFit4Model or stan.fit.Fit

PyStan fit object for posterior.

posterior_predictivestr, a list of str

Posterior predictive samples for the posterior.

priorStanFit4Model or stan.fit.Fit

PyStan fit object for prior.

prior_predictivestr, a list of str

Posterior predictive samples for the prior.

observed_datastr or a list of str

observed data used in the sampling. Observed data is extracted from the posterior.data. PyStan3 needs model object for the extraction. See posterior_model.

log_likelihoodstr

Pointwise log_likelihood for the data. log_likelihood is extracted from the posterior.

coordsdict[str, iterable]

A dictionary containing the values that are used as index. The key is the name of the dimension, the values are the index values.

dimsdict[str, List(str)]

A mapping from variables to a list of coordinate names for the variable.

posterior_modelstan.model.Model

PyStan3 specific model object. Needed for automatic dtype parsing and for the extraction of observed data.

prior_modelstan.model.Model

PyStan3 specific model object. Needed for automatic dtype parsing.

Returns
InferenceData object