ProbabilityDict class
This class is similar to the SamplesDict class but instead of storing a collection of posterior samples for each parameter, it stores the analytic PDF for each parameter. The analytic PDF is stored as a DiscretePDF object.
- class pesummary.utils.probability_dict.ProbabilityDict(*args, logger_warn='warn', autoscale=False)[source]
Class to store integers with discrete probabilities for multiple parameters.
- Parameters:
args (dict) – dictionary containing the discrete probabilities for each parameter. Key should be the parameter name and value should be a 2d array of length 2. First element integers and second element probabilities corresponding to integers. See pesummary.utils.pdf.DiscretePDF for more details
- rvs:
randomly draw samples for each distribution in ProbabilityDict
Examples
>>> from pesummary.utils.probability_dict import ProbabilityDict >>> numbers = [1,2,3,4] >>> probabilities = [0.1, 0.2, 0.3, 0.4] >>> pdf = ProbabilityDict({"parameter": [numbers, probabilities]}) >>> print(type(pdf["parameter"])) <class 'pesummary.utils.pdf.DiscretePDF'> >>> print(pdf["parameter"].probs) [0.1, 0.2, 0.3, 0.4]