Documentation

This is machine translation

Translated by Microsoft
Mouse over text to see original. Click the button below to return to the English verison of the page.

Pseudorandom and Quasirandom Number Generation

Generate pseudorandom and quasirandom sample data

In certain circumstances, the common methods of random number generation are inadequate to produce the desired samples. Statistics and Machine Learning Toolbox™ offers several alternative methods to generate pseudorandom and quasirandom numbers. Quasirandom numbers, also known as low discrepancy sequences, generate each successive number as far away as possible from existing numbers in the set. This approach avoids clustering and can speed up convergence, but quasirandom numbers are generally too uniform to pass randomness tests. Pseudorandom numbers are less uniform than quasirandom numbers and may be more appropriate for applications that require greater randomness. Use the slice sampler or the Metropolis-Hastings Markov chain sampler to generate pseudorandom samples by drawing from a statistical distribution.

If the available parametric probability distributions do not adequately describe your data, you can use a flexible distribution family instead. The Pearson and Johnson flexible distribution families fit a model based on the location, scale, skewness, and kurtosis of the sample data. Once you fit a distribution to your data, you can generate pseudorandom numbers from that distribution.

Classes

haltonset Halton quasi-random point sets
qrandset Quasi-random point sets
qrandstream Quasi-random number streams
sobolset Sobol quasi-random point sets

Functions

slicesample Slice sampler
mhsample Metropolis-Hastings sample
pearsrnd Pearson system random numbers
johnsrnd Johnson system random numbers

Topics

Generating Quasi-Random Numbers

Quasi-random number generators (QRNGs) produce highly uniform samples of the unit hypercube.

Representing Sampling Distributions Using Markov Chain Samplers

Markov chain samplers can generate numbers from a sampling distribution that is difficult to represent directly.

Generating Data Using Flexible Families of Distributions

The Pearson and Johnson systems are flexible parametric families of distributions that provide good matches for a wide range of data shapes.

Was this topic helpful?