This is a pre-release version (2.0.0.dev0+git20260907.41eeb59).Go to latest (1.18.0)
{ } Raw JSON

bundles / scipy 2.0.0.dev0+git20260907.41eeb59 / scipy / stats / _qmc / QMCEngine / integers

function

scipy.stats._qmc:QMCEngine.integers

source: build-install/usr/lib/python3.14/site-packages/scipy/stats/_qmc.py:1000

Signature

def integers(self, l_bounds: npt.ArrayLike, *, u_bounds: npt.ArrayLike | None = None, n: IntNumber = 1, endpoint: bool = False, workers: IntNumber = 1) → np.ndarray

Summary

Draw n integers from l_bounds (inclusive) to u_bounds (exclusive), or if endpoint=True, l_bounds (inclusive) to u_bounds (inclusive).

Parameters

l_bounds : int or array-like of ints

Lowest (signed) integers to be drawn (unless u_bounds=None, in which case this parameter is 0 and this value is used for u_bounds).

u_bounds : int or array-like of ints, optional

If provided, one above the largest (signed) integer to be drawn (see above for behavior if u_bounds=None). If array-like, must contain integer values.

n : int, optional

Number of samples to generate in the parameter space. Default is 1.

endpoint : bool, optional

If true, sample from the interval [l_bounds, u_bounds] instead of the default [l_bounds, u_bounds). Defaults is False.

workers : int, optional

Number of workers to use for parallel processing. If -1 is given all CPU threads are used. Only supported when using Halton Default is 1.

Returns

sample : array_like (n, d)

QMC sample.

Notes

It is safe to just use the same [0, 1) to integer mapping with QMC that you would use with MC. You still get unbiasedness, a strong law of large numbers, an asymptotically infinite variance reduction and a finite sample variance bound.

To convert a sample from to , with the lower bounds and the upper bounds, the following transformation is used:

Aliases

  • scipy.stats._qmc.QMCEngine.integers