有没有办法在SAS的proc物流中获得Hessian矩阵?或者哪一个可以选择计算它从离开proc procitic?
我一直在阅读函数文档,但看不出有办法将它包含在输出表中。
答案 0 :(得分:0)
我搜索了SAS博客,可能已找到一种方法可以使用proc nlp估算它。
data t1;
do i = 1 to 500;
x=rannor(3478);
y=1+2*x>rannor(3478);
output;
end;
run;
proc logistic data=t1 outest=parm covout desc;
model y=x/link=probit;
score data=t1 out=t2;
run;
proc nlp data=t1 outest=t2 PHESSIAN;
parms a=0, b=0 ;
max ll;
xbeta = a + b * x;
if y=1 then p=probnorm(xbeta);
else if y=0 then p=1-probnorm(xbeta);
ll=LOG(p);
run;
proc print data=parm(where=(_TYPE_='COV')); run;
*calculation covariance from hessian in above;
proc iml;
HESSIAN={ -143.2141617 64.771275623,
64.771275623 -64.13869603
};
HESSIAN_inv_neg=-inv(HESSIAN);
print HESSIAN ;
print HESSIAN_inv_neg;
quit;
希望这会有所帮助。
原帖在此处发布:http://comp.soft-sys.sas.narkive.com/nXdobtA5/hessian-and-scores-in-the-logistic-proc