Rayleigh Distribution
🌊 Rayleigh Distribution in Python
The Rayleigh distribution is a continuous probability distribution often used in signal processing, communications, and reliability analysis. It describes the magnitude of a vector with two independent, normally distributed components.
1. Characteristics of Rayleigh Distribution
-
Continuous distribution
-
Parameter:
scale = σ(standard deviation of underlying normal distributions) -
Values ≥ 0
-
PDF (Probability Density Function):
f(x;σ)=xσ2e−x2/(2σ2),x≥0f(x; \sigma) = \frac{x}{\sigma^2} e^{-x^2/(2\sigma^2)}, \quad x \ge 0
Applications:
-
Modeling wind speed
-
Magnitude of noise in communication signals
-
Reliability of mechanical components
2. Generate Rayleigh Data Using NumPy
Output (example):
-
All values ≥ 0
-
Distribution is right-skewed
3. Visualize Rayleigh Distribution
-
Right-skewed
-
Peak occurs near
scale
4. Compare Different Scale Parameters
-
Smaller
scale→ peak closer to 0 -
Larger
scale→ distribution spreads out
5. Compute Mean and Standard Deviation
-
Mean ≈
scale * √(π/2) -
Standard deviation ≈
scale * √((4-π)/2)
🧠 Summary Table
| Function | Parameters | Description |
|---|---|---|
np.random.rayleigh() |
scale, size | Generates Rayleigh random numbers |
scale |
Standard deviation | Determines spread of distribution |
size |
Number of samples | Output array size |
🎯 Practice Exercises
-
Generate 1000 Rayleigh random numbers with
scale=1.5and plot histogram with KDE. -
Compare Rayleigh distributions for
scale=1,scale=2,scale=4. -
Compute the mean and standard deviation and compare with theoretical formulas.
