Re: Help! SAS NLMIXED. The final Hessian matrix is not positive definite?



On Nov 28, 2:03 pm, "sphuang via MathKB.com" <u39394@uwe> wrote:
Hi, there,
I am currently running sas PROC NLMIXED to analyze my data. My sample are 27
animals. Their running speed were reperatedly measured at 9 temperature
treatments. The running speed is tested whether it can be predicted by
temperatues using a logistic-expotential function. Therefore, the function I
wrote in SAS code is an logistic-expotential.
My sas code is listed as following text(A). The problem I faced is that there
is a warning in log page, which is as following text(B). Could anyone give me
any suggestion to patch it on? any suggestions would be highly appreciated.
many many thanks.

Shu-Ping

text(A), My sas code:
proc nlmixed data= sprint_30s method=firo ;
parms b1=0.04 b6=4.5 b2=0.2 b4=0.2 U1=0 U2=0 VAR=0.1 t11=0.1 t22=0 t12=0;
bounds VAR>=0;
LOW=1/(0.015+U1+b6*exp(-b2*(Temp-2))); HIGH=1-exp(b4*(Temp-43.1)+U2);
pred=b1*LOW*HIGH;
VAR1=t11*t11;
cov12=t11*t12;
VAR2=t12*t12+t22*t22;
model speed_m~normal (pred,VAR);
random U1 U2 ~normal ([0,0],[VAR1, cov12,VAR2]) subject=ID;
run;

text B:
WARNING: The final Hessian matrix is not positive definite, and therefore the
estimated
covariance matrix is not full rank and may be unreliable. The
variance of some
parameter estimates is zero or some parameters are linearly related
to other
parameters.

--
Message posted viahttp://www.mathkb.com

Shu-ping,
I have a three suggestions. First, make sure that sprint_30s is
sorted by ID. The second thing that may be causing the problem is that
your covariance matrix is odd. The statements

VAR1=t11*t11;
cov12=t11*t12;
VAR2=t12*t12+t22*t22;

show that var2 is a covarinace squared plus a variance. That is odd.
Why did you do it that way? I've never done it before, so I'm not sure
what it means. The correlation between cov12 and var2 may be the thing
that is causing the Hessian to have an eigenvalue less than or equal
to zero. I would drop the term in VAR2 and just estimate the variance
you want by

VAR1=t11*t11;
cov12=t11*t12;
VAR2=t22*t22;

estimate "variance of interest" var2+cov12;


The third thing is that you have a problem with the variable VAR. You
can get rid of the bounds statement if you model var as a standard
deviation instead, i.e.

model speed_m~normal (pred,VAR*VAR);

I have found that this stabilizes the estimation routine by reducing
the magnitude of the parameter to be estimated and then, the
deriviatives wrt to VAR are more numerically stable.

here are my revisions:

proc sort data=sprint_30s; by id;
run
proc nlmixed data= sprint_30s method=firo ;
parms b1=0.04 b6=4.5 b2=0.2 b4=0.2 U1=0 U2=0 VAR=0.1 t11=0.1
t22=0 t12=0;
LOW=1/(0.015+U1+b6*exp(-b2*(Temp-2))); HIGH=1-
exp(b4*(Temp-43.1)+U2);
pred=b1*LOW*HIGH;
model speed_m~normal (pred,var*var);
random U1 U2 ~normal ([0,0],[t11*t11,t12,t22*t22]) subject=ID;
estimate "variance of interest (VAR2) " t22*t22+t12*t12;
estimate "VAR1" t11*t11;
run;

You might be able to get rid of the firo if you use this code.
Mark
.



Relevant Pages