Skip to content

Commit

Permalink
Comment regarding beta dist fix via SpecialFunctions v2.1.4
Browse files Browse the repository at this point in the history
  • Loading branch information
oschulz committed Feb 25, 2022
1 parent 5f8f676 commit 2d535de
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/transforms/distribution_transform.jl
Original file line number Diff line number Diff line change
Expand Up @@ -342,7 +342,7 @@ end
@inline _trafo_quantile_impl_generic(d::Beta{T}, u::Real) where {T<:ForwardDiff.Dual} = convert(float(typeof(u)), NaN)
# Workaround for Beta dist, current quantile implementation only supports Float64:
@inline _trafo_quantile_impl_generic(d::Beta{T}, u::Union{Integer,AbstractFloat}) where {T<:Union{Integer,AbstractFloat}} = _trafo_quantile_impl(T, d, convert(promote_type(Float64, typeof(u)), u))
# Workaround for StatsFuns issues #133:
# Workaround for StatsFuns issues #133, caused by SpecialFunctions, fixed in SpecialFunctions v2.1.4:
@inline _trafo_quantile_impl_generic(d::Beta{T}, u::Float64) where {T<:Union{Integer,AbstractFloat}} = (d.α 1 && d.β 1 && u < 1e-19) ? u : convert(Float64, quantile(d, u))

@inline _trafo_quantile_impl_generic(d::Distribution{Univariate,Continuous}, u::Real) = quantile(d, u)
Expand Down

0 comments on commit 2d535de

Please sign in to comment.