Generate a pseudorandom number from a mixture of two exponential distributions.
double
which specifies the mean of the exponential distribution that has the larger mean. double
which specifies the mean of the exponential distribution that has the smaller mean. theta2
must be positive and less than or equal to theta1
. double
which specifies the mixing parameter. It must satisfy . A double
which specifies a pseudorandom number from a mixture of the two exponential distributions.
where , , and .
In the case of a convex mixture, that is, the case , the mixing parameter p is interpretable as a probability; and NextExponentialMix
with probability p generates an exponential deviate with mean , and with probability 1 - p generates an exponential with mean . When p is greater than 1, but less than , then either an exponential deviate with mean or the sum of two exponentials with means and is generated. The probabilities are and 1 - q, respectively, for the single exponential and the sum of the two exponentials.
Random Class | Imsl.Stat Namespace | Example