arviz.from_pymc3#
- arviz.from_pymc3(trace=None, *, prior=None, posterior_predictive=None, log_likelihood=None, coords=None, dims=None, model=None, save_warmup=None, density_dist_obs=True)[source]#
Convert pymc3 data into an InferenceData object.
All three of them are optional arguments, but at least one of
trace
,prior
andposterior_predictive
must be present. For a usage example read the Creating InferenceData section on from_pymc3- Parameters
- tracepymc3.MultiTrace, optional
Trace generated from MCMC sampling. Output of
pymc3.sampling.sample()
.- priordict, optional
Dictionary with the variable names as keys, and values numpy arrays containing prior and prior predictive samples.
- posterior_predictivedict, optional
Dictionary with the variable names as keys, and values numpy arrays containing posterior predictive samples.
- log_likelihoodbool or array_like of str, optional
List of variables to calculate log_likelihood. Defaults to True which calculates log_likelihood for all observed variables. If set to False, log_likelihood is skipped. Defaults to the value of rcParam
data.log_likelihood
.- coordsdict of {str: array-like}, optional
Map of coordinate names to coordinate values
- dimsdict of {str: list of str}, optional
Map of variable names to the coordinate names to use to index its dimensions.
- modelpymc3.Model, optional
Model used to generate
trace
. It is not necessary to passmodel
if inwith
context.- save_warmupbool, optional
Save warmup iterations InferenceData object. If not defined, use default defined by the rcParams.
- density_dist_obsbool, default True
Store variables passed with
observed
arg topymc3:pymc.distributions.DensityDist
in the generated InferenceData.
- Returns
- InferenceData