# Link function Bijectors.jl

**URL:** <https://discourse.julialang.org/t/link-function-bijectors-jl/56362>\
**Category:** Probabilistic Programming\
**Created:** [March 2, 2021, 8:40pm UTC](https://discourse.julialang.org/t/link-function-bijectors-jl/56362 "2021-03-02T20:40:29Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Honza9723](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/honza9723/32/7807_2.png) [@Honza9723](https://discourse.julialang.org/u/Honza9723)\
**Post date:** [March 2, 2021, 8:40pm UTC](https://discourse.julialang.org/t/link-function-bijectors-jl/56362/1 "2021-03-02T20:40:29Z")

</div>

Dear All,

I would like to ask probably a stupid question. What exactly does link() function? Documentation: `link: maps a sample of a random distribution dist from its support to a value in R^n. Example:`  
`  
How how exactly/according to what key does link() maps this sample from support to R^n?

```julia
julia> using Bijectors

julia> dist = Beta(2, 2)
Beta{Float64}(α=2.0, β=2.0)

julia> x = rand(dist)
0.7472542331020509

julia> y = link(dist, x)
1.084021356473311

```

Best,  
Honza

---

<div class="post-metadata">

**Author:** ![jkbest2](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jkbest2/32/7350_2.png) [@jkbest2](https://discourse.julialang.org/u/jkbest2)\
**Post date:** [March 2, 2021, 10:44pm UTC](https://discourse.julialang.org/t/link-function-bijectors-jl/56362/2 "2021-03-02T22:44:12Z")

</div>

For a beta distribution, 0 \< x \< 1. The `link` function applies a 1-to-1 transformation to the whole real line. Because the beta distribution has both an upper and lower bound a logit transform is used here:

```julia
julia> logit(0.7472542331020509)
1.084021356473311

```

---

<div class="post-metadata">

**Author:** ![Honza9723](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/honza9723/32/7807_2.png) [@Honza9723](https://discourse.julialang.org/u/Honza9723)\
**Post date:** [March 2, 2021, 10:50pm UTC](https://discourse.julialang.org/t/link-function-bijectors-jl/56362/3 "2021-03-02T22:50:57Z")

</div>

Thank you very much! Is there some more detailed documentation/tutorial that explains how it works (which transforms does it use)? Does it always transforms some bounded distribution into unbounded one?

---

<div class="post-metadata">

**Author:** ![jkbest2](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jkbest2/32/7350_2.png) [@jkbest2](https://discourse.julialang.org/u/jkbest2)\
**Post date:** [March 3, 2021, 12:10am UTC](https://discourse.julialang.org/t/link-function-bijectors-jl/56362/4 "2021-03-03T00:10:17Z")

</div>

It looks like the [Readme for Bijectors.jl](https://github.com/TuringLang/Bijectors.jl) is the primary documentation. The available transformations are listed at the bottom. The general goal is to transform a constrained value to an unconstrained value.
