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

这是我分段回归的程序:

data zhao.caishiliang;
input t y;
cards;
4 0.662185493
8 0.624535394
16 0.504561447
24 0.488698195
36 0.446552798
48 0.373373533
72 0.305951679
;
run;
proc nlin data=zhao.caishiliang best= 10 method=marquardt;
parms b=0 to 1  c=0 to 1  k=0 to 1   l=0 to 20;
if 0<t<=l then model y=b+c;
else model y=c+b*exp(-k*(t-l));
bounds b<=1;
run;

这是结果:

                                      The SAS System          21:06 Saturday, March 31, 2009  15

                                          The NLIN Procedure

                                                   Approx
                     Parameter      Estimate    Std Error    Approximate 95% Confidence Limits

                     b                0.4173       0.0621      0.2450      0.5897
                     c                0.2479       0.0687      0.0571      0.4386
                     k                0.0268      0.00923     0.00115      0.0524
                     l                3.0885       Infty      -Infty       Infty


                                   Approximate Correlation Matrix
                                  b               c               k               l

                  b       1.0000000      -0.9520182      -0.8455277               .
                  c      -0.9520182       1.0000000       0.9517262               .
                  k      -0.8455277       0.9517262       1.0000000               .
                  l        .               .               .                      .
其中L出现了infty,哪位朋友能告诉我问题出现在哪块?谢谢

二维码

扫码加我 拉你入群

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

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

全部回复
2009-3-31 23:39:00

改变你method就可以了,你选用的方法和best决定你的结果,你用的logistic模型,在t比较小是用线形模型

我用METHOD=NEWTON

data caishiliang;
input t y;
cards;
4 0.662185493
8 0.624535394
16 0.504561447
24 0.488698195
36 0.446552798
48 0.373373533
72 0.305951679
;
run;
proc nlin data=caishiliang  METHOD=NEWTON;
parms b=1 c=0  k=0   l=0;
bounds b<=1;
if 0<t<=l then model y=b+c;
else model y=c+b*exp(-k*(t-l));

run;

data caishiliang;
input t y;
cards;
4 0.662185493
8 0.624535394
16 0.504561447
24 0.488698195
36 0.446552798
48 0.373373533
72 0.305951679
;
run;
proc nlin data=caishiliang METHOD=NEWTON ;
parms b=0  c =0  k=0   l=10;
bounds b<=1;
if 0<t<=l then  a=b+c;
else a=c+b*exp(-k*(t-l));
model y=a;
run;

二维码

扫码加我 拉你入群

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

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

2009-4-1 00:30:00

谢谢楼上朋友的回复!用了你的方法以后我得到了下面的结果:

                               The SAS System          21:06 Saturday, March 31, 2009  27

                                          The NLIN Procedure

                                                   Approx
                     Parameter      Estimate    Std Error    Approximate 95% Confidence Limits

                     b               -1.7331       0.9168     -4.6508      1.1846
                     c                4.8009       1.6111     -0.3263      9.9281
                     k              -0.00116     0.000364    -0.00231    1.606E-6
                     l                -759.0        476.6     -2275.8       757.8


                                   Approximate Correlation Matrix
                                  b               c               k               l

                  b       1.0000000      -0.5079101      -0.5948221      -0.3060089
                  c      -0.5079101       1.0000000       0.8538859      -0.6350818
                  k      -0.5948221       0.8538859       1.0000000      -0.5287974
                  l      -0.3060089      -0.6350818      -0.5287974       1.0000000
然而实际中,我需要要求0=<b<=1,0=<c<=1,b+c<=1,l>=0和k>0,不知道怎么修改上面的程序,希望再能给指点一下,非常感谢!另外非常不好意思,上面的数据贴错了,应该是:

data zhao.caishiliang;
input t y;
cards;
4  0.982543298
8  0.918799023
16  0.843965669
24  0.782620304
36  0.757086534
48  0.636968654
72  0.533293707
;

[此贴子已经被作者于2009-4-1 11:15:00编辑过]

二维码

扫码加我 拉你入群

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

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

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

说点什么

分享

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