tensiometer.parameter_reporting

This file contains some utilities to report parameter results in a nice way.

tensiometer.parameter_reporting.get_PJHPD_bounds(chain, param_names, levels)[source]

Compute some estimate of the global ML confidence interval as described in https://arxiv.org/pdf/2007.01844.pdf

Parameters:
  • chainMCSamples the input chain.
  • param_names – optional choice of parameter names to restrict the calculation. Default is all parameters.
  • levels – array with confidence levels to compute, i.e. [0.68, 0.95]
Returns:

an array with the bounds for each parameter.

tensiometer.parameter_reporting.get_best_fit_params(chain, param_names)[source]

Utility to compute the parameter best fit. This tries to load the best fit from file and if it fails reports the best fit from samples (which could be noisy).

Parameters:
  • chainMCSamples the input chain.
  • param_names – optional choice of parameter names to restrict the calculation. Default is all parameters.
Returns:

an array with the best fit.

tensiometer.parameter_reporting.get_mean(chain, param_names)[source]

Utility to compute the parameter mean. Mostly this is an utility to get the mean from parameter names rather than parameter indexes as we would do in GetDist.

Parameters:
  • chainMCSamples the input chain.
  • param_names – optional choice of parameter names to restrict the calculation. Default is all parameters.
Returns:

an array with the mean.

tensiometer.parameter_reporting.get_mode1d(chain, param_names)[source]

Utility to compute the peak of the 1d posterior distribution for all parameters (parameter 1d mode). This depends and relies on the precomputed KDE smoothing so one can feed different analysis settings to change that.

Parameters:
  • chainMCSamples the input chain.
  • param_names – optional choice of parameter names to restrict the calculation. Default is all parameters.
Returns:

an array with the 1d mode.

tensiometer.parameter_reporting.parameter_table(chain, param_names, use_peak=False, use_best_fit=True, use_PJHPD_bounds=False, ncol=1, **kwargs)[source]

Generate latex parameter table with summary results.

Parameters:
  • chainMCSamples the input chain.
  • param_names – optional choice of parameter names to restrict the calculation. Default is all parameters.
  • use_peak – whether to use the peak of the 1d distribution instead of the mean. Default is False.
  • use_best_fit – whether to include the best fit either from explicit minimization or sample. Default True.
  • use_PJHPD_bounds – whether to report PJHPD bounds. Default False.
  • ncol – number of columns for the table. Default 1.
  • analysis_settings – optional analysis settings to use.
  • kwargs – arguments for ResultTable
Returns:

a ResultTable