Sobol Library¶
-
delphin_6_automation.sampling.sobol_lib.
i4_bit_hi1
(n)[source]¶ I4_BIT_HI1 returns the position of the high 1 bit base 2 in an integer.
Example:
N Binary BIT- —- ——– —-
- 0 0 0 1 1 1 2 10 2 3 11 2 4 100 3 5 101 3 6 110 3 7 111 3 8 1000 4 9 1001 4
10 1010 4 11 1011 4 12 1100 4 13 1101 4 14 1110 4 15 1111 4 16 10000 5 17 10001 5
1023 1111111111 10 1024 10000000000 11 1025 10000000001 11
Licensing:
This code is distributed under the GNU LGPL license. Modified: 22 February 2011
Author: Original MATLAB version by John Burkardt. PYTHON version by Corrado Chisari
Parameters: n (int) – The integer to be measured. n should be non-negative. If n is non-positive, the value will always be 0. Returns: BIT, the number of bits base 2. Return type: int
-
delphin_6_automation.sampling.sobol_lib.
i4_bit_lo0
(n)[source]¶ I4_BIT_LO0 returns the position of the low 0 bit base 2 in an integer.
Example:
N Binary BIT- —- ——– —-
- 0 0 1 1 1 2 2 10 1 3 11 3 4 100 1 5 101 2 6 110 1 7 111 4 8 1000 1 9 1001 2
10 1010 1 11 1011 3 12 1100 1 13 1101 2 14 1110 1 15 1111 5 16 10000 1 17 10001 2
1023 1111111111 1 1024 10000000000 1 1025 10000000001 1
Licensing:
This code is distributed under the GNU LGPL license.
Modified: 22 February 2011
Author: Original MATLAB version by John Burkardt. PYTHON version by Corrado Chisari
Parameters: n (int) – The integer to be measured. N should be nonnegative. Returns: BIT, the position of the low 1 bit. Return type: int
-
delphin_6_automation.sampling.sobol_lib.
i4_sobol
(dim_num, seed)[source]¶ I4_SOBOL generates a new quasirandom Sobol vector with each call.
Discussion: The routine adapts the ideas of Antonov and Saleev.
Licensing: This code is distributed under the GNU LGPL license.
Modified: 22 February 2011
Author: Original FORTRAN77 version by Bennett Fox. MATLAB version by John Burkardt. PYTHON version by Corrado Chisari
Reference:
Antonov, Saleev, USSR Computational Mathematics and Mathematical Physics, Volume 19, 1980, pages 252 - 256.
Paul Bratley, Bennett Fox, Algorithm 659: Implementing Sobol’s Quasirandom Sequence Generator, ACM Transactions on Mathematical Software, Volume 14, Number 1, pages 88-100, 1988.
Bennett Fox, Algorithm 647: Implementation and Relative Efficiency of Quasirandom Sequence Generators, ACM Transactions on Mathematical Software, Volume 12, Number 4, pages 362-376, 1986.
Ilya Sobol, USSR Computational Mathematics and Mathematical Physics, Volume 16, pages 236-242, 1977.
Ilya Sobol, Levitan, The Production of Points Uniformly Distributed in a Multidimensional Cube (in Russian), Preprint IPM Akad. Nauk SSSR, Number 40, Moscow 1976.
Parameters: - dim_num (int) – DIM_NUM, the number of spatial dimensions. DIM_NUM must satisfy 1 <= DIM_NUM <= 40.
- seed – SEED, the “seed” for the sequence. This is essentially the index in the sequence of the quasirandom
value to be generated. On output, SEED has been set to the appropriate next value, usually simply SEED+1. If SEED is less than 0 on input, it is treated as though it were 0. An input value of 0 requests the first (0-th) element of the sequence. :type seed: int :return: QUASI(DIM_NUM), the next quasirandom vector. :rtype: float
-
delphin_6_automation.sampling.sobol_lib.
i4_sobol_generate
(m, n, skip)[source]¶ I4_SOBOL_GENERATE generates a Sobol dataset.
Licensing: This code is distributed under the GNU LGPL license.
Modified: 22 February 2011
Author: Original MATLAB version by John Burkardt. PYTHON version by Corrado Chisari
Parameters: - m (int) – M, the spatial dimension.
- n (int) – N, the number of points to generate.
- skip (int) – SKIP, the number of initial points to skip.
Returns: R(M,N), the points.
Return type: float
-
delphin_6_automation.sampling.sobol_lib.
i4_uniform
(a, b, seed)[source]¶ I4_UNIFORM returns a scaled pseudorandom I4.
Discussion: The pseudorandom number will be scaled to be uniformly distributed between A and B.
Licensing: This code is distributed under the GNU LGPL license.
Modified: 22 February 2011
Author: Original MATLAB version by John Burkardt. PYTHON version by Corrado Chisari
Reference: Paul Bratley, Bennett Fox, Linus Schrage, A Guide to Simulation, Springer Verlag, pages 201-202, 1983.
Pierre L’Ecuyer, Random Number Generation, in Handbook of Simulation, edited by Jerry Banks, Wiley Interscience, page 95, 1998.
Bennett Fox, Algorithm 647: Implementation and Relative Efficiency of Quasirandom Sequence Generators, ACM Transactions on Mathematical Software, Volume 12, Number 4, pages 362-376, 1986.
Peter Lewis, Allen Goodman, James Miller A Pseudo-Random Number Generator for the System/360, IBM Systems Journal, Volume 8, pages 136-143, 1969.
Parameters: - a (int) – A, the minimum acceptable values.
- b (int) – B, the maximum acceptable values.
- seed (int) – SEED, a seed for the random number generator.
Returns: C, the randomly chosen integer. SEED, the updated seed.
Return type: list
-
delphin_6_automation.sampling.sobol_lib.
isprime
(n)[source]¶ IS_PRIME returns True if N is a prime number, False otherwise
Licensing: This code is distributed under the GNU LGPL license.
Modified: 22 February 2011
Author: Corrado Chisari
Parameters: n (int) – N, the number to be checked. Returns: True or false Return type: bool
-
delphin_6_automation.sampling.sobol_lib.
prime_ge
(n)[source]¶ PRIME_GE returns the smallest prime greater than or equal to N.
- Example:
- N PRIME_GE -10 2 1 2 2 2 3 3 4 5 5 5 6 7 7 7 8 11 9 11 10 11
Licensing: This code is distributed under the GNU LGPL license.
Modified: 22 February 2011
Author: Original MATLAB version by John Burkardt. PYTHON version by Corrado Chisari
Parameters: n (int) – N, the number to be bounded. Returns: P, the smallest prime number that is greater than or equal to N. Return type: int
-
delphin_6_automation.sampling.sobol_lib.
scramble
(X)[source]¶ Scramble function as in Owen (1997)
Reference:
[1] Saltelli, A., Chan, K., Scott, E.M., “Sensitivity Analysis”