class_docstr: Halton sequence.
  
  Pseudo-random number generator that generalize the Van der Corput sequence
  for multiple dimensions. The Halton sequence uses the base-two Van der
  Corput sequence for the first dimension, base-three for its second and
  base-:math:`n` for its n-dimension.
  
  Parameters
  ----------
  d : int
      Dimension of the parameter space.
  scramble : bool, optional
      If True, use Owen scrambling. Otherwise no scrambling is done.
      Default is True.
  seed : {None, int, `numpy.random.Generator`}, optional
      If `seed` is None the `numpy.random.Generator` singleton is used.
      If `seed` is an int, a new ``Generator`` instance is used,
      seeded with `seed`.
      If `seed` is already a ``Generator`` instance then that instance is
      used.
  
  Notes
  -----
  The Halton sequence has severe striping artifacts for even modestly
  large dimensions. These can be ameliorated by scrambling. Scrambling
  also supports replication-based error estimates and extends
  applicabiltiy to unbounded integrands.
  
  References
  ----------
  .. [1] Halton, "On the efficiency of certain quasi-random sequences of
     points in evaluating multi-dimensional integrals", Numerische
     Mathematik, 1960.
  .. [2] A. B. Owen. "A randomized Halton algorithm in R",
     arXiv:1706.02808, 2017.
  
  Examples
  --------
  Generate samples from a low discrepancy sequence of Halton.
  
  >>> from scipy.stats import qmc
  >>> sampler = qmc.Halton(d=2, scramble=False)
  >>> sample = sampler.random(n=5)
  >>> sample
  array([[0.        , 0.        ],
         [0.5       , 0.33333333],
         [0.25      , 0.66666667],
         [0.75      , 0.11111111],
         [0.125     , 0.44444444]])
  
  Compute the quality of the sample using the discrepancy criterion.
  
  >>> qmc.discrepancy(sample)
  0.088893711419753
  
  If some wants to continue an existing design, extra points can be obtained
  by calling again `random`. Alternatively, you can skip some points like:
  
  >>> _ = sampler.fast_forward(5)
  >>> sample_continued = sampler.random(n=5)
  >>> sample_continued
  array([[0.3125    , 0.37037037],
         [0.8125    , 0.7037037 ],
         [0.1875    , 0.14814815],
         [0.6875    , 0.48148148],
         [0.4375    , 0.81481481]])
  
  Finally, samples can be scaled to bounds.
  
  >>> l_bounds = [0, 2]
  >>> u_bounds = [10, 5]
  >>> qmc.scale(sample_continued, l_bounds, u_bounds)
  array([[3.125     , 3.11111111],
         [8.125     , 4.11111111],
         [1.875     , 2.44444444],
         [6.875     , 3.44444444],
         [4.375     , 4.44444444]])
class_docstr_tok: ["Halton","sequence",".","Pseudo-random","number","generator","that","generalize","the","Van","der","Corput","sequence","for","multiple","dimensions",".","The","Halton","sequence","uses","the","base-two","Van","der","Corput","sequence","for","the","first","dimension",",","base-three","for","its","second","and","base-",":","math",":","`","n","`","for","its","n-dimension",".","Parameters","--","--","--","--","--","d",":","int","Dimension","of","the","parameter","space",".","scramble",":","bool",",","optional","If","True",",","use","Owen","scrambling",".","Otherwise","no","scrambling","is","done",".","Default","is","True",".","seed",":","{","None",",","int",",","`","numpy.random.Generator","`","}",",","optional","If","`","seed","`","is","None","the","`","numpy.random.Generator","`","singleton","is","used",".","If","`","seed","`","is","an","int",",","a","new","``","Generator","``","instance","is","used",",","seeded","with","`","seed","`",".","If","`","seed","`","is","already","a","``","Generator","``","instance","then","that","instance","is","used",".","Notes","--","--","-","The","Halton","sequence","has","severe","striping","artifacts","for","even","modestly","large","dimensions",".","These","can","be","ameliorated","by","scrambling",".","Scrambling","also","supports","replication-based","error","estimates","and","extends","applicabiltiy","to","unbounded","integrands",".","References","--","--","--","--","--","..","[","1","]","Halton",",","``","On","the","efficiency","of","certain","quasi-random","sequences","of","points","in","evaluating","multi-dimensional","integrals","''",",","Numerische","Mathematik",",","1960",".","..","[","2","]","A",".","B.","Owen",".","``","A","randomized","Halton","algorithm","in","R","''",",","arXiv:1706.02808",",","2017",".","Examples","--","--","--","--","Generate","samples","from","a","low","discrepancy","sequence","of","Halton",".",">",">",">","from","scipy.stats","import","qmc",">",">",">","sampler","=","qmc.Halton","(","d=2",",","scramble=False",")",">",">",">","sample","=","sampler.random","(","n=5",")",">",">",">","sample","array","(","[","[","0.",",","0",".","]",",","[","0.5",",","0.33333333","]",",","[","0.25",",","0.66666667","]",",","[","0.75",",","0.11111111","]",",","[","0.125",",","0.44444444","]","]",")","Compute","the","quality","of","the","sample","using","the","discrepancy","criterion",".",">",">",">","qmc.discrepancy","(","sample",")","0.088893711419753","If","some","wants","to","continue","an","existing","design",",","extra","points","can","be","obtained","by","calling","again","`","random","`",".","Alternatively",",","you","can","skip","some","points","like",":",">",">",">","_","=","sampler.fast_forward","(","5",")",">",">",">","sample_continued","=","sampler.random","(","n=5",")",">",">",">","sample_continued","array","(","[","[","0.3125",",","0.37037037","]",",","[","0.8125",",","0.7037037","]",",","[","0.1875",",","0.14814815","]",",","[","0.6875",",","0.48148148","]",",","[","0.4375",",","0.81481481","]","]",")","Finally",",","samples","can","be","scaled","to","bounds",".",">",">",">","l_bounds","=","[","0",",","2","]",">",">",">","u_bounds","=","[","10",",","5","]",">",">",">","qmc.scale","(","sample_continued",",","l_bounds",",","u_bounds",")","array","(","[","[","3.125",",","3.11111111","]",",","[","8.125",",","4.11111111","]",",","[","1.875",",","2.44444444","]",",","[","6.875",",","3.44444444","]",",","[","4.375",",","4.44444444","]","]",")"]
code: def __init__(
      self,
      d: IntNumber,
      *,
      scramble: bool = True,
      seed: SeedType = None,
  ) -> None:
      super().__init__(d=d, seed=seed)
      self.seed = seed
      self.base = n_primes(d)
      self.scramble = scramble
  
imports: from __future__ import annotations
  import os
  import copy
  import numbers
  from abc import ABC, abstractmethod
  import math
  from typing import ClassVar, List, Optional, overload, TYPE_CHECKING
  import warnings
  import numpy
  import scipy.stats
  from scipy._lib._util import rng_integers
  from scipy.stats._sobol import initialize_v, _cscramble, _fill_p_cumulative, _draw, _fast_forward, _categorize, initialize_direction_numbers, _MAXDIM, _MAXBIT
  from scipy.stats._qmc_cy import _cy_wrapper_centered_discrepancy, _cy_wrapper_wrap_around_discrepancy, _cy_wrapper_mixture_discrepancy, _cy_wrapper_l2_star_discrepancy, _cy_wrapper_update_discrepancy
label_desc: Use image node_id 1 to create a new Halton object from inherited base classes: QMCEngine with example: obj = Halton(d)