mcmc_to_arviz

sherpa.sim.mcmc_to_arviz(mcmc: MCMC, fit: Fit, list_of_draws: list[tuple])[source] [edit on github]

Convert the MCMC results to an ArviZ InferenceData object.

ArviZ is a Python package for exploratory analysis of Bayesian models and provides a range of tools for visualizing and analyzing MCMC results.

This function requires the ArviZ package to be installed.

Added in version 4.17.1.

Parameters:
  • mcmc (MCMC) – The MCMC object used to run the chain.

  • fit (Fit) – The Fit object used to fit the data.

  • list_of_draws (list of tuples) – A list of tuples, each containing three elements as returned from MCMC.get_draws: the statistic, the acceptance rate, and the parameter array. Each tuple corresponds to a single chain run for the same model and MCMC object.

Returns:

inference_data – An ArviZ InferenceData object containing the posterior and log likelihood data.

Return type:

arviz.InferenceData