box_muller_sample Function

public function box_muller_sample(mu, sigma, n) result(rst)

Utilizes the Box-Muller transformation approach to generate the requested number of random samples from a normal distribution of the specified mean and standard deviation.

Arguments

Type IntentOptional 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 random samples to generate.

Return Value real(kind=real64), allocatable, dimension(:)

An N-element array containing the values.


Contents