Uncertainty

This module contains a couple functions to calculate uncertainty based on chains of MCMC samples.

uncertainty.credible_interval_range(chain, alpha=0.05)

Calculates the range of the credible interval of MCMC samples at a given confidence level

Parameters
  • chain\(N_{\mathrm{samples}}\times N_{\mathrm{params}}\) array containing MCMC samples

  • alpha (float) – confidence level

Returns

array of credible interval ranges for each parameter

uncertainty.wavelet_credible_interval_range(chain, L, B, J_min, alpha=0.05)

Maps the credible interval range at different wavelet scales. Assumes each sample in chain is a set of wavelet coefficients in multiresolution format. Maps are returned in MW (theta, phi) format.

Parameters
  • chain\(N_{\mathrm{samples}}\times N_{\mathrm{params}}\) array containing MCMC samples

  • L (int) – angular bandlimit

  • B (float) – wavelet scale parameter

  • J_min (int) – minimum wavelet scale

  • alpha (float) – confidence level

Returns

array of credible interval ranges for each wavelet coefficient

uncertainty.credible_region_threshold(logpis, alpha=0.05)

Calculates the log posterior threshold for a sample to be part of the credible set at a given confidence level.

Parameters
  • logpis – vector of log posterior probabilities of MCMC samples

  • alpha (float) – confidence level

Returns

log posterior threshold