galapy.analysis.funcs

Functions

get_parameters_label_strings(handler)

Returns strings formatted for TeX math

get_parameters_summary_statistics(res[, ...])

Function returning a dictionary with summary statistics of the samples in the Results instance of some sampling run

get_parameters_summary_strings(res[, ...])

Function returning a list of formatted strings with the chosen summary statistics of the samples in the Results instance of some sampling run

galapy.analysis.funcs.get_parameters_summary_statistics(res, stat_type='quantiles', quantile=None)

Function returning a dictionary with summary statistics of the samples in the Results instance of some sampling run

Parameters:
  • res (galapy.sampling.Results.Results) – An instance of type Results

  • stat_type (str) – The desired summary statistics. Available statistics are ‘bestfit_and_interval’, ‘mean_and_std’ and ‘quantiles’

  • quantile (scalar or sequence) – If stat_type='bestfit_and_interval', the probability enclosed in the credible interval. Default is 0.68, i.e. 68% credible interval. If stat_type='quantiles', the quantiles requested. Default is (0.16,0.5,0.84), i.e. median and 68% bound.

Returns:

  • if stat_type='bestfit_and_interval' each row is an array with size = 3 where the first element is the best-fit value, the second and third are the lower and upper uncertainties, respectively.

  • if stat_type='quantiles' each row is an array with size = len(quantile)

  • if stat_type='mean_and_std' each row is an array of size = 2 where the first element is the mean and the second element is the standard deviation.

Return type:

ndarray

Note

When choosing stat_type=’bestfit_and_interval’ infinite values could appear either in the lower uncertainty or in the higher untertainty. This happens when it was not possible to close the requested quantile region (default = 0.68, i.e. 68 per cent) around the best-fit value. In this case then, the constraint has to be interpreted as an higher or lower limit, respectively.

galapy.analysis.funcs.get_parameters_summary_strings(res, digits=2, stat_type='quantiles', quantile=None)

Function returning a list of formatted strings with the chosen summary statistics of the samples in the Results instance of some sampling run

Parameters:
  • res (galapy.sampling.Results.Results) – An instance of type Results

  • digits (integer) – Number of significant digits to show. Each statistic will be represented in strings formatted as {:.{digits}f} Default is 2

  • stat_type (str) – The desired summary statistics. Available statistics are ‘mean_and_std’ and ‘quantiles’

  • quantile (scalar or sequence) – The quantiles requested (used only is stat_type='quantiles'. Default is (0.16,0.5,0.84), i.e. median and 68% bound.

Returns:

An array with Ndim TeX-formatted summary statistics, where Ndim is the size of the free-parameters space of the sampling run.

Return type:

ndarray

galapy.analysis.funcs.get_parameters_label_strings(handler)

Returns strings formatted for TeX math

Parameters:

handler (galapy.Handlers.ModelParameters) – an instance of type ModelParameters

Returns:

Dictionary where the keys are the name of the free-parameter and the values are the TeX-formatted strings

Return type:

dict