randomstate.prng.mlfg_1279_861.complex_normal

randomstate.prng.mlfg_1279_861.complex_normal(loc=0.0, gamma=1.0, relation=0.0, size=None, method='bm')

Draw random samples from a complex normal (Gaussian) distribution.

Parameters:
  • loc (complex or array_like of complex) – Mean of the distribution.
  • gamma (float, complex or array_like of float or complex) – Variance of the distribution
  • relation (float, complex or array_like of float or complex) – Relation between the two component normals
  • size (int or tuple of ints, optional) – Output shape. If the given shape is, e.g., (m, n, k), then m * n * k samples are drawn. If size is None (default), a single value is returned if loc, gamma and relation are all scalars. Otherwise, np.broadcast(loc, gamma, relation).size samples are drawn.
  • method (str, optional) – Either ‘bm’ or ‘zig’. ‘bm’ uses the default Box-Muller transformations method. ‘zig’ uses the much faster Ziggurat method of Marsaglia and Tsang.
Returns:

out – Drawn samples from the parameterized complex normal distribution.

Return type:

ndarray or scalar

See also

numpy.random.normal()
random values from a real-valued normal distribution

Notes

EXPERIMENTAL Not part of official NumPy RandomState, may change until formal release on PyPi.

Complex normals are generated from a bivariate normal where the variance of the real component is 0.5 Re(gamma + relation), the variance of the imaginary component is 0.5 Re(gamma - relation), and the covariance between the two is 0.5 Im(relation). The implied covariance matrix must be positive semi-definite and so both variances must be zero and the covariance must be weakly smaller than the product of the two standard deviations.

References

[1]Wikipedia, “Complex normal distribution”, https://en.wikipedia.org/wiki/Complex_normal_distribution
[2]Leigh J. Halliwell, “Complex Random Variables” in “Casualty Actuarial Society E-Forum”, Fall 2015.

Examples

Draw samples from the distribution:

>>> s = np.random.complex_normal(size=1000)