randomgen.generator.Generator.complex_normal¶
- Generator.complex_normal(loc=0.0, gamma=1.0, relation=0.0, size=None)¶
Draw random samples from a complex normal (Gaussian) distribution.
- Parameters
- loccomplex or array_like of complex
Mean of the distribution.
- gammafloat, complex or array_like of float or complex
Variance of the distribution
- relationfloat, complex or array_like of float or complex
Relation between the two component normals
- sizeint or tuple of ints, optional
Output shape. If the given shape is, e.g.,
(m, n, k)
, thenm * n * k
samples are drawn. If size isNone
(default), a single value is returned ifloc
,gamma
andrelation
are all scalars. Otherwise,np.broadcast(loc, gamma, relation).size
samples are drawn.
- Returns
- outndarray or scalar
Drawn samples from the parameterized complex normal distribution.
See also
randomgen.generator.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 = randomgen.generator.complex_normal(size=1000)