Re: Help! SAS NLMIXED. The final Hessian matrix is not positive definite?
- From: vontressms@xxxxxx
- Date: Thu, 29 Nov 2007 21:10:31 -0800 (PST)
vontres...@xxxxxx wrote:
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
I spotted a couple of changes I need to make
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.1 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;
Note the minus sign in the estimate where you originallly had a plus.
I think the non-positive
definite hessian came from trying to make the variance of u2 also
depend on the covariance
of u1 and u2. T22 could increase and T12 could decrease leaving
T22^2+T12^2 constant,
but then T12 could become so negative as to voilate the requirements
of the likelihood function.
This makes the hessian become singular. I call this "parameter shear"
for lack of a better word.
The iterations are driving the parameters in opposite directions
without changing the
value of the likelihood very much, but the inversions in estimating
equations become unstable.
It is similar to the effect of collinearity in a ordinary multiple
regression problem.
The way I reparameterized the model should remove the parameter shear
in the covariance matrix.
The b variables in the non-linear model for pred could also have
parameter shear, especiallly
the ones in the exponential functions.
Mark
.
- Follow-Ups:
- Re: Help! SAS NLMIXED. The final Hessian matrix is not positive definite?
- From: sphuang via MathKB.com
- Re: Help! SAS NLMIXED. The final Hessian matrix is not positive definite?
- References:
- Help! SAS NLMIXED. The final Hessian matrix is not positive definite?
- From: sphuang via MathKB.com
- Re: Help! SAS NLMIXED. The final Hessian matrix is not positive definite?
- From: vontressms
- Help! SAS NLMIXED. The final Hessian matrix is not positive definite?
- Prev by Date: Re: Basic PCA calculations
- Next by Date: What is this Distribution Estimation Method Called?
- Previous by thread: Re: Help! SAS NLMIXED. The final Hessian matrix is not positive definite?
- Next by thread: Re: Help! SAS NLMIXED. The final Hessian matrix is not positive definite?
- Index(es):
Relevant Pages
|