Print["Obtain the MLE for GED"]
Print["    "]
Print["Mohammad Z. Raqab"]
Print["Department of Mathematics, University of Jordan"]
Print["May, 2011"]
Print["    "]
Print[bt,"      ",a1,"       ",b1]
Print["--------------------------"];
th=1;
bt=0.85;
dist=NormalDistribution[0,1];
LfG[x_,a_,b_]:=Log[2]+Log[a]+(2*Log[b])+Log[x]-((b*x)^2)+(a-1)*Log[1-Exp[-(b*x)^2]];
LW[x_,bt_,th_]:=Log[bt]+(bt*Log[th])+((bt-1)*Log[x])-(th*x)^bt;
w[x_,bt_,th_]:=bt*(th^bt)*(x^(bt-1))*Exp[-(th*x)^bt];
w1[x_,b_]:=Exp[-(b*x)^2]/(1-Exp[-(b*x)^2])^2;
U1[b_]:=NIntegrate[Log[1-Exp[-(b*x)^2]]*w[x,bt,th],{x,0,Infinity}];
U2[b_]:=NIntegrate[((x^2)*Exp[-(b*x)^2]/(1-Exp[-(b*x)^2]))*w[x,bt,th],{x,0,Infinity}];
U3[b_]:=NIntegrate[2*b*(x^4)*w1[x,b]*w[x,bt,th],{x,0,Infinity}];
f[a_,b_]:=(1/a)+U1[b];
g[a_,b_]:=(2*(th^2))-(2*(b^2))*Gamma[(2/bt)+1]+(2*(a-1))*(b^2)*U2[b];
cf[x_]:=CDF[dist,x];
fa[a_]:=(-1/(a^2));
fb[b_]:=2*b*U2[b];
ga[b_]:=2*(b^2)*U2[b];
gb[a_,b_]:=-4*b*Gamma[(2/bt)+1]-(2*(a-1)*(b^2)*U3[b])+(4*b*(a-1)*U2[b]);
a0=0.2;b0=0.3;

d0=(fa[a0]*gb[a0,b0])-(fb[b0]*ga[a0]);
f0=(gb[a0,b0]*f[a0,b0])-(fb[b0]*g[a0,b0]);
f00=(-ga[b0]*f[a0,b0])+(fa[a0]*g[a0,b0]);
a1=a0-(f0/d0);b1=b0-(f00/d0);
k=0;
While[(Abs[a1-a0]>0.00005)&&(Abs[b1-b0]>0.00005),
a0=a1;b0=b1;
d0=(fa[a0]*gb[a0,b0])-(fb[b0]*ga[b0]);
f0=(gb[a0,b0]*f[a0,b0])-(fb[b0]*g[a0,b0]);
f00=(-ga[b0]*f[a0,b0])+(fa[a0]*g[a0,b0]);
a1=a0-(f0/d0);
b1=b0-(f00/d0);
k=k+1;
];
Print[bt,"    ",a1,"     ",b1]

S