Description
Description
For univariate IID, adding a transform=ordered
is equivalent to sorting the raw draws (forward pass). The logp is proportional to the density of the original draws + ordered transform jacobian. We would just need to figure out the normalization constant so it defines a proper multivariate variable that integrates to 1.
With this users would have a generative graph for ordered variables, that they can also do prior_predictive sampling from.
Also default initvals would work out of the box. Right now users always need to provide them.
This would also pretty much also obliviate the need for default_transform
and transform
that we added in #5674 and simplify the API.
The normalization constant is probably just size!
: https://en.wikipedia.org/wiki/Order_statistic#The_joint_distribution_of_the_order_statistics_of_an_absolutely_continuous_distribution
The API could look something like:
with pm.Model() as m:
x = pm.Ordered("x", pm.Normal.dist(), shape=(3,))