pybop.samplers.mcmc_summary#
Classes#
Module Contents#
- class pybop.samplers.mcmc_summary.PosteriorSummary(chains: numpy.ndarray, significant_digits: int = 4)[source]#
- _autocorrelate_negative(autocorrelation)[source]#
Returns the index of the first negative entry in
autocorrelation, orlen(autocorrelation)if a negative entry is not found.
- _calculate_statistics(fun, attr_name, *args, **kwargs)[source]#
Calculate statistics from callable fun.
- autocorrelation(x: numpy.ndarray) numpy.ndarray[source]#
Computes the autocorrelation (Pearson correlation coefficient) of a numpy array representing samples.
- effective_sample_size(mixed_chains=False)[source]#
Computes the effective sample size (ESS) for each parameter in each chain.
- Parameters:
mixed_chains (bool, optional) – If True, the ESS is computed for all samplers mixed into a single chain. Defaults to False.
- Returns:
A list of effective sample sizes for each parameter in each chain, or for the mixed chain if mixed_chains is True.
- Return type:
list
- Raises:
ValueError – If there are fewer than two samples in the data.
- get_summary_statistics()[source]#
Calculate summary statistics for the posterior samples.
Returns: dict: Summary statistics including mean, median, standard deviation, and 95% credible interval.