全部版块 我的主页
论坛 数据科学与人工智能 数据分析与数据科学 SAS专版
3139 2
2009-04-06

下面的程序:

proc iml;
reset deflib=resdat;
start F_BETTS(x);/*定义似然函数模块*/
use resdat.agarch;
read all var{r} into r;
read all var{v} into v;
read all var{lagr} into lagr;
read all var{lagv} into lagv;
read all var{dr} into dr;
read all var{dv} into dv;
c1=14.309529;c2=-0.010198;c3=-0.004288;c4=-0.001506;
sumx1=sum((x[1]**2*dr-dv)##2/(x[6]**2*lagr-lagv));
sumx2=sum(1/(x[6]**2*lagr-lagv));
sumx3=sum((x[6]**2*r-v)/(x[6]**2*lagr-lagv));
deltax=365/(x[6]##2-x[3]##2)#sumx1+x[1]##2#(1/365)#(x[6]##2-x[3]##2)#sumx2
       +x[2]##2/(365#(x[6]##2-x[3]##2))#(x[6]##2#c1-c2)-2#x[1]#x[2]#655/365
    -2#x[1]#sumx3+2#x[1]#655+2#x[2]#(x[6]##2#c3-c4)/(x[6]##2-x[3]##2);

f=deltax;
return(f);
finish F_BETTS;
con={-1 -1 -1 -1 -1 -1,1 1 1 1 1 1};
x={0 0 0 0 0 0};
optn={1 3};
call nlpnra(rc,xres,"F_BETTS",x,optn,con);
store xres;
quit;

是对f函数进行最大化,求出待估参数向量x,

可是运行的时候出现错误:

WARNING: Division by zero, result set to missing value.

 operation : / at line 1242 column 17
 operands  : _TEM1001, _TEM1006

_TEM1001      1 row       1 col     (numeric)

 -69.94136

_TEM1006      1 row       1 col     (numeric)

         0

 statement : ASSIGN at line 1242 column 1
 traceback : module F_BETTS at line 1242 column 1

ERROR: Execution error as noted previously. (rc=100)

 operation : NLPNRA at line 1249 column 1
 operands  : *LIT1031, X, OPTN, CON

*LIT1031      1 row       1 col     (character, size 7)

 F_BETTS

X      1 row       6 cols    (numeric)

         0         0         0         0         0         0

OPTN      1 row       2 cols    (numeric)

         1         3

CON      2 rows      6 cols    (numeric)

        -1        -1        -1        -1        -1        -1
         1         1         1         1         1         1

 statement : CALL at line 1249 column 1
1250  store xres;
NOTE: Opening storage library RESDAT.IMLSTOR
ERROR: Matrix XRES has not been set to a value.

 statement : STORE at line 1250 column 1
1251  quit;
NOTE: Exiting IML.
NOTE: Storage library RESDAT.IMLSTOR closed.
NOTE: SAS 系统由于错误而停止了该步的处理。
NOTE: PROCEDURE IML 所用时间(总处理时间):
      实际时间         0.01 秒
      CPU 时间         0.01 秒

Rc100是什么意思?不懂啊。。。

请教高手,谢谢了先!

[此贴子已经被作者于2009-4-6 12:15:29编辑过]

二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

全部回复
2009-4-6 12:09:00
不好意思啊,这个我也不熟悉哦!
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

2009-4-6 12:12:00
还是要谢谢你!
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

相关推荐
栏目导航
热门文章
推荐文章

说点什么

分享

扫码加好友,拉您进群
各岗位、行业、专业交流群