Skip to content

Introduction ​

Transport maps describe a complicated probability distribution as a deterministic transformation of a simpler one. This provides a common framework for sampling, density estimation, and Bayesian inference [3]. This introduction adapts that framework to the notation and workflows used in TransportMaps.jl; [5] provides a more extensive tutorial.

Reference and target distributions ​

Let denote a normalized reference density and a normalized target density in dimensions. The reference is easy to sample and evaluate, typically a product of independent standard normal densities. We seek a differentiable, invertible map    such that

The notation   means that pushes forward the reference measure to the target measure. Identifying these measures with their densities, the change-of-variables formula gives

Here is the Jacobian matrix with respect to the map input. An exact transport satisfies  ; a fitted finite-dimensional map usually only approximates this equality. Independent reference draws transformed by a fitted map are independent draws from its pushforward distribution, which may differ from the target.

In one dimension, an increasing transport can be written in terms of the reference and target cumulative distribution functions:

For a uniform reference on , this reduces to inverse-CDF sampling,  . See also the CDF estimation example.

Monotone triangular maps ​

TransportMaps.jl uses lower-triangular maps, whose -th component depends only on the first inputs:

This structure follows the Knothe–Rosenblatt rearrangement [1, 2], which extends the one-dimensional CDF construction through successive conditional distributions. For a fixed ordering of the variables and suitable continuous positive densities, it defines an increasing triangular transport [3].

Triangularity makes the Jacobian determinant inexpensive:

To invert the map at , solve  , then  , and so on. Each step is a scalar monotone root-finding problem. Strict monotonicity gives uniqueness on the component's range; global invertibility additionally requires that the component ranges cover the desired target support.

Polynomial parameterization and rectification ​

Following the map parameterization manual, write the parameterized components as , with the coefficients of component . The integrated rectification construction is [4]

where    is a positive rectifier, such as softplus. Consequently,   . The unrectified function is represented by a finite tensor-product expansion:

The multi-index set controls which terms and interactions are included. See Basis Functions for the available polynomial and modified bases, and Adaptive Transport Maps for data-driven enrichment. We collect all component coefficients into and write in the objectives below, as in the optimization manual.

Bayesian inference from a target density ​

In Bayesian inference, the target is a posterior over parameters ; thus   in the notation above. Given observations , a likelihood , and prior ,

The evidence is usually unknown. Map-from-density construction requires only the unnormalized target and minimizes the reverse KL divergence [3]:

Substituting    shows that the evidence contributes only an additive constant independent of . The reference log-density is also independent of the coefficients. Dropping both terms yields an equivalent minimization objective:

With reference quadrature nodes and weights , the numerical problem becomes

Quadrature Methods describes deterministic, sparse-grid, and sampling-based approximations of this reference expectation. The optimization manual covers optimizers and optional coefficient regularization. Gradient-based methods such as the default L-BFGS use derivatives of the target log-density, including derivatives through a forward model when it appears in the likelihood. The objective need not be convex.

In the package, pass a callable log-density to MapTargetDensity, then fit with optimize!(M, target, quadrature). For this direction, evaluate(M, reference_samples) produces approximate target samples. No posterior training samples are required. The Bayesian BOD example demonstrates the full workflow; [6] discusses transport-based Bayesian inference in structural health monitoring.

Learning a map from samples ​

When target samples are available, fit the opposite direction,   , so that  . An exact pair satisfies  . Minimizing    gives, after omitting a coefficient-independent term, the empirical objective [3, 4]

This is also maximum likelihood estimation of the normalized model density

provided maps the target domain bijectively onto the reference domain. The same polynomial construction applies, now with target coordinates as inputs. Samples can come from observations, simulations, or an existing sampler; MCMC is one possible source rather than a requirement.

The package stores the fitted direction: for a sample-fitted map, evaluate(M, target_samples) maps to the reference and inverse(M, reference_samples) generates approximate target samples. pullback(M, x) evaluates the model density above. See Banana: Map from Samples, including optional linear standardization with LinearMap and ComposedMap.


This page was generated using Literate.jl.