Skip to content

Commit 23d9541

Browse files
committed
Rayleigh Distribution
1 parent 099a0bb commit 23d9541

File tree

1 file changed

+44
-0
lines changed

1 file changed

+44
-0
lines changed

20.Rayleigh_Distribution.py

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
'''
2+
Rayleigh Distribution using matplotlib.pyplot, numpy.random module and seaborn librarys by hey sushil:
3+
4+
Rayleigh Distribution kya hai?
5+
6+
1. Ye continuous probability distribution hai.
7+
2. Rayleigh Distribution ka use signal processing ke liye hota hai.
8+
3. Rayleigh Distribution, Weibull Distribution ka special case hai jisme scale paramether 2 rakhna hoga.
9+
4. Iske alawa Rayleigh Distribution me agar scale 1 ho aur yahi same case Chi-square distribution me df(degree of freedom) 2 kare to ye ek jaise honge.
10+
11+
Rayleigh Distribution 4 field me alag alag tarikese use me aata hai. Ye kaon-kaon se hain ye dekhte hain:
12+
13+
1. Communications: To model multiple paths of dense scattered signals reaching a receiver.
14+
2. Physical sciences: To model wind speed, wave heights and sound/light radiation.
15+
3. Engineering: To measure the lifetime of an object, where the lifetime depends on the object’s age.
16+
For example: resistors, transformers, and capacitors in aircraft radar sets.
17+
4. Medical: Imaging science, to model noise variance in magnetic resonance imaging.
18+
19+
numpy.random.rayleigh() ke arguments:
20+
21+
1. scale: (Standard deviation defualt 1.0) Isse kitna flat distribution hoga ye decide karte hain.
22+
2. size: Matrix or array ka shape kitna rakhoge.
23+
'''
24+
25+
import numpy.random as r
26+
import matplotlib.pyplot as plt
27+
import seaborn as sns
28+
29+
ray = r.rayleigh(size=(10))
30+
# print('\nRay: ',ray)
31+
32+
# seaborn
33+
sns.distplot(r.rayleigh(size=(100)), hist=False, label='1.0')
34+
sns.distplot(r.rayleigh(scale=2.0, size=(100)), hist=False, label='2.0')
35+
sns.distplot(r.rayleigh(scale=3.0, size=(100)), hist=False, label='3.0')
36+
sns.distplot(r.rayleigh(scale=4.0, size=(100)), hist=False, label='4.0')
37+
38+
# plt
39+
plt.xlabel('Rang of x')
40+
# plt.xlim(0, 10)
41+
# plt.ylim(0,0.5)
42+
plt.ylabel('Range of y')
43+
plt.title('Rayleigh Distribution')
44+
plt.show()

0 commit comments

Comments
 (0)