#include <phrand.h>
Inheritance diagram for simth::RayleighRng:
Public Member Functions | |
RayleighRng (double sigma) | |
virtual | ~RayleighRng () |
double | sigma () const |
void | setSigma (double x) |
virtual double | get () const |
double | get_inl () const |
The function get() of this class returns a random variate from the Rayleigh distribution with scale parameter sigma.
The distribution is
This distribution has a mean value and variance of
WATCH OUT: The scale factor sigma is NOT the variance of this random variable!!! The specified parameter is not even the variance but rather the standard deviation (square root of variance). Instead, if you view the Rayleigh variable as the magnitude of a complex r.v. with real and imaginary part i.i.d. Gaussians, then is the variance of the real and imaginary part separately (and is its standard deviation). The average power of such a complex r.v. would be the sum of the variances of the real and imaginary part, hence the power would be .
The scale factor sigma is set by the constructor argument and by the function setSigma(). The used precision in this class is double.
|
Constructor for the random number generator.
|
|
|
|
Returns the scale parameter for the Rayleigh distribution (not to be confused with the variance of this distribution). |
|
Sets the scale parameter for the Rayleigh distribution (not to be confused with the variance of this distribution) |
|
Returns a random variate from the Rayleigh distribution. Implements simth::RandomGenerator. |
|
Non-virtual inline version of get(). |