Skip to contents

n points of the Sobol sequence in dim dimensions: Joe and Kuo's direction numbers (up to 1,111 dimensions) at 32 bits, in Gray-code order. Unscrambled, the points are SciPy's stats.qmc.Sobol(dim, scramble=False, bits=32) exactly, the first at the origin. Scrambled, a linear matrix scramble with a digital shift drawn from seed (SciPy's kind of scramble, not its random stream) makes each point uniform and keeps the balance: over 2^m points each 1 / 2^m of a coordinate holds one point.

Usage

sobol_points(n, dim, scramble = TRUE, seed = 0)

Arguments

n

Number of points.

dim

Number of dimensions.

scramble

Whether to scramble.

seed

Seed of the scramble.

Value

An n by dim matrix.

Examples

sobol_points(4, 2, scramble = FALSE)
#>      [,1] [,2]
#> [1,] 0.00 0.00
#> [2,] 0.50 0.50
#> [3,] 0.75 0.25
#> [4,] 0.25 0.75