4.5. Rayleigh distribution - INFLIBNETshodhganga.inflibnet.ac.in/bitstream/10603/21266/10/10... ·...
Transcript of 4.5. Rayleigh distribution - INFLIBNETshodhganga.inflibnet.ac.in/bitstream/10603/21266/10/10... ·...
52
4.5. Rayleigh distribution
The Rayleigh distribution is defined by the following functions:
PDF :
CDF :
The mean and variance of the distribution is :
;
The Rayleigh distribution is frequently used to model wave heights in oceanography, and in
communication theory to describe hourly median and instantaneous peak power of received radio
signals. It has been used to model the frequency of different wind speeds over a year at wind
turbine sites.
4.6. Parameter Estimation
We now in this section estimate the parameters of the Rayleigh distribution from which the
sample comes. Here we present the method of Maximum Likelihood Estimation as this method
gives simpler estimate as compared to the Method of moments and the Local frequency ratio
method of estimation.
53
4.6.1 Maximum Likelihood Estimation
Let be a random sample of n observations from the Rayleigh population with pdf
The likelihood function of this sample is
L = .
Taking logarithms on both sides
=
=
The likelihood equation is = 0
On simplification, we get
54
4.6.2 Frequency ratio method of Estimation
As explained in the Chapter 3, we now estimate the parameters by considering local frequency
ratio method by putting x = x1, x2 in the pdf of Rayleigh distribution, we get
The ratio of above frequencies is
Taking logarithms on both sides
–
We now in the next section demonstrate the two methods with an illustration
55
Illustration:
Generate first a random sample of 1000 observations from Rayleigh distribution using MATLAB
function and Construct a frequency distribution.
For example, using x= raylrnd (0.1, 1000 ) the following distribution is obtained.
x
(midvalue)
0.0178 0.0535 0.0891 0.1248 0.1604 0.1961 0.2317 0.2674 0.3030 0.3387
f 60 161 217 193 153 107 61 30 12 6
Taking the two maximum frequencies and corresponding mid-values, substituting in the β, we
get
The above procedure is repeated for 50 samples. The mean, Standard deviation , of
these 50 estimates were computed. The estimated bias was calculated as the mean minus the true
value of the parameter. The Mean Squared Error (MSE) was calculated as the bias squared plus
the variance. .
56
Table 4.6 : Simulation Statistics for Rayleigh ( 0.1)
From the above table, we notice that the actual value of and the mean estimated value of by
Method of MLE and Local Frequency Ratio method are almost same. Therefore, it can be taken
as a good estimator. Similar procedure is followed for different sample sizes and for different
values of i.e., 0.5,1,2,5,10.. Also, we have listed the histograms Figures 4.7 to 4.14 for the data
generated for the cases considered herein. The MATLAB programs were developed to obtain
these parameters by two methods are listed in the Appendix. The results are tabulated in Tables
4.7 to 4.11.
ns=50 ns=100 ns=200
MLE
method
Frequency
Ratio
method
MLE
method
Frequency
Ratio
method
MLE
method
Frequenc
y Ratio
method
Mean
0.1004 0.0996 0.1000 0.1045 0.0999 0.1024
Sd 0.0015 0.0089 0.0013 0.0153 0.0017 0.0129
1 0.0769 0.3918 0.1052 1.7882 -0.4270 1.2235
2
2.1236 3.1088 2.4792 8.4906 3.2829 5.2900
Bias 0.35e-003 -0.362e-003 -0.20e-003 0.0045 -0.14e-003 0.0024
MSE 0.002e-003 0.078e-003 0.01e-003 0.0003 0.003e-003 0.0002
57
4.7 Comparison of Method of MLE and Frequency Ratio Method
Table 4.7: Simulation Statistics for Rayleigh ( 0.5)
Table 4.8 : Simulation Statistics for Rayleigh ( 1)
ns=50 ns=100 ns=200
MLE
method
Frequenc
y Ratio
method
MLE
method
Frequency
Ratio
method
MLE
method
Frequency
Ratio
method
Mean
0.4988 0.5183 0.5006 0.5043 0.4988 0.5128
Sd 0.0101 0.0696 0.0076 0.0790 0.0076 0.0687
1 -0.6367 1.1831 -0.1080 1.7908 -0.1385 1.0257
2
3.2876 4.1211 2.6068 8.1241 2.8631 4.1796
Bias -0.0012 0.0183 6.14e-004 0.0043 -0.0012
0.0128
MSE 0.0001 0.0051 5.78e-005 0.0063 0.0001 0.0049
ns=50 ns=100 ns=200
MLE
method
Frequenc
y Ratio
method
MLE
method
Frequency
Ratio
method
MLE
method
Frequenc
y Ratio
method
Mean
0.9990 1.0228 0.9974 1.0221 0.9996 1.0221
Sd 0.0179 0.1276 0.0166 0.1310 0.0162 0.1287
1 0.0865 1.2572 0.1880 1.1413 -0.2462 0.7959
2
2.9688 7.5724 2.8529 6.8395 2.4603 3.8279
Bias -0.0010 0.0228 -0.0026 0.0221 -4.1e-005 0.0221
MSE 0.0003 0.0168 0.0003 0.0177 2.63e-005 0.0163
58
Table 4.9 : Simulation Statistics for Rayleigh ( 2 )
Table 4.10: Simulation Statistics for Rayleigh ( 5 )
ns=50 ns=100 ns=200
MLE
method
Frequenc
y Ratio
method
MLE
method
Frequenc
y Ratio
method
MLE
method
Frequenc
y Ratio
method
Mean
1.9957 2.0921 1.9963 2.0400 2.0019 2.0677
Sd 0.0344 0.3824 0.0333 0.2533 0.0325 0.2771
1 0.0993 1.0923 0.4259 0.8684 -0.3110 0.8010
2
2.2716 3.8626 3.5114 3.5532 3.4797 3.5994
Bias -0.0043 0.0921 -0.0037 0.0400 0.0019 0.0677
MSE 0.0012 0.1547 0.0011 0.0653 0.0011 0.0813
ns=50 ns=100 ns=200
MLE
method
Frequency
Ratio
method
MLE
method
Frequency
Ratio
method
MLE
method
Frequency
Ratio
method
Mean
5.0116 5.0856 5.0088 5.0128 4.9943 5.1833
Sd 0.0818 0.7520 0.0786 0.6429 0.0872 0.7289
1 0.0719 1.2018 0.0471 0.5044 0.0874 1.5580
2
2.1907 5.0922 2.3781 3.2951 3.0103 8.1958
Bias 0.0116 0.0856 0.0088 0.0128 -0.0057
0.1833
MSE 0.0068 0.5728 0.0063 0.4135 0.0076 0.5648
59
Table 4.11 Simulation Statistics for Rayleigh ( 10 )
ns=50 ns=100 ns=200
MLE
method
Frequency
Ratio
method
MLE
method
Frequenc
y Ratio
method
MLE
method
Frequency
Ratio
method
Mean
9.9824 10.0787 9.9823 10.2623 9.9764 10.2556
Sd 0.1614 0.9978 0.1691 1.3841 0.1528 1.3740
1 -0.2399 0.7448 -0.1151 1.208 -0.1385 1.0257
2
2.2674 3.5231 2.9061 6.2105 2.8634 4.1796
Bias -0.0176 0.0787 -0.0177 0.2623 -0.0236 0.2556
MSE 0.0264 1.0018 0.0265 1.9846 0.0239 1.9532
60
4.8 GRAPHS FOR DIFFERENT SAMPLE SIZES AND PARAMETERS
Figure 4.7 : Histogram for Rayleigh(0.5,50)
Figure 4.8 : Histogram for Rayleigh(1,50)
0 0.2 0.4 0.6 0.8 1 1.2 1.4 1.6 1.80
50
100
150
200
250
Fre
quency
Bins
0 0.5 1 1.5 2 2.5 3 3.5 40
50
100
150
200
250
Fre
quency
Bins
61
Figure 4.9: Histogram for Rayleigh(1,100)
Figure 4.10: Histogram for Rayleigh (1,200)
0 0.5 1 1.5 2 2.5 3 3.5 4 4.50
50
100
150
200
250
Fre
quency
Bins
0 0.5 1 1.5 2 2.5 3 3.5 4 4.50
50
100
150
200
250
300
Fre
quency
bins
62
Figure 4. 11 : Histogram for Rayleigh(2,50)
Figure 4. 12 : Histogram for Rayleigh(2,100)
0 1 2 3 4 5 6 7 80
50
100
150
200
250
Fre
quency
Bins
0 1 2 3 4 5 6 7 80
50
100
150
200
250
Fre
quency
Bins
63
Figure 4. 13 : Histogram for Rayleigh(2,200)
Figure 4. 14 : Histogram for Rayleigh(5,50)
0 1 2 3 4 5 6 7 80
50
100
150
200
250
Fre
quency
Bins
0 5 10 15 20 250
50
100
150
200
250
300
Bins
Fre
quency
64
MATLAB PROGRAMS
GAMMA DISTRIBUTION %PROGRAM TO ESTIMATE THE PARAMETERS BY METHOD OF MOMENTS AND
LOCAL FREQUENCY RATIO METHOD.
n=1000;k=8;a=4;b=4;ns=100;
for j=1:ns,
ex=gamrnd(a,b,n,1);
meanx = mean(ex);varx = var(ex);
stdx = std(ex);
bb(j)= varx/meanx;
aa(j) = (meanx^2)/varx;
maxx=max(ex);h=maxx/k;
[fr,r]=hist(ex,h/2:h:maxx);
hist(ex,h/2:h:maxx)
[u,v]=sort(fr);
u=fliplr(u);v=fliplr(v);
y=v(1:3);x=r(y);f=u(1:3);
x12=x(1)-x(2);x23=x(2)-x(3);
lx12=log(x(1)/x(2));lx23=log(x(2)/x(3));
lf12=log(f(1)/f(2));lf23=log(f(2)/f(3));
em=[x12,lx12;x23,lx23];rhs=[lf12;lf23];
est=em\rhs;
aest=-est(1);best=est(2)+1;
a1(j)=best;b1(j)=1./aest;
65
clear ex fr r u v ;
end
%BY METHOD OF MOMENTS
a2=aa;b2=bb;
ma2=mean(a2);sda2=std(a2);
mb2=mean(b2);sdb2=std(b2);
a2z=(a2-ma2)/sda2;b2z=(b2-mb2)./sdb2;
rb1a2=mean(a2z.^3);b2a2=mean(a2z.^4);
rb1b2=mean(b2z.^3);b2b2=mean(b2z.^4);
%bias
ba2=a2-a;mba2=mean(ba2);bb2=b2-b;mbb2=mean(bb2);
%mean square error
msea2=sda2^2+ mba2^2;mseb2=sdb2^2+ mbb2^2;
mom = [ma2, sda2,rb1a2,b2a2,mb2, sdb2,rb1b2,b2b2]
mombias = [mba2,msea2,mbb2,mseb2]
%BY Frequency Ratio METHOD
a1=a1;b1=b1;
ma1=mean(a1);sda1=std(a1); mb1=mean(b1);sdb1=std(b1);
a1z=(a1-ma1)/sda1;b1z=(b1-mb1)/sdb1;
rb1a1=mean(a1z.^3);b2a1=mean(a1z.^4);
rb1b1=mean(b1z.^3);b2b1=mean(b1z.^4);
%bias
ba1=a1-a;mba1=mean(ba1);bb1=b1-b;mbb1=mean(bb1);
%mean square error
66
msea1=sda1^2+ mba1^2;mseb1=sdb1^2+ mbb1^2;
locmom = [ma1, sda1,rb1a1,b2a1,mb1, sdb1,rb1b1,b2b1]
locbias=[mba1,msea1,mbb1,mseb1]
RAYLEIGH DISTRIBUTION
% PROGRAM TO FIND THE ESTIMATES OF PARAMETERS BY MLE AND
FREQUENCY RATIO METHOD.
n=1000;k=10;b=10;ns=100;
for j=1:ns
x=raylrnd(b,n,1);
z=sum(x.^2);
best=sqrt(z/(2*n));
b1(j)=best;
maxx=max(x);
h=maxx/k;
[fr,r]=hist(x,h/2:h:maxx);
hist(x,h/2:h:maxx)
[u,v]=sort(fr);
u=fliplr(u);v=fliplr(v);
y=v(1:3);x=r(y);f=u(1:3);
lx12=log(x(1)/x(2));lf12=log(f(1)/f(2));
num=((x(2)^2)-(x(1)^2));
den=2*(lf12-lx12);
estb=sqrt(num/den);
67
b2(j)=estb;
end
%LOCAL METHOD
b2=b2;
mb2=mean(b2);sdb2=std(b2);b2z=(b2-mb2)/sdb2;
rbb2=mean(b2z.^3);b2b2=mean(b2z.^4);
%bias
bb2=b2-b; mbb2=mean(bb2);
%mean square error
mseb2=sdb2^2+ mbb2^2;
localmoments = [mb2, sdb2,rbb2,b2b2]
locbias=[mbb2,mseb2]
%MLE METHOD
b1=b1;
mb1=mean(b1);sdb1=std(b1); b1z=(b1-mb1)/sdb1;
rbb1=mean(b1z.^3);b2b1=mean(b1z.^4);
%bias
bb1=b1-b; mbb1=mean(bb1);
%mean square error
mseb1=sdb1^2+ mbb1^2;
MLEMETHOD = [mb1,sdb1,rbb1,b2b1]
mlebias = [mbb1,mseb1]