You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
OrderStatistic has the same constraints as the distribution it wraps and should get the same bijector.
bijector(d::OrderStatistic) =bijector(d.dist)
The support of JointOrderStatistics is the sorted vectors whose elements are in the support of the wrapped distribution. An example bijector could be:
functionbijector(d::JointOrderStatistics)
dist = d.dist
binner =bijector(dist)
bunsort =inverse(OrderedBijector())
# assume all upper bounded distributions have monotonically decreasing bijectors.
scale = (binner isa Union{typeof(identity),Truncated} ||islowerbounded(dist)) ?1:-1return bunsort ∘Scale(scale) ∘ binner
end
To set scale correctly, we need to know if the bijector being used is monotonically increasing or decreasing. While we can hardcode a check for all bijectors defined in this package, to support user-implemented bijectors, we would seem to need an isdecreasing(::Bijector) API function.
Note that with a correct bijector defined for JointOrderStatistics, in a PPL like Turing, a user could use JointOrderStatistics(Exponential(), 100) to infer a sorted vector of parameters from the same distribution, instead of Bijectors.ordered(filldist(Exponential(), 100)), which as noted in #220 (comment) does the wrong thing (and now raises an error).
The text was updated successfully, but these errors were encountered:
I'm personally happy to include a isdecreasing function or something similar. This will also be useful for some additional functionality, e.g. support for univariate distributions.
JuliaStats/Distributions.jl#1668 added distributions for sample order statistics"
OrderStatistic
andJointOrderStatistics
.OrderStatistic
has the same constraints as the distribution it wraps and should get the same bijector.The support of
JointOrderStatistics
is the sorted vectors whose elements are in the support of the wrapped distribution. An example bijector could be:To set
scale
correctly, we need to know if the bijector being used is monotonically increasing or decreasing. While we can hardcode a check for all bijectors defined in this package, to support user-implemented bijectors, we would seem to need anisdecreasing(::Bijector)
API function.Note that with a correct bijector defined for
JointOrderStatistics
, in a PPL like Turing, a user could useJointOrderStatistics(Exponential(), 100)
to infer a sorted vector of parameters from the same distribution, instead ofBijectors.ordered(filldist(Exponential(), 100))
, which as noted in #220 (comment) does the wrong thing (and now raises an error).The text was updated successfully, but these errors were encountered: