楼主: jzhang04
2508 7

NLMIXED 参数初始值怎么都设不好啊?搞不出来~ [推广有奖]

  • 1关注
  • 0粉丝

高中生

32%

还不是VIP/贵宾

-

威望
0
论坛币
10 个
通用积分
0
学术水平
0 点
热心指数
0 点
信用等级
0 点
经验
686 点
帖子
28
精华
0
在线时间
18 小时
注册时间
2007-6-28
最后登录
2019-11-2

楼主
jzhang04 发表于 2011-12-16 15:53:13 |AI写论文

+2 论坛币
k人 参与回答

经管之家送您一份

应届毕业生专属福利!

求职就业群
赵安豆老师微信:zhaoandou666

经管之家联合CDA

送您一个全额奖学金名额~ !

感谢您参与论坛问题回答

经管之家送您两个论坛币!

+2 论坛币
NLMIXED 参数初始值怎么都设不好啊?
如题,修改了很多次参数初始值“   parms a=0 b=0.001; ”, 还是没有搞出来。

高手帮忙啊~

多谢!


###############################################

SAS程序如下:

data trees;
  input n_ingrow n_live n_dead year live_off yr_interval;
  cards;
1    600    116    1968    715    7
19    495    124    1979    600    11
21    480    36    1984    495    5
41    485    36    1989    480    5
24    469    40    1994    485    5
32    456    45    1999    469    5
;

proc nlmixed data=trees;
   parms a=0 b=0.001;                                                         
   eta = a + b*year;                              
   p_ann_mort = exp(eta)/(1+exp(eta));                        
   p_ann_surv = 1-p_ann_mort;                                                
   p_surv = p_ann_surv**yr_interval;                                 
   p_mort = 1-p_surv;
   mean_mort = live_off*p_mort;
   ll=lgamma(1/alpha + n_dead) - lgamma(1 + n_dead) - lgamma(1/alpha)   + n_dead*log(alpha*mean_mort) - (1/alpha + n_dead)*log(1 + alpha*mean_mort);        
         * log likelihood function for negative binomial regression ;
   model n_dead ~ general(ll);
   predict live_off*p_mort out=predobs1;
   ods output ParameterEstimates =PEs; *create an output table PEs you needed;
run;


二维码

扫码加我 拉你入群

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

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

关键词:nlmixed Mixed nlm mix 初始值 程序

沙发
jingju11 发表于 2011-12-17 10:15:18
why did not initiate alpha? jingju

藤椅
jzhang04 发表于 2011-12-17 13:36:39
jingju11 发表于 2011-12-17 10:15
why did not initiate alpha? jingju
You can change "parms a=0 b=0.001" to "parms a=0 b=0.001 alpha=0" or other values. I tried, but it still doesn't work.

板凳
jzhang04 发表于 2011-12-17 16:29:57
继续求助。。。

报纸
jzhang04 发表于 2011-12-18 12:14:24
大家帮忙啊,再顶一下~

地板
jzhang04 发表于 2011-12-19 15:18:51
还是没有搞定啊~

7
jingju11 发表于 2011-12-20 00:11:44
proc nlmixed data=trees;
   parms a=0 b=0.0001 alpha0 =-1;
   alpha =exp(alpha0);

NOTE: GCONV convergence criterion satisfied.
NOTE: At least one element of the (projected) gradient is greater than 1e-3.
NOTE: The data set WORK.PES has 3 observations and 10 variables.
NOTE: The data set WORK.PREDOBS1 has 6 observations and 14 variables.
NOTE: PROCEDURE NLMIXED used (Total process time):
      real time           0.07 seconds
      cpu time            0.06 seconds

It looks like not excellent fit yet, but we got some improvement.
JingJu

8
zzheng722 发表于 2011-12-25 11:25:50
顶一下,先用proc genmod算出一个 fixed model的系数(alpha, beta1,...) 然后带进去。如需要,我帮你写code.

您需要登录后才可以回帖 登录 | 我要注册

本版微信群
加好友,备注cda
拉您进交流群
GMT+8, 2026-1-1 05:08