The Rayleigh distribution is commonly used in signal processing. It has two parameters:
scale (standard deviation): Determines the spread of the distribution (default is 1.0).
size: Specifies the shape of the returned array.
Generate a sample from the Rayleigh distribution with a scale of 2 and a size of 2×3.
from numpy import random x = random.rayleigh(scale=2, size=(2, 3)) print(x) |
from numpy import random import matplotlib.pyplot as plt import seaborn as sns sns.distplot(random.rayleigh(size=1000), hist=False) plt.show() |
At a unit standard deviation and 2 degrees of freedom, the Rayleigh and Chi-Square distributions represent the same distribution.