Random Rayleigh Distribution In NumPy
In this article, we will explore NumPy random rayleigh distribution, and demonstrate how to produce random numbers from this distribution through the numpy module.
What is Rayleigh Distribution?
The Rayleigh distribution is a continuous probability distribution used to model the magnitude of the vector sum of independent Gaussian random variables.
The PDF of the Rayleigh distribution is given by:
f(x; σ) = x/σ^2 * e^(-x^2/(2*σ^2))
where x is the random variable, σ is the scale parameter, and e is the base of the natural logarithm.
The mean and variance of the Rayleigh distribution are given by:
mean = σ*sqrt(π/2) variance = (4-π)/2 * σ^2
Numpy Random Rayleigh Distribution
The numpy random rayleigh function is used to generate random numbers from a Rayleigh distribution.
According to Numpy random Rayleigh, rayleigh distributions are applied to signal analysis.
There are two parameters associated with it:
|scale||(standard deviation) determines how smooth the distribution will be (by default, 1.0).|
|size||Indicates the array’s shape.|
Take a random sample of 4.5 with a size of 1 by 5 for rayleigh distribution:
Create a sample for the rayleigh distribution with scale one and size two and one:
Represent Rayleigh Distribution as follows:
Display Rayleigh Distribution also with histogram:
Similarity Between Rayleigh and Chi Square Distribution
Numpy random rayleigh is useful in many cases, Some of them are included below:
The Rayleigh distribution is used in wireless communications to model the magnitude of the received signal.
It can be used to generate random channel gains for simulations.
The Rayleigh distribution is used in engineering to model the strength of materials.
It can be used to generate random material strengths for simulations.
The Rayleigh distribution is used in physics to model the magnitude of the displacement of a particle from its equilibrium position due to random forces.
Numpy random rayleigh can be used to generate random displacements for simulations.