Random Number Generator in Arbitrary Probability Distribution Fashion
Random Number Generation

Random Numbers
RandomReal[ ] | give a pseudorandom real number in the range 0 to 1 |
RandomReal[ { x min , x max } ] | give a pseudorandom real number in the range x min to x max |
RandomReal[ x max ] | give a pseudorandom real number in the range 0 to ten max |
RandomReal[ domain , n ] | give a list of n pseudorandom reals |
RandomReal[ domain , { n 1 , northward two , … } ] | give an n 1 × n 2 × … array of pseudorandom reals |
RandomInteger[ { i min , i max } ] | give a pseudorandom integer in the range { i min , … , i max } |
RandomInteger[ i max ] | give a pseudorandom integer in the range { 0 , … , i max } |
RandomInteger[ ] | pseudorandomly give 0 or one with probability ![]() |
RandomInteger[ domain , due north ] | give a list of n pseudorandom integers |
RandomInteger[ domain , { n 1 , n 2 , … } ] | requite an north 1 × n 2 × … array of pseudorandom integers |
RandomComplex[ ] | give a pseudorandom complex number in the unit foursquare |
RandomComplex[ { z min , z max } ] | requite a pseudorandom complex number in the rectangle bounded past z min and z max |
RandomComplex[ z max ] | requite a pseudorandom complex number in the rectangle divisional by 0 and z max |
RandomComplex[ domain , n ] | requite a listing of n pseudorandom complex numbers |
RandomComplex[ domain , { n 1 , n 2 , … } ] | give an n i × north 2 × … assortment of pseudorandom complex numbers |
RandomVariate[ dist ] | requite a pseudorandom value from the distribution dist |
RandomVariate[ dist , n ] | give a list of n pseudorandom values from dist |
RandomVariate[ dist , { north i , n ii , … } ] | give an due north 1 × due north 2 × … assortment of pseudorandom values from dist |
RandomPrime[ { i min , i max } ] | give a pseudorandom prime number in the range { i min , … , i max } |
RandomPrime[ i max ] | give a pseudorandom prime number in the range two to i max |
RandomPrime[ domain , n ] | give a list of due north pseudorandom primes |
RandomPrime[ domain , { n 1 , north two , … } ] | give an north 1 × northward 2 × … assortment of pseudorandom primes |


Arbitrary-Precision Reals and Complexes




Random Elements
RandomChoice[ { due east 1 , e 2 , … } ] | give a pseudorandom selection of one of the due east i |
RandomChoice[ list , n ] | requite a list of n pseudorandom choices from list |
RandomChoice[ list , { n ane , n 2 , … } ] | requite n 1 × n 2 × … pseudorandom choices from list |
RandomChoice[ { w ane , west 2 , … }->{ e 1 , east 2 , … } ] | |
give a pseudorandom choice weighted past the westward i | |
RandomChoice[ wlist->elist , due north ] | requite a list of due north weighted choices |
RandomChoice[ wlist->elist , { north ane , due north two , … } ] | |
give an array of northward i × n 2 × … assortment of weighted choices |
RandomSample[ { due east 1 , east 2 , … } , n ] | give a pseudorandom sample of north of the eastward i |
RandomSample[ { westward 1 , w 2 , … }->{ e 1 , e 2 , … } , north ] | |
give a pseudorandom sample of due north of the e i called using weights w i | |
RandomSample[ { e one , eastward 2 , … } ] | requite a pseudorandom permutation of the e i |
RandomSample[ wlist->elist ] | requite a pseudorandom permutation of elist using initial weights wlist |

BlockRandom[ expr ] | evaluate expr with all pseudorandom generators localized |
SeedRandom[ due north ] | reset the pseudorandom generator using north as a seed |
SeedRandom[ ] | reset the generator using every bit a seed the time of day and sure attributes of the current Wolfram Language session |
SeedRandom and BlockRandom in Parallel Computations
command | series | parallel |
SeedRandom[ seed ] | seed all current series random generators with seed and the parallel generators with with seed + i , where i is the index for the parallel thread | seed but the random generator for the current thread with seed |
SeedRandom[ seed ,Method->"ParallelGenerator"] | seed the parallel generators with seed + i , where i is the alphabetize for the parallel thread | no effect |
SeedRandom[Method->method ] | modify the method for the serial random generator to method | change the method for only the random generator for the current thread to method |
BlockRandom[ expr ] | evaluate expr with all pseudorandom generators localized | evaluate expr with merely the pseudorandom generator for the current thread localized |




"Congruential" | linear congruential generator (low ‐ quality randomness) |
"ExtendedCA" | extended cellular automaton generator (default) |
"Legacy" | default generators prior to Mathematica 6.0 |
"MersenneTwister" | Mersenne Twister shift register generator |
"MKL" | Intel MKL generator (Intel ‐ based systems) |
"ParallelGenerator" | used for initializing and seeding generators for parallel computations. |
"ParallelMersenneTwister" | set of 1024 Mersenne Twister generators of period ![]() |
"Rule30CA" | Wolfram rule thirty generator |
Congruential

pick name | default value | |
"Bits" | Automated | specify range of bits to use for numbers constructed from $.25 |
"Multiplier" | 1283839219676404755 | multiplier value |
"Increment" | 0 | increment value |
"Modulus" | 2305843009213693951 | modulus value |
"ConvertToRealsDirectly" | True | whether reals should be constructed straight from the congruence relation |

ExtendedCA
selection proper noun | default value | |
"Size" | 80 | state vector size every bit a multiplier of 64 |
"Skip" | 4 | number of cells to skip |
"First" | 0 | which cell to showtime from |

Legacy
MersenneTwister

