An mutable probdist where the probabilities may be easily modified.
This simply copies an existing probdist, storing the probability values
in a mutable dictionary and providing an update method.
|
__init__(self,
prob_dist,
samples,
store_logs=True)
Creates the mutable probdist based on the given prob_dist and using
the list of samples given. |
source code
|
|
list
|
|
float
|
prob(self,
sample)
Returns:
the probability for a given sample. |
source code
|
|
float
|
logprob(self,
sample)
Returns:
the natural logarithm of the probability for a given sample. |
source code
|
|
|
update(self,
sample,
prob,
log=True)
Update the probability for the given sample. |
source code
|
|
Inherited from ProbDistI :
max
Inherited from object :
__delattr__ ,
__getattribute__ ,
__hash__ ,
__new__ ,
__reduce__ ,
__reduce_ex__ ,
__repr__ ,
__setattr__ ,
__str__
|