arviz.from_pyjags#

arviz.from_pyjags(posterior=None, prior=None, log_likelihood=None, coords=None, dims=None, save_warmup=None, warmup_iterations=0)[source]#

Convert PyJAGS posterior samples to an ArviZ inference data object.

Takes a python dictionary of samples that has been generated by the sample method of a model instance and returns an Arviz inference data object. For a usage example read the Creating InferenceData section on from_pyjags

Parameters:
posterior: dict of {strarray_like}, optional

a dictionary mapping variable names to NumPy arrays containing posterior samples with shape (parameter_dimension, chain_length, number_of_chains)

prior: dict of {strarray_like}, optional

a dictionary mapping variable names to NumPy arrays containing prior samples with shape (parameter_dimension, chain_length, number_of_chains)

log_likelihood: dict of {str: str}, list of str or str, optional

Pointwise log_likelihood for the data. log_likelihood is extracted from the posterior. It is recommended to use this argument as a dictionary whose keys are observed variable names and its values are the variables storing log likelihood arrays in the JAGS code. In other cases, a dictionary with keys equal to its values is used.

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.

save_warmupbool, optional

Save warmup iterations in InferenceData. If not defined, use default defined by the rcParams.

warmup_iterations: int, optional

Number of warmup iterations

Returns:
InferenceData