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
I have a need for a correct implementation of improper priors for Turing-based Bayesian inference. By improper I mean that the distribution does not integrate to 1, and in some cases you don't want to disallow the construction of such distributions, but you want to bar the user from sampling from it. The simplest case is Uniform(-Inf, Inf). See the wikipedia entry for more details.
I looked here in Distributions to see if there was a function in the API to tell if a distribution was improper or not. Since I did not find one, I am proposing such an interface:
isproper(distribution, lower, upper) =...# to be implemented for each distribution
isproper(d::Uniform, lower, upper) =isfinite(max(lower, d.a)) &isfinite(min(upper, d.b))
isproper(d::Normal, _, _) =isfinite(d.σ)
isproper(d::Beta, _, _) =!iszero(d.α) |!iszero(d.β)
# last one relies on Beta being modified to allow for zero-valued α, β
As with the Beta example above, this may require some restructuring of the allowed parameter values for some distributions.
I am asking for feedback on this interface before I start a PR.
The text was updated successfully, but these errors were encountered:
I wonder if this is something that should be handled by downstream packages (like Turing.jl) or packages dedicated to prior distributions e.g. https://github.com/JuliaStats/ConjugatePriors.jl ?
What would be the advantage of this being in Distributions.jl?
[I am think because this seems specific to the use of prior distributions. As far as I can tell, this package doesn't currently support unnormalised distributions p(X; θ) = p̃(X; θ) / Z(θ) in the sense of a distribution p which is known (or computed) only up to the partition function Z -- which are of interest when Z cannot be computed analytically (or it its too expensive to do so).]
I have a need for a correct implementation of improper priors for Turing-based Bayesian inference. By improper I mean that the distribution does not integrate to 1, and in some cases you don't want to disallow the construction of such distributions, but you want to bar the user from sampling from it. The simplest case is
Uniform(-Inf, Inf)
. See the wikipedia entry for more details.I looked here in Distributions to see if there was a function in the API to tell if a distribution was improper or not. Since I did not find one, I am proposing such an interface:
with helper method
and some example implementations:
As with the
Beta
example above, this may require some restructuring of the allowed parameter values for some distributions.I am asking for feedback on this interface before I start a PR.
The text was updated successfully, but these errors were encountered: