Skip to content

Quadrature

Index

Quadrature Knots

TransportMaps.GaussHermiteKnots Type
julia
GaussHermiteKnots

One-dimensional Gauss-Hermite quadrature weights for computing integrals for the form:

 

where is the standard normal density.

source
TransportMaps.GaussLegendreKnots Type
julia
GaussLegendreKnots

One-dimensional Gauss-Legendre quadrature weights for computing integrals for the form:

 

where is the uniform density.

source
TransportMaps.ClenshawCurtisKnots Type
julia
ClenshawCurtisKnots

One-dimensional Clenshaw-Curtis quadrature weights for computing integrals for the form:

 

where is the uniform density.

source

Types

TransportMaps.TensorProductWeights Type
julia
TensorProductWeights{T<:AbstractQuadratureKnots}

Multi-dimensional quadrature rule constructed from a tensor-product of one-dimensional quadrature knots. The level parameter controls accuracy.

Fields

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

  • weights::Vector{Float64}: Quadrature weights

  • knots::AbstractQuadratureKnots: The 1D quadrature knots, e.g., GaussHermiteKnots or GaussLegendreKnots

Constructors

  • TensorProductWeights(level::Int64, dim::Int64, knots::AbstractQuadratureKnots)

  • TensorProductWeights(level::Int64, map::AbstractTransportMap)

See also GaussHermiteWeights and GaussLegendreWeights, and SparseSmolyakWeights for spare grids.

source
TransportMaps.GaussHermiteWeights Function
julia
GaussHermiteWeights(level::Int64, dim::Int64)

Tensor-product Gauss-Hermite weights for integration with respect to standard Gaussian. Returns a TensorProductWeights object.

source
julia
GaussHermiteWeights(level::Int64, map::AbstractTransportMap)

Tensor-product Gauss-Hermite weights for integration with respect to standard Gaussian constructed from the transport map map with normal reference density. Returns a TensorProductWeights object.

source
TransportMaps.GaussLegendreWeights Function
julia
GaussLegendreWeights(level::Int64, dim::Int64, domain=[0, 1])

Tensor-product Gauss-Legendre weights for integration with respect to Uniform[0,1]. Returns a TensorProductWeights object.

source
julia
GaussLegendreWeights(level::Int64, map::AbstractTransportMap)

Tensor-product Gauss-Legendre weights for integration with respect to Uniform[a,b] constructed from the transport map map with uniform reference density. Returns a TensorProductWeights object.

source
TransportMaps.SparseSmolyakWeights Type
julia
SparseSmolyakWeights{T<:AbstractQuadratureKnots}

Multi-dimensional quadrature rule constructed using a sparse Smolyak grid of one-dimensional quadrature knots. The level parameter controls accuracy.

Fields

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

  • weights::Vector{Float64}: Quadrature weights

  • knots::AbstractQuadratureKnots: The 1D quadrature knots, e.g., GaussHermiteKnots or GaussLegendreKnots

Constructors

  • SparseSmolyakWeights(level::Int64, dim::Int64, knots=GaussHermiteKnots()): Construct sparse Smolyak grid with specified level, dim and knots.

  • SparseSmolyakWeights(level::Int64, map::AbstractTransportMap): Construct sparse Smolyak grid with the help of the transport map. The knots are chosen based on the reference distribution (GaussHermiteKnots for a Normal reference and GaussLegendreKnots for a Uniform reference).

See also TensorProductWeights.

source
TransportMaps.MonteCarloWeights Type
julia
MonteCarloWeights

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

Fields

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

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

  • distribution::Distributions.UnivariateDistribution: Reference distribution

Constructors

  • MonteCarloWeights(numberpoints::Int64, dimension::Int64, distr::Distributions.UnivariateDistribution=Normal()): Construct weights with random sampling from distr (defaults to Normal()).

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

  • 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)

  • distribution::Distributions.UnivariateDistribution: Reference distribution

Constructors

  • LatinHypercubeWeights(n::Int64, d::Int64, dist::Distributions.UnivariateDistribution=Normal()): Construct Latin Hypercube samples for d dimensions using dist (defaults to Normal()).

  • LatinHypercubeWeights(n::Int64, map::AbstractTransportMap): Get number of dimensions and sample according to the map's reference density.

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