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:
posterior : StanFit4Model or stan.fit.Fit

PyStan fit object for posterior.

posterior_predictive : str, a list of str

Posterior predictive samples for the posterior.

prior : StanFit4Model or stan.fit.Fit

PyStan fit object for prior.

prior_predictive : str, a list of str

Posterior predictive samples for the prior.

observed_data : str 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_likelihood : str

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

coords : dict[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.

dims : dict[str, List(str)]

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

posterior_model : stan.model.Model

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

prior_model : stan.model.Model

PyStan3 specific model object. Needed for automatic dtype parsing.

Returns:
InferenceData object