MKL
"MCG31" | 31-flake multiplicative congruential generator |
"MCG59" | 59-bit multiplicative congruential generator |
"MRG32K3A" | combined multiple recursive generators with two components of order three |
"MersenneTwister" | Mersenne Twister shift register generator |
"R250" | generalized feedback shift register generator |
"WichmannHill" | Wichmann–Hill combined multiplicative congruential generators |
"Niederreiter" | Niederreiter low-discrepancy sequence |
"Sobol" | Sobol depression-discrepancy sequence |
Rule30CA

choice proper noun | default value | |
"Size" | nine | state vector size every bit a multiplier of 29 |

ParallelMersenneTwister

pick proper name | default value | |
"Alphabetize" | 0 | which generator to use from 0 to 1023 |
ParallelGenerator
option name | default value | |
Method | Automatic | which contained generators to use |
"ParallelMersenneTwister" | parallel Mersenne twister generators with period ![]() |
"ExtendedCA" | extended CA generators with dissimilar starting positions |
f | generator f [ i ] used for the i thursday thread |
"Default" | restores the default method |
Defining Your Own Generator
Random`InitializeGenerator[ gsym , opts ] | |
initialize the generator gsym with options opts |
GeneratesBitsQ | set to Truthful if the method generates bits |
GeneratesIntegersQ | fix to Truthful if the method generates integers for a given range |
GeneratesRealsQ | set to True if the method generates reals for a given range and precision |


Example: Multiplicative Congruential Generator


Example: Blum–Blum–Shub Generator
RandomVariate[ dist ] | requite a random number from the continuous distribution dist |
RandomVariate[ dist , n ] | give a list of due north pseudorandom reals from dist |
RandomVariate[ dist , { n 1 , n ii , … } ] | give an due north 1 × n 2 × … array of pseudorandom reals from dist |
Continuous Distributions


























Discrete Distributions

Defining Distributional Generators
Random`DistributionVector[ expr , northward , prec ] | |
defines rules for generating northward observations from expr with precision prec |


Case: Normal Distribution by Inversion
Example: Uniform Distribution on a Disk
Example: Gibbs Sampler
[1] Geman, Due south. and D. Geman. "Stochastic Relaxation, Gibbs Distributions, and the Bayesian Restoration of Images." IEEE Transactions on Pattern Analysis and Automobile Intelligence 6, no. 6 (1984): 721–741.
[2] Casella, Chiliad. and E. I. George. "Explaining the Gibbs Sampler." The American Statistician 46, no. iii (1992): 167–174.
[3] Matsumoto, Thou. and T. Nishimura. "Mersenne Twister: A 623-Dimensionally Equidistributed Compatible Pseudorandom Number Generator." ACM Transactions on Modeling and Computer Simulation eight, no. 1 (1998): 3–thirty.
[four] Nishimura, T. "Tables of 64-Bit Mersenne Twisters." ACM Transactions on Modeling and Computer Simulation 10, no. 4 (2000): 348–357.
[5] Junod, P. "Cryptographic Secure Pseudo-Random Bits Generation: The Blum–Blum–Shub Generator." August 1999. http://crypto.junod.info/bbs.pdf
[half-dozen] Gentle, J. E. Random Number Generation and Monte Carlo Methods, 2d ed. Springer-Verlag, 2003.
[7] Johnson, N. L., S. Kotz, and N. Balakrishnan. Continuous Univariate Distributions, Volume 2, 2nd ed. John Wiley & Sons, 1995.
[8] Smith, Due west. B. and R. R. Hocking. "Algorithm AS 53: Wishart Variate Generator." Applied Statistics 21, no. iii (1972): 341–345.
[9] Cheng, R. C. H. and G. K. Feast. "Some Simple Gamma Variate Generators." Applied Statistics 28, no. 3 (1979): 290–295.
[10] Johnson, M. East. Multivariate Statistical Simulation. John Wiley & Sons, 1987.
[11] Jöhnk, Chiliad. D. "Erzeugung von Betaverteilten und Gammaverteilten Zufallszahlen." Metrika eight (1964): 5–15.
[12] Cheng, R. C. H. "Generating Beta Variables with Nonintegral Shape Parameters." Communications of the ACM 21, no. 4 (1978): 317–322.
[xiii] Atkinson, A. C. "A Family of Switching Algorithms for the Computer Generation of Beta Random Variables." Biometrika 66, no. one (1979): 141–145.
[xiv] Bailey, R. W. "Polar Generation of Random Variates with the t-Distribution." Mathematics of Ciphering 62, no. 206 (1994): 779–781.
[15] Devroye, 50. Non-Uniform Random Variate Generation. Springer-Verlag, 1986.
[xvi] Kachitvichyanukul, V. and B. W. Schmeiser. "Binomial Random Variate Generation." Communications of the ACM 31, no. 2 (1988): 216–223.
[17] Kachitvichyanukul, V. and B. Due west. Schmeiser. "Computer Generation of Hypergeometric Random Variates." Journal of Statistical Computation and Simulation 22, no. ii (1985): 127–145.
[18] Ahrens, J. H. and U. Dieter. "Computer Generation of Poisson Deviates from Modified Normal Distributions." ACM Transactions on Mathematical Software 8, no. 2 (1982): 163–179.
[19] Matsumoto, M. and T. Nishimura. "Dynamic Creation of Pseudorandom Number Generators." In Proceedings of the Third International Conference on Monte Carlo and Quasi-Monte Carlo Methods in Scientific Calculating: Monte Carlo and Quasi‐Monte Carlo Methods 1998, 56–69, 2000.
0 Response to "Random Number Generator in Arbitrary Probability Distribution Fashion"
Post a Comment