Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't apply Bijectors.ordered to TDist(), says it's constrained #2064

Closed
boogiewoogit opened this issue Aug 19, 2023 · 4 comments
Closed

Can't apply Bijectors.ordered to TDist(), says it's constrained #2064

boogiewoogit opened this issue Aug 19, 2023 · 4 comments

Comments

@boogiewoogit
Copy link

The following fails with the error ArgumentError: ordered transform is currently only supported for unconstrained distributions.:

using Turing

Bijectors.ordered(filldist(TDist(1),2))

However, the t-distribution is supported on the real line and thus in fact unconstrained in the sense of this package.

@Red-Portal
Copy link
Member

Could you file this to Bijectors.jl?

@Red-Portal
Copy link
Member

Red-Portal commented Aug 25, 2023

The reason seems to be that TDist's support result in the wrong type:

julia> bijector(TDist(1))
Bijectors.TruncatedBijector{Float64, Float64}(-Inf, Inf)

On a side note, Distributions also has MvTDist for this purpose, but this doesn't work either, which I think it should. So this is also a bug.

@Red-Portal
Copy link
Member

In the meantime, you can bypass the check by calling the constructor directly:

julia> Bijectors.transformed(filldist(TDist(1), 2), Bijectors.OrderedBijector())

MultivariateTransformed{Product{Continuous, TDist{Float64}, FillArrays.Fill{TDist{Float64}, 1, Tuple{Base.OneTo{Int64}}}}, Bijectors.OrderedBijector}(
dist: Product{Continuous, TDist{Float64}, FillArrays.Fill{TDist{Float64}, 1, Tuple{Base.OneTo{Int64}}}}(v=Fill(TDist{Float64}=1.0), 2))
transform: Bijectors.OrderedBijector()
)

But please report this to Bijector when you can since there seem to be at least two to three bugs here!

@boogiewoogit
Copy link
Author

Thanks a lot for sharing the method to bypass!

I have filed the issue at Bijectors.jl: TuringLang/Bijectors.jl#287.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants