Skip to content

Quadrature

Index

Types

TransportMaps.GaussHermiteWeights Type
julia
GaussHermiteWeights

Tensor product Gauss-Hermite quadrature for numerical integration with Gaussian reference measure. Uses numberpoints points per dimension, resulting in numberpoints^dimension total quadrature points.

Fields

  • points::Matrix{Float64}: Quadrature points

  • weights::Vector{Float64}: Quadrature weights

Constructors

  • GaussHermiteWeights(numberpoints::Int64, dimension::Int64): Construct weights for number of points per dimension and dimension.

  • GaussHermiteWeights(numberpoints::Int64, map::AbstractTransportMap): Get number of dimensions from map.

source
TransportMaps.MonteCarloWeights Type
julia
MonteCarloWeights

Monte Carlo quadrature using random samples from the reference distribution. All points receive uniform weights 1/numberpoints.

Fields

  • points::Matrix{Float64}: Quadrature points (random samples)

  • weights::Vector{Float64}: Quadrature weights (uniform)

Constructors

  • MonteCarloWeights(numberpoints::Int64, dimension::Int64): Construct weights with random sampling.

  • MonteCarloWeights(numberpoints::Int64, map::AbstractTransportMap): Get number of dimensions and reference density from map.

  • MonteCarloWeights(points::Matrix{Float64}, weights::Vector{Float64}=Float64[]): Construct from custom points and weights.

source
TransportMaps.LatinHypercubeWeights Type
julia
LatinHypercubeWeights

Latin Hypercube sampling for quasi-Monte Carlo integration. Provides better space-filling properties than pure Monte Carlo. All points receive uniform weights 1/n.

Fields

  • points::Matrix{Float64}: Quadrature points (Latin Hypercube samples)

  • weights::Vector{Float64}: Quadrature weights (uniform)

Constructors

  • LatinHypercubeWeights(n::Int64, d::Int64): Construct Latin Hypercube samples for d dimensions.

  • LatinHypercubeWeights(n::Int64, map::AbstractTransportMap): Get number of dimensions and reference density from map.

source
TransportMaps.SparseSmolyakWeights Type
julia
SparseSmolyakWeights

Sparse Smolyak quadrature using Gauss-Hermite rules. Reduces the curse of dimensionality by using a sparse grid construction. The level parameter controls accuracy (higher level = more points and higher accuracy).

Fields

  • points::Matrix{Float64}: Quadrature points (sparse grid)

  • weights::Vector{Float64}: Quadrature weights

Constructors

  • SparseSmolyakWeights(level::Int64, dimension::Int64): Construct sparse Smolyak grid with specified level and dimension.

  • SparseSmolyakWeights(level::Int64, map::AbstractTransportMap): Get number of dimensions from map.

source

Functions

TransportMaps.gaussquadrature Function
julia
gaussquadrature(fun::Function, n::Int, a::Real, b::Real)

Numerically integrates the function fun over the interval [a, b] using the Gauss-Legendre quadrature rule with n points.

Arguments

  • fun::Function: The function to integrate. Should accept a single Float64 argument.

  • n::Int: The number of quadrature points to use.

  • a::Real: The lower bound of the integration interval.

  • b::Real: The upper bound of the integration interval.

Returns

  • Float64: The approximate value of the integral of fun over [a, b].
source