Custom Weibull distribution

I agree. It would be nice to have different kwargs in DensityDist, like priors= and observed=. In practice (@ferrine or @junpenglao can correct this if it is incorrect) the logic inside DensityDist is: If it’s a pm.Distribution object, it’s coming from the prior (and should be sampled), while if it’s a theano.Shared object, it represents observations.

I’m not quite sure what you’re asking. If the logps are the same, the samples should be the same…

Since you require that x-l > 0 why not do something like

min_obs_x = np.min(x)
BoundedGamma = pm.Bound(pm.Gamma, lower=min_obs_x)
l_prior = BoundedGamma('l_prior', **params)

The other parameterization (that I was talking about) would abandon the gamma prior on l, and instead do something like

min_obs_x = np.min(x)
x_minus_l = pm.HalfNormal('delta_x_l', 10.)
l = pm.Deterministic('l_prior', min_obs_x - x_minus_l)
1 Like