|
1 | 1 | # Bijectors.jl |
2 | 2 |
|
3 | 3 | This package implements a set of functions for transforming constrained random variables (e.g. simplexes, intervals) to Euclidean space. The 3 main functions implemented in this package are the `link`, `invlink` and `logpdf_with_trans` for a number of distributions. The distributions supported are: |
4 | | -1. `RealDistribution`: `Union{Cauchy, Gumbel, Laplace, Logistic, NoncentralT, Normal, NormalCanon, TDist}`, |
5 | | -2. `PositiveDistribution`: `Union{BetaPrime, Chi, Chisq, Erlang, Exponential, FDist, Frechet, Gamma, InverseGamma, InverseGaussian, Kolmogorov, LogNormal, NoncentralChisq, NoncentralF, Rayleigh, Weibull}`, |
6 | | -3. `UnitDistribution`: `Union{Beta, KSOneSided, NoncentralBeta}`, |
7 | | -4. `SimplexDistribution`: `Union{Dirichlet}`, |
8 | | -5. `PDMatDistribution`: `Union{InverseWishart, Wishart}`, and |
9 | | -6. `TransformDistribution`: `Union{T, Truncated{T}} where T<:ContinuousUnivariateDistribution`. |
| 4 | + |
| 5 | + 1. `RealDistribution`: `Union{Cauchy, Gumbel, Laplace, Logistic, NoncentralT, Normal, NormalCanon, TDist}`, |
| 6 | + 2. `PositiveDistribution`: `Union{BetaPrime, Chi, Chisq, Erlang, Exponential, FDist, Frechet, Gamma, InverseGamma, InverseGaussian, Kolmogorov, LogNormal, NoncentralChisq, NoncentralF, Rayleigh, Weibull}`, |
| 7 | + 3. `UnitDistribution`: `Union{Beta, KSOneSided, NoncentralBeta}`, |
| 8 | + 4. `SimplexDistribution`: `Union{Dirichlet}`, |
| 9 | + 5. `PDMatDistribution`: `Union{InverseWishart, Wishart}`, and |
| 10 | + 6. `TransformDistribution`: `Union{T, Truncated{T}} where T<:ContinuousUnivariateDistribution`. |
10 | 11 |
|
11 | 12 | All exported names from the [Distributions.jl](https://github.com/TuringLang/Bijectors.jl) package are reexported from `Bijectors`. |
12 | 13 |
|
13 | 14 | Bijectors.jl also provides a nice interface for working with these maps: composition, inversion, etc. |
14 | 15 | The following table lists mathematical operations for a bijector and the corresponding code in Bijectors.jl. |
15 | 16 |
|
16 | | -| Operation | Method | Automatic | |
17 | | -|:------------------------------------:|:-----------------:|:-----------:| |
18 | | -| `b ↦ b⁻¹` | `inverse(b)` | ✓ | |
19 | | -| `(b₁, b₂) ↦ (b₁ ∘ b₂)` | `b₁ ∘ b₂` | ✓ | |
20 | | -| `(b₁, b₂) ↦ [b₁, b₂]` | `stack(b₁, b₂)` | ✓ | |
21 | | -| `x ↦ b(x)` | `b(x)` | × | |
22 | | -| `y ↦ b⁻¹(y)` | `inverse(b)(y)` | × | |
23 | | -| `x ↦ log|det J(b, x)|` | `logabsdetjac(b, x)` | AD | |
24 | | -| `x ↦ b(x), log|det J(b, x)|` | `with_logabsdet_jacobian(b, x)` | ✓ | |
25 | | -| `p ↦ q := b_* p` | `q = transformed(p, b)` | ✓ | |
26 | | -| `y ∼ q` | `y = rand(q)` | ✓ | |
27 | | -| `p ↦ b` such that `support(b_* p) = ℝᵈ` | `bijector(p)` | ✓ | |
28 | | -| `(x ∼ p, b(x), log|det J(b, x)|, log q(y))` | `forward(q)` | ✓ | |
| 17 | +| Operation | Method | Automatic | |
| 18 | +|:-------------------------------------------:|:-------------------------------:|:---------:| |
| 19 | +| `b ↦ b⁻¹` | `inverse(b)` | ✓ | |
| 20 | +| `(b₁, b₂) ↦ (b₁ ∘ b₂)` | `b₁ ∘ b₂` | ✓ | |
| 21 | +| `(b₁, b₂) ↦ [b₁, b₂]` | `stack(b₁, b₂)` | ✓ | |
| 22 | +| `x ↦ b(x)` | `b(x)` | × | |
| 23 | +| `y ↦ b⁻¹(y)` | `inverse(b)(y)` | × | |
| 24 | +| `x ↦ log|det J(b, x)|` | `logabsdetjac(b, x)` | AD | |
| 25 | +| `x ↦ b(x), log|det J(b, x)|` | `with_logabsdet_jacobian(b, x)` | ✓ | |
| 26 | +| `p ↦ q := b_* p` | `q = transformed(p, b)` | ✓ | |
| 27 | +| `y ∼ q` | `y = rand(q)` | ✓ | |
| 28 | +| `p ↦ b` such that `support(b_* p) = ℝᵈ` | `bijector(p)` | ✓ | |
| 29 | +| `(x ∼ p, b(x), log|det J(b, x)|, log q(y))` | `forward(q)` | ✓ | |
29 | 30 |
|
30 | 31 | In this table, `b` denotes a `Bijector`, `J(b, x)` denotes the Jacobian of `b` evaluated at `x`, `b_*` denotes the [push-forward](https://www.wikiwand.com/en/Pushforward_measure) of `p` by `b`, and `x ∼ p` denotes `x` sampled from the distribution with density `p`. |
31 | 32 |
|
|
0 commit comments