Closed
Description
We need to decide whether we want to deprecate DensityDist
and if so, provide at least documentation on how to add simple logp terms to a model or how to quickly implement a custom Distribution.
If we want to refactor it, it is probably good time to get rid of the whole dictionary as observed thing and force the distribution parameters to go into the signature as normal arguments in other distributions
# V3 allows this
def my_logp(value, param1, param2):
return value * param1 - param2
param1 = pm.Normal('param1', 0, 1)
param2 = pm.Normal('param2', 0, 1)
y = pm.DensityDist('y', my_logp, observed=dict(value=data, param1=param1, param2=param2))
# V4 should work only like this (if not deprecated)
y = pm.DensityDist('y', my_logp, param1, param2, obeserved=data)