Print["Obtain the MLE for GED"]
Print["    "]
Print["Mohammad Z. Raqab"]
Print["Department of Mathematics, University of Jordan"]
Print["May, 2011"]
Print["    "]
Print[MLEalph,"    ",b1,"      ",d1,"       ",MLEthet,"     ",T]
Print["--------------------------------------------------------"]
n=28;
X={12.82,17.86,7.66,12.48,8.08,7.35,11.99,21.0,27.36,8.11,24.35,12.44,12.40,31.01,9.09,11.57,17.94,4.42,16.42,9.25,37.96,
13.19,3.21,13.53,9.08,16.36,20.20,8.69};
Xbar=Sum[X[[i]]^2,{i,1,n}]/n;
E1[b_]:=-n/Sum[Log[1-Exp[-(b*X[[i]])^2]],{i,1,n}];
E2[b_]:=Sum[(X[[i]]^2)*Exp[-(b*X[[i]])^2]/(1-Exp[-(b*X[[i]])^2]),{i,1,n}];
f[b_]:=((E1[b]-1)*(b^2))*E2[b]-(n*(b^2)*Xbar)+n;
Lf[a_,b_]:=(n*Log[2])+(n*Log[a])+(2*n*Log[b])+Sum[Log[X[[i]]],{i,1,n}]-((b^2)*Sum[X[[i]]^2,{i,1,n}])+(a-1)*(Sum[Log[1-Exp[-(b*X[[i]])^2]],{i,1,n}]);
E3[d_]:=(n/Sum[X[[i]]^d,{i,1,n}])^(1/d);
g[d_]:=(n/d)+Sum[Log[X[[i]]],{i,1,n}]-((E3[d]^d)*Sum[(X[[i]]^d)*Log[X[[i]]],{i,1,n}]);
Lg[c_,d_]:=(n*Log[d])+(n*d*Log[c])+((d-1)*Sum[Log[X[[i]]],{i,1,n}])-((c^d)*Sum[X[[i]]^d,{i,1,n}]);
b0=.05;
b1=b0-(f[b0]/f'[b0]);
k=0;
While[Abs[b1-b0]>0.00005,
b0=b1;
b1=b0-(f[b0]/f'[b0]);
k=k+1;
];
d0=1.9;
d1=d0-(g[d0]/g'[d0]);
k=0;
While[Abs[d1-d0]>0.00005,
d0=d1;
d1=d0-(g[d0]/g'[d0]);
k=k+1;
];
MLEalph=E1[b1];
MLEthet=E3[d1];
T=Lf[MLEalph,b1]-Lg[MLEthet,d1];
Print[MLEalph,"    ",b1,"      ",d1,"       ",MLEthet,"     ",T]

OX=Sort[X];
H[x_]:=Sum[OX[[i]],{i,1,Floor[n*x]}];
HH[x_]:=(H[x]+(n-Floor[n*x])*OX[[Floor[n*x]]])/H[1];
Plot[HH[Floor[x]],{x,0,1}];
Plot[HH[Round[x]], {x, 0,1}, PlotStyle -> {Red,Dashed}];
fp = Table[HH[x], {x, {0.04,0.08,.12,.16,.2,.24,.28,.32,.36,.4,.44,.48,.52,.56,.6,.64,.68,.72,.76,.8,.84,.88,.92,.96,1}}];
gp = ListPlot[fp,AxesLabel -> {"r value", TTT},PlotStyle->{Red,Dashed}]
<< PlotLegends`
fw[x_]:=1-Exp[-(0.0612*x)^1.8];
fG[x_]:=(1-Exp[-(0.0605*x)^2])^1.0128;
Plot[{fw[x],fG[x]},{x,0,40},PlotLegend-> {"WE", "GR"},PlotStyle -> {Red,{Blue,Dashed}},AxesLabel -> 
{"annual rainfall", "fitted cdf"}]

Plot[{Lf[a,0.0622],Lg[0.0609,a]},{a,0.,2.},PlotLegend-> {"GR", "WE"},PlotStyle -> {Red,{Blue,Dashed}},AxesLabel -> 
{"α(β)", "likelihood  profile"}]
Plot[{Lf[1.0839,b],Lg[b,1.9584]},{b,0.0,0.3},PlotLegend-> {"GR", "WE"},PlotStyle -> {Green,{Black,Dashed}},AxesLabel -> 
{"λ(θ)", "likelihood  profile"}]