Skip to content
Snippets Groups Projects
Commit 57781941 authored by Gregory Ashton's avatar Gregory Ashton
Browse files

Allow prob to take in kwargs which are passed to product

parent d4c24a07
No related branches found
No related tags found
1 merge request!248Allow prob to take in kwargs which are passed to product
Pipeline #34808 passed
......@@ -187,20 +187,22 @@ class PriorSet(OrderedDict):
logger.debug('{} not a known prior.'.format(key))
return samples
def prob(self, sample):
def prob(self, sample, **kwargs):
"""
Parameters
----------
sample: dict
Dictionary of the samples of which we want to have the probability of
kwargs:
The keyword arguments are passed directly to `np.product`
Returns
-------
float: Joint probability of all individual sample probabilities
"""
return np.product([self[key].prob(sample[key]) for key in sample])
return np.product([self[key].prob(sample[key]) for key in sample], **kwargs)
def ln_prob(self, sample):
"""
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment