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

[WIP] [RFQ] Add vartransform documentation #210

Draft
wants to merge 4 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions docs/make.jl
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ pages = [
"Tutorials" => [
"Adding a new measure" => "adding.md",
"Affine transformations" => "affine.md",
"Variate transformations" => "vartransform.md",
],
"API Reference" => [
"MeasureBase" => "api_measurebase.md",
Expand Down
7 changes: 7 additions & 0 deletions docs/src/vartransform.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Variate Transformations

Given a measure `v` that can be seen as a [pushforward measure](https://en.wikipedia.org/wiki/Pushforward_measure) of a measure `μ` one often needs to find the [pushforward measure](https://en.wikipedia.org/wiki/Pushforward_measure) from `μ` to `v`.
oschulz marked this conversation as resolved.
Show resolved Hide resolved

A typical application arises in sampling: Many sampling algorithms perform better or even require a specific base measure. Nested sampling, for example, natively uses μ as it's base measure, while many MCMC sampling algorithms work best in an unbounded space and prefer base measures such as `μ = StdNormal()^n`. Using [`vartransform`](@ref) we can (for many measures) automatically generate a function `f = vartransform(v, μ)` so that [`pushfwd(f, μ)`](@ref) becomes equivalent to `v`. Instead of sampling `∫(L, v)` we can now sample `∫(L∘f, μ)`. The generates sample points `X_μ` can then be transformed to sample points `X_v = f.(X_μ)`.
oschulz marked this conversation as resolved.
Show resolved Hide resolved

Transformation functions `f = vartransform(v, μ)` support `f_inverse = InverseFunctions.inverse(f)` and `x_v, ladj = ChangesOfVariables.with_logabsdet_jacobian(f, x_μ)`.