I am trying to calculate the MLE of a 3-parameter Gumbell. The vector f[1], f[2], f[3] are partial derivative equations with respect to the three parameters delta, omega, and tau. I have attached the paper on the 3-parameter Gumbell. The data set extra consists of a 1X73 vector of continuous values that represent a distribution that I am trying to fit with the Gumbell. Error messages indicate that matrices somewhere are not conformable for multiplications, but I do not see how to fix the problem. Creating sumfactor variables was my attempt, but that did not work. proc iml; use extra; read all var{extra} into x; start Fun(var) global(x,omega,tau,delta); delta = var[1]; omega= var[2]; tau = var[3]; n=73; w=exp(-(x - omega)/tau); u=exp(omega/tau); p=1 - (1 -delta)*(1 - exp(w) + exp(-u)); factor1= (x - omega)*(exp(-w))*w + omega*(exp(-u))*u ; sumfactor1=sum(factor1); q=-(2*(1 - delta)*sumfactor1)/(tau*tau*p); f = j(1, 3, .); factor2=( ( 1 - exp(w) + exp(-u) ) /p ) ; sumfactor2=sum(factor2); f[1] = n/delta -2*sumfactor2; factor3=(1 -w); sumfactor3=sum(factor3); factor4= exp(-w)*w - u*exp(-u) ; sumfactor4=sum(factor4); f[2] = (1/tau)*sumfactor3 +2*(1 - delta)*sumfactor4/(p*tau);; factor5=x - omega; sumfactor5=sum(factor5); f[3] = (-n/tau) + (1/(tau*tau))*sumfactor5*(1 - w) + q; return (f); finish; blc=j(1,3,.); con = {1e-6 1e-6 1e-6, . . .}; x0 = {0.2 1.3 0.2}; optn = {3 1}; call nlphqn(rc, Soln, "Fun", x0, optn, blc=con); /* or use NLPLM or nlphqn*/ print Soln; run;
... View more