Generates random, normally distributed values via the Box-Muller transform.
Generates a pair of independent, standard, normally distributed random values using the Box-Muller transform.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real(kind=real64), | intent(in) | :: | mu |
The mean of the distribution. |
||
real(kind=real64), | intent(in) | :: | sigma |
The standard deviation of the distribution. |
The pair of random values.
Generates an array of normally distributed random values sampled by the Box-Muller transform.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real(kind=real64), | intent(in) | :: | mu |
The mean of the distribution. |
||
real(kind=real64), | intent(in) | :: | sigma |
The standard deviation of the distribution. |
||
integer(kind=int32), | intent(in) | :: | n |
The number of Box-Muller pairs to generate. |
A 2N-element array containing the N Box-Muller pairs.
Uses rejection sampling to randomly sample a target distribution.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(distribution), | intent(in) | :: | tdist |
The distribution to sample |
||
integer(kind=int32), | intent(in) | :: | n |
The number of samples to make. |
||
real(kind=real64), | intent(in) | :: | xmin |
The minimum range to explore. |
||
real(kind=real64), | intent(in) | :: | xmax |
The maximum range to explore. |
An N-element array containing the N samples from the distribution.