Bijectors.jl implements functions for transforming random variables and probability distributions.
A quick overview of some of the key functionality is provided below:
julia> using Bijectors
julia> dist = LogNormal()
LogNormal{Float64}(μ=0.0, σ=1.0)
julia> x = rand(dist) # Constrained to (0, ∞)
0.6471106974390148
julia> b = bijector(dist) # This maps from (0, ∞) to ℝ
(::Base.Fix1{typeof(broadcast), typeof(log)}) (generic function with 1 method)
julia> y = b(x) # Unconstrained value in ℝ
-0.43523790570180304
julia> # Returns b(x), and the log-absolute determinant of the Jacobian at x.
with_logabsdet_jacobian(b, x)
(-0.43523790570180304, 0.43523790570180304)Please see the documentation for more information.
If you have any questions, please feel free to post on Julia Slack or Discourse. We also very much welcome GitHub issues or pull requests!