gives a pseudorandom variate from the symbolic distribution dist.
gives a list of n pseudorandom variates from the symbolic distribution dist.
gives an n1× n2×… array of pseudorandom variates from the symbolic distribution dist.
Details and Options
- RandomVariate can generate random variates for continuous, discrete, or mixed distributions specified as a symbolic distribution.
- RandomVariate gives a different sequence of pseudorandom numbers whenever you run the Wolfram Language. You can start with a particular seed using SeedRandom.
- With the setting WorkingPrecision->p, random numbers of precision p will be generated.
Examplesopen allclose all
Basic Examples (5)
Basic Uses (5)
Use RandomVariate to generate arrays of different sizes and dimensions:
Use SeedRandom to get repeatable random values:
Parametric Distributions (4)
Nonparametric Distributions (4)
Derived Distributions (9)
Generate random variates for a TransformedDistribution:
Generate random variates for a ProductDistribution:
Pictures of Random Data (6)
Distribution Properties (5)
Random Experiments (4)
Estimation and Hypothesis Testing (3)
Given a binormal sample, the -statistic follows a shifted FisherZDistribution:
Visually compare the -statistic distribution to a shifted FisherZDistribution:
DistributionFitTest confirms the result:
A shipment of products is inspected in batches of 60 and each batch is inspected up to rejection when the 10 defective item is found. What is the probability of a batch being rejected if 20% of the items are defective?
The number of customers arriving at a service desk follows PoissonDistribution with mean 0.6, and the number of customers already in line before the service desk opens follows PoissonDistribution with mean 5. The number of customers served until there is no one in line follows PoissonConsulDistribution:
Other Applications (5)
RandomVariate can generate complex numbers if necessary:
Fit WignerSemicircleDistribution to its eigenvalues:
The heights of females in the United States follow normal distribution with mean 64 inches and standard deviation of 2 inches, while the heights of males in the United States follow normal distribution with mean 70 inches and standard deviation of 2 inches. If the population ratio of males to females is 1:1, then the heights of the whole population have the following bimodal distribution:
Properties & Relations (17)
RandomInteger generates uniform discrete random variates:
RandomReal generates uniform continuous variates:
RandomChoice generates random choices with replacement from a list:
RandomSample generates random choice without replacement from a list:
RandomPrime generates a random prime number:
RandomImage generates a random image:
RandomGraph generates a random graph:
RandomFunction generates a path for a random process:
Use RandomVariate to generate a sample for a time slice of the process:
Test whether the mean or median is zero by using LocationTest:
Compare means or medians for several datasets using LocationEquivalenceTest:
Test whether two datasets have the same variance by using VarianceTest:
Test whether several datasets have the same variance by using VarianceEquivalenceTest:
Use DistributionFitTest to test goodness of fit between random data and a distribution:
Estimate distribution parameters from random data using EstimatedDistribution:
Wolfram Research (2010), RandomVariate, Wolfram Language function, https://reference.wolfram.com/language/ref/RandomVariate.html.
Wolfram Language. 2010. "RandomVariate." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/RandomVariate.html.
Wolfram Language. (2010). RandomVariate. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/RandomVariate.html