QInchworm.scrambled_sobol

QInchworm.scrambled_sobolModule

This module contains a modified and extended version of Sobol.jl's code written by Steven G. Johnson.

The extensions include those mentioned in Sobol.jl issue #31.

  • Support for scrambled Sobol points (implementation of the scrambling is taken from SciPy).
  • Inclusion of the initial point in the Sobol sequence.
  • skip!(... ; exact=false) now skips $2^m$ points.
source
QInchworm.scrambled_sobol.ScrambledSobolSeqType
mutable struct ScrambledSobolSeq{D}

Scrambled Sobol low-discrepancy sequence of dimension D.

Fields

  • m::Matrix{UInt32}: Direction numbers, array of size (D, 32)

  • x::Vector{UInt32}: Previous sequence point $x = x_n$, array of length D

  • n::UInt32: Number of sequence points generated so far

source
QInchworm.scrambled_sobol.ScrambledSobolSeqMethod
ScrambledSobolSeq(
    D::Int64;
    scramble_rng
) -> QInchworm.scrambled_sobol.ScrambledSobolSeq

Create a scrambled Sobol sequence of dimension D using the Random Number Generator scramble_rng to generate scrambling parameters. The sequence remains unscrambled if no RNG is provided.

source
Base.ndimsMethod
ndims(
    s::QInchworm.scrambled_sobol.ScrambledSobolSeq{D}
) -> Int64

Dimension D of a scrambled Sobol sequence.

source
ndims(s::QInchworm.utility.RandomSeq{RNG, D}) -> Int64

Dimension D of a random sequence.

source
ndims(
    _::QInchworm.qmc_integrate.AbstractDomainTransform{D}
) -> Any

Return the number of dimensions $d$ of a domain transformation $[0, 1]^d \mapsto \mathscr{D}$.

source
QInchworm.scrambled_sobol.next!Function
next!(
    s::QInchworm.scrambled_sobol.ScrambledSobolSeq,
    x::AbstractVector{<:AbstractFloat}
) -> AbstractVector{<:AbstractFloat}

Generate the next point $\mathbf{x}\in[0, 1]^D$ of the sequence s and write it into the array x.

source
next!(
    s::QInchworm.scrambled_sobol.ScrambledSobolSeq
) -> Vector{Float64}

Generate and return the next point $\mathbf{x}\in[0, 1]^D$ of the sequence s.

source
next!(
    s::QInchworm.utility.RandomSeq,
    x::AbstractVector{<:AbstractFloat}
) -> AbstractVector{<:AbstractFloat}

Generate the next point $\mathbf{x}\in[0, 1)^D$ of the random sequence s and write it into the array x.

source
next!(s::QInchworm.utility.RandomSeq) -> Vector{Float64}

Generate and return the next point $\mathbf{x}\in[0, 1)^D$ of the sequence s.

source
QInchworm.scrambled_sobol.skip!Function
skip!(
    s::QInchworm.scrambled_sobol.ScrambledSobolSeq,
    n::Integer,
    x;
    exact
) -> QInchworm.scrambled_sobol.ScrambledSobolSeq

Skip a number of points in the sequence s using a preallocated buffer x.

  • skip!(s, n, x) skips the next $2^m$ points such that $2^m < n \leq 2^{m+1}$.
  • skip!(s, n, x, exact=true) skips the next $n$ points.
source
skip!(
    s::QInchworm.scrambled_sobol.ScrambledSobolSeq,
    n::Integer;
    exact
) -> QInchworm.scrambled_sobol.ScrambledSobolSeq

Skip a number of points in the sequence s.

  • skip!(s, n) skips the next $2^m$ points such that $2^m < n \leq 2^{m+1}$.
  • skip!(s, n, exact=true) skips the next $n$ points.
source
skip!(
    s::QInchworm.utility.RandomSeq,
    n::Integer,
    x;
    exact
) -> QInchworm.utility.RandomSeq

Skip a number of points in the random sequence s using a preallocated buffer x.

  • skip!(s, n, x) skips the next $2^m$ points such that $2^m < n \leq 2^{m+1}$.
  • skip!(s, n, x, exact=true) skips the next $n$ points.
source
skip!(
    s::QInchworm.utility.RandomSeq,
    n::Integer;
    exact
) -> QInchworm.utility.RandomSeq

Skip a number of points in the random sequence s.

  • skip!(s, n) skips the next $2^m$ points such that $2^m < n \leq 2^{m+1}$.
  • skip!(s, n, exact=true) skips the next $n$ points.
source