لَآ إِلَـٰهَ إِلَّا هُوَ
LA ILAHA ILLA HU
Allah, Your Lord There Is No Deity Except Him.

Python Data Science NumPy Random Rayleigh Data Distribution

Rayleigh distribution: is used in signal processing.

It has the following two parameters:

1. scale - (standard deviation) decides how flat the distribution will be default 1.0).

2. size - The shape of the returned array.

Example 1: Draw out a sample for rayleigh distribution with scale of 2 with size 2x4.

Code

from numpy import random

x = random.rayleigh(scale=2, size=(2, 4))

print(x)

the output will be

[[5.14030153 2.22234997 0.90410587 5.71369629]

[0.8789509 1.44487924 3.37375174 2.01754104]]

Note: Every time the code is run the output may vary because of random generation.

Visualization of Rayleigh Distribution

Example 2

Code

from numpy import random
import matplotlib.pyplot as plt
import seaborn as sns

sns.distplot(random.
rayleigh(size=100000), hist=False)

plt.show()

the output will be



Similarity Between Rayleigh and Chi Square Distribution
degrees of freedom rayleigh and chi square represent the same distributions..