Maps
Index
TransportMaps.ComposedMapTransportMaps.LaplaceMapTransportMaps.LinearMapTransportMaps.PolynomialMapTransportMaps.PolynomialMapComponentTransportMaps.conditional_densityTransportMaps.conditional_sampleTransportMaps.evaluateTransportMaps.getcoefficientsTransportMaps.getmultiindexsetsTransportMaps.inverseTransportMaps.multivariate_conditional_densityTransportMaps.multivariate_conditional_sampleTransportMaps.numbercoefficientsTransportMaps.numberdimensionsTransportMaps.pullbackTransportMaps.pushforwardTransportMaps.setcoefficients!TransportMaps.setparameters!
Types
TransportMaps.PolynomialMap Type
PolynomialMap <: AbstractTriangularMapTriangular transport map with polynomial basis.
Fields
components::Vector{PolynomialMapComponent{<:AbstractPolynomialBasis}}: Vector of map componentsreference::MapReferenceDensity: Reference density of the mapforwarddirection::Symbol::targetfor map from density,:referencefor map from samples
Constructors
PolynomialMap(dimension::Int, degree::Int, reference::Distributions.UnivariateDistribution=Normal(), rectifier::AbstractRectifierFunction=Softplus(), basis::AbstractPolynomialBasis=_default_basis(reference), map_type::Symbol=:total): Initialize a polynomial map. The default basis is selected from the reference distribution.DiagonalMap(dimension::Int, degree::Int, reference::Distributions.UnivariateDistribution=Normal(), rectifier::AbstractRectifierFunction=Softplus(), basis::AbstractPolynomialBasis=_default_basis(reference)): Initialize diagonal map with diagonal structure.NoMixedMap(dimension::Int, degree::Int, reference::Distributions.UnivariateDistribution=Normal(), rectifier::AbstractRectifierFunction=Softplus(), basis::AbstractPolynomialBasis=_default_basis(reference)): Initialize diagonal map without mixed terms.
TransportMaps.PolynomialMapComponent Type
PolynomialMapComponent{T <: AbstractPolynomialBasis} <: AbstractMapComponentA single component Mᵏ of a triangular transport map with polynomial basis.
Fields
basisfunctions::Vector{MultivariateBasis{T}}: Vector of multivariate basis functionscoefficients::Vector{Float64}: Coefficients for the basis functionsrectifier::AbstractRectifierFunction: Rectifier function applied to partial derivativesindex::Int: Index k indicating the component dimension
Constructors
PolynomialMapComponent(index::Int, degree::Int, rectifier::AbstractRectifierFunction=Softplus(), basis::AbstractPolynomialBasis=HermiteBasis(), reference_density::Distributions.UnivariateDistribution=Normal(), map_type::Symbol=:total): Initialize component with specified degree and basis type.PolynomialMapComponent(multi_indices::Vector{Vector{Int}}, rectifier::AbstractRectifierFunction, basis::AbstractPolynomialBasis, samples::AbstractMatrix{Float64}): Initialize component with custom multi-index sets from samples.PolynomialMapComponent(multi_indices::Vector{Vector{Int}}, rectifier::AbstractRectifierFunction, basis::AbstractPolynomialBasis, reference_density::Distributions.UnivariateDistribution): Initialize component with custom multi-index sets from density.
TransportMaps.LinearMap Type
LinearMap <: AbstractLinearMapA linear transformation map that standardizes data using mean and standard deviation.
The forward and inverse transformations are
Fields
μ::Vector{Float64}: Mean vector for each dimensionσ::Vector{Float64}: Standard deviation vector for each dimension
Constructors
LinearMap(samples::Matrix{Float64}): Compute empirical mean and standard deviation from samples.LinearMap(μ::Vector{Float64}, σ::Vector{Float64}): Construct linear map with explicit mean and standard deviation.
TransportMaps.LaplaceMap Type
LaplaceMap <: AbstractLinearMapA linear transport map based on the Laplace approximation of a target density.
The Laplace approximation assumes the target density is approximately Gaussian around its mode. Let
Fields
mode::Vector{Float64}: Mode or mean vector of the approximationchol::Matrix{Float64}: Lower Cholesky factorsatisfying
Constructors
LaplaceMap(samples::Matrix{Float64}): Constructs a LaplaceMap from sample data by
computing the empirical mean and covariance.
LaplaceMap(density::MapTargetDensity, x0::Vector{Float64}; optimizer::Optim.AbstractOptimizer = LBFGS(), options::Optim.Options = Optim.Options()): Compute a Laplace approximation of a target density by finding the mode via optimization and computing the Hessian at the mode. Ifhessian_backendisnothing, uses the same backend as the density.
TransportMaps.ComposedMap Type
ComposedMap{T <: AbstractLinearMap} <: AbstractComposedMapA composed transport map consisting of a linear map followed by a polynomial map.
The composition is L is a linear map of type T and M is the polynomial map. The linear map can be a LinearMap or LaplaceMap.
Fields
linearmap<:T: The linear map componentpolynomialmap::PolynomialMap: The polynomial map component
Constructors
ComposedMap(lm::AbstractLinearMap, pm::PolynomialMap)
Functions
TransportMaps.evaluate Function
evaluate(mvb::MultivariateBasis{T}, z::AbstractVector{<:Real}) where {T <: AbstractPolynomialBasis}Evaluate the multivariate basis function at point z.
sourceevaluate(map_component::PolynomialMapComponent, z::AbstractVector{<:Real})Evaluate the polynomial map component
where
evaluate(map_component::PolynomialMapComponent, Z::AbstractMatrix{<:Real})Evaluate the map component at multiple points (row-wise) using multithreading.
Return a vector whose
evaluate(M::PolynomialMap, z::AbstractVector{<:Real})Evaluate the polynomial map at point z.
Returns a vector where each component i is Mⁱ(z₁,...,zᵢ).
sourceevaluate(M::PolynomialMap, Z::AbstractMatrix{<:Real})Evaluate the polynomial map at multiple points (row-wise) using multithreading.
Each row of Z is a point to evaluate. Returns a matrix where row i contains M(Z[i,:]).
sourceevaluate(L::LinearMap, x::AbstractVector{<:Real})Standardize the input componentwise:
evaluate(L::LinearMap, X::AbstractMatrix{<:Real})Apply the linear transformation to multiple points (row-wise).
sourceevaluate(L::LaplaceMap, x::AbstractVector{<:Real})Apply the whitening transformation
evaluate(L::LaplaceMap, X::AbstractMatrix{<:Real})Apply the Laplace map transformation to multiple points (row-wise).
sourceevaluate(C::ComposedMap, x::AbstractVector{<:Real})Evaluate the composed map,
evaluate(C::ComposedMap, X::AbstractMatrix{<:Real})Evaluate the composed map for multiple points (row-wise).
sourceTransportMaps.inverse Function
inverse(map_component::PolynomialMapComponent, zₖ₋₁::AbstractVector{<:Real}, xₖ::Real)Compute the inverse of the map component using one-dimensional root finding.
Given z[1:k-1] and the target value xₖ, finds zₖ such that Mᵏ(z) = xₖ.
sourceinverse(M::PolynomialMap, x::AbstractVector{<:Real}, k::Int = numberdimensions(M))Compute the inverse of the first k components of the map at point x.
Return
inverse(M::PolynomialMap, X::AbstractMatrix{<:Real}, k::Int = numberdimensions(M))Compute the inverse at multiple points using multithreading.
Return a matrix whose
inverse(L::LinearMap, y::AbstractVector{<:Real})Recover the original scale with
inverse(L::LinearMap, Y::AbstractMatrix{<:Real})Invert the transformation for multiple points (row-wise).
sourceinverse(L::LaplaceMap, y::AbstractVector{<:Real})Invert the Laplace map, returning
inverse(L::LaplaceMap, Y::AbstractMatrix{<:Real})Invert the transformation for multiple points (row-wise).
sourceinverse(C::ComposedMap, z::AbstractVector{<:Real})Invert the composed map,
inverse(C::ComposedMap, Z::AbstractMatrix{<:Real})Invert the composed map for multiple points (row-wise).
sourceTransportMaps.pushforward Function
pushforward(M::PolynomialMap, target::MapTargetDensity, z::AbstractVector{<:Real})Compute the target density represented in reference coordinates:
Maps the target density back through M to the reference space.
sourcepushforward(M::PolynomialMap, target::MapTargetDensity, Z::AbstractMatrix{<:Real})Compute pushforward densities at multiple points using multithreading.
Returns a vector where element i is the pushforward density at Z[i,:].
sourceTransportMaps.pullback Function
pullback(M::PolynomialMap, x::AbstractVector{<:Real})Evaluate the target-density approximation induced by the map.
For a map from density,
For a map from samples,
pullback(M::PolynomialMap, X::AbstractMatrix{<:Real})Compute pullback densities at multiple points using multithreading.
Returns a vector where element i is the pullback density at X[i,:].
sourcepullback(C::ComposedMap, x::AbstractVector{<:Real})Compute the pullback density of the composed map:
pullback(C::ComposedMap, X::AbstractMatrix{<:Real})Compute the pullback density for multiple points (row-wise).
sourceTransportMaps.setcoefficients! Function
setcoefficients!(map_component::PolynomialMapComponent, coefficients::AbstractVector{<:Real})Set the coefficients of the map component.
sourcesetcoefficients!(M::PolynomialMap, coefficients::AbstractVector{<:Real})Set all coefficients of the polynomial map.
Coefficients are ordered by component:
TransportMaps.getcoefficients Function
getcoefficients(map_component::PolynomialMapComponent)Get a copy of the coefficients from the map component.
sourcegetcoefficients(M::PolynomialMap)Get all coefficients from the polynomial map.
Returns a vector with coefficients ordered by component.
sourceTransportMaps.setparameters! Function
setparameters!(map::LinearMap, μ::AbstractVector{<:Real}, σ::AbstractVector{<:Real})Set the mean and standard deviation parameters of the linear map.
sourceTransportMaps.numbercoefficients Function
numbercoefficients(map_component::PolynomialMapComponent)Return the number of coefficients in the map component.
sourcenumbercoefficients(M::PolynomialMap)Return the total number of coefficients in the polynomial map.
sourceTransportMaps.numberdimensions Function
numberdimensions(M::PolynomialMap)Return the number of dimensions (components) of the polynomial map.
sourcenumberdimensions(L::LinearMap)Return the number of dimensions of the linear map.
sourcenumberdimensions(L::LaplaceMap)Return the number of dimensions of the Laplace map.
sourcenumberdimensions(C::ComposedMap)Return the number of dimensions of the composed map.
sourceTransportMaps.getmultiindexsets Function
getmultiindexsets(map_component::PolynomialMapComponent)Return the multi-indices as a matrix (one per row).
sourceTransportMaps.conditional_density Function
conditional_density(M::PolynomialMap, x_range::Real, x_given::AbstractVector{<:Real})Compute the conditional density x_range given x_given.
With
conditional_density(M::PolynomialMap, x_range::AbstractVector{<:Real}, x_given::AbstractVector{<:Real})Compute conditional densities at multiple x_range values using multithreading.
sourceTransportMaps.conditional_sample Function
conditional_sample(M::PolynomialMap, x_given::AbstractVector{<:Real}, z_range::Real)Generate a sample from
conditional_sample(M::PolynomialMap, x_given::AbstractVector{<:Real}, z_range::AbstractVector{<:Real})Generate multiple samples from
TransportMaps.multivariate_conditional_density Function
multivariate_conditional_density(M::PolynomialMap, x::AbstractVector{<:Real})Compute the multivariate conditional density using
multivariate_conditional_density(M::PolynomialMap, x_range::AbstractVector{<:Real}, x_given::AbstractVector{<:Real})Compute x_range contains x_given contains
TransportMaps.multivariate_conditional_sample Function
multivariate_conditional_sample(M::PolynomialMap, x_given::AbstractVector{<:Real}, z_range::AbstractVector{<:Real})Generate a sample from z_range through map components