pymc.to_inference_data#
- pymc.to_inference_data(trace=None, *, prior=None, posterior_predictive=None, log_likelihood=False, log_prior=False, coords=None, dims=None, sample_dims=None, model=None, save_warmup=None, include_transformed=False)[source]#
Convert pymc 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_pymc- Parameters:
- trace
MultiTrace
, optional Trace generated from MCMC sampling. Output of
sample()
.- prior
dict
, optional Dictionary with the variable names as keys, and values numpy arrays containing prior and prior predictive samples.
- posterior_predictive
dict
, 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 False. If set to True, computes log_likelihood for all observed variables.
- log_priorbool or array_like of
str
, optional List of variables to calculate log_prior. Defaults to False. If set to True, computes log_prior for all unobserved variables.
- coords
dict
of {str: array_like}, optional Map of coordinate names to coordinate values
- dims
dict
of {str:list
ofstr
}, optional Map of variable names to the coordinate names to use to index its dimensions.
- model
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.
- include_transformedbool, optional
Save the transformed parameters in the InferenceData object. By default, these are not saved.
- trace
- Returns: