kumulant

SobolSequence

class SobolSequence(val dimensions: Int, val scrambleSeed: Long? = 0, val dimensionOffset: Int = 0)(source)

Sobol points in Gray-code order using the Joe-Kuo D(6) direction numbers.

A non-null scrambleSeed applies a left linear matrix scramble and digital shift, independently per coordinate. Null selects the unscrambled sequence, whose first point is zero. Use independent seeds to estimate integration error, and powers of two from the start for balanced sample sets. Skipping or thinning points can destroy that balance. The finite sequence has 2^52 points.

Each coordinate's scramble depends on its global dimension and seed, so coordinate and sample prefixes agree across differently sized engines. dimensionOffset selects a contiguous projection of the same sequence, useful when constructing independent-coordinate blocks incrementally. Engines own mutable position and scratch state and are single-threaded.

Constructors

SobolSequence

constructor(dimensions: Int, scrambleSeed: Long? = 0, dimensionOffset: Int = 0)(source)

Types

Link copied to clipboard
object Companion

Supported Joe-Kuo direction-table extent.

Functions

nextNormal

fun nextNormal(out: DoubleArray = DoubleArray(dimensions)): DoubleArray(source)

Fill and return out with the next standard-normal point, advancing once. Uses AS 241's inverse normal CDF on 52-bit cell midpoints, so endpoint values stay finite. Normal coordinates target unit marginal variance; these quasi-random points are not IID draws.

nextPoint

fun nextPoint(out: DoubleArray = DoubleArray(dimensions)): DoubleArray(source)

Fill and return out with the next uniform point in [0, 1), advancing once.

skipTo

fun skipTo(position: Long)(source)

Set the next point's zero-based position, in [0, 2^52), including backward resets.