-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Open
Labels
Description
Description
Using CDFs it should be simple to derive the logp of graphs of the form:
import pymc as pm
x = pm.Normal.dist()
y = x < 0.5
pm.logp(y, value=1).eval() # same as pm.logcdf(x, 0.5)
pm.logp(y, value=0).eval() # same as log(1 - exp(pm.logcdf(x, 0.5)))
https://github.com/pymc-devs/pymc/blob/main/pymc/logprob/censoring.py includes rewrites of other operations that rely on CDF such as clip
, and round
.
More challenging, but also fun, would be to support all
and any
, whose logp should be the sum of the logp that all binary variables evaluate to True or False: any = 1 - all(x==False)
For ordering, and min/max see #6350