楼主: 董祥桥
5634 14

[问答] 帮助改极大似然估计程序 [推广有奖]

  • 0关注
  • 0粉丝

硕士生

11%

还不是VIP/贵宾

-

威望
0
论坛币
211 个
通用积分
0
学术水平
0 点
热心指数
0 点
信用等级
0 点
经验
1819 点
帖子
124
精华
0
在线时间
112 小时
注册时间
2008-12-13
最后登录
2014-12-16

楼主
董祥桥 发表于 2010-11-12 17:34:06 |AI写论文
50论坛币
data t1;
   input a b c;
cards;
-0.070905 0.005027519 0.0140444
0.050845 0.002585214 0.007411531
0.100575 0.010115331 0.001236536
0.06686  0.00447026  0.000568351
-0.052708 0.002778133 0.007148253
0.037072 0.001374333 0.004030224
-0.020015 0.0004006   0.001629463
0.041423 0.001715865 0.001887314
0.086304 0.00744838  0.001007152
0.140626 0.019775672 0.00147544
-0.018331 0.000336026 0.012633664
0.030687 0.000941692 0.001201382
0.124745 0.015561315 0.004423454
-0.052901 0.002798516 0.015779051
-0.090776 0.008240282 0.000717258
0.027624 0.000763085 0.00700928
-0.007561 5.71687E-05 0.000618992
-0.05693  0.003241025 0.001218649
0.170772 0.029163076 0.0259241
0.121279 0.014708596 0.001224779
-0.098372 0.00967705  0.024123281
-0.033027 0.001090783 0.002134985
-0.010385 0.000107848 0.00025633
-0.076431 0.005841698 0.002181037
0.08131  0.006611316 0.012441112
0.060887 0.003707227 0.000208549
0.083806 0.007023446 0.00026264
0.034445 0.001186458 0.001218254
0.210418 0.044275735 0.015483248
-0.051767 0.002679822 0.034370487
0.033834 0.00114474  0.003663766
-0.088467 0.00782641  0.007478767
-0.047333 0.002240413 0.000846003
0.155429 0.024158174 0.020556214
-0.619211 0.383422263 0.300033565
0.041378 0.001712139 0.218188913
0.157433 0.024785149 0.006734382
-0.043362 0.001880263 0.020159316
0.043601 0.001901047 0.003781282
-0.074444 0.005541909 0.006967311
0.104807 0.010984507 0.016065461
-0.046651 0.002176316 0.011469763
-0.058805 0.003458028 7.38599E-05
0.05496  0.003020602 0.006471238
-0.006534 4.26932E-05 0.001890756
0.108267 0.011721743 0.006589635
0.012908 0.000166616 0.004546669
-0.024221 0.000586657 0.000689281
0.142243 0.020233071 0.013855132
-0.163625 0.026773141 0.046777617
0.130848 0.017121199 0.043357174
0.143595 0.020619524 8.1243E-05
0.105087 0.011043278 0.000741433
0.109205 0.011925732 8.47896E-06
-0.007209 5.19697E-05 0.00677611
-0.077586 0.006019587 0.002476461
0.042173 0.001778562 0.007171109
0.16462  0.027099744 0.007496634
-0.590714 0.34894303  0.285264726
0.107097 0.011469767 0.243470096
-0.028991 0.000840478 0.009259972
-0.010092 0.000101848 0.000178586
-0.030058 0.000903483 0.000199321
-0.209337 0.04382198  0.01607048
0.046735 0.00218416  0.032786435
0.044554 0.001985059 2.37838E-06
0.03874  0.001500788 1.69013E-05
-0.089491 0.008008639 0.008221595
0.140455 0.019727607 0.026437581
-0.060852 0.003702966 0.020262254
-0.039364 0.001549524 0.000230867
0.019689 0.000387657 0.001743628
0.023195 0.000538008 6.14602E-06
0.161164 0.025973835 0.009517722
-0.159995 0.0255984   0.051571552
-0.135024 0.018231481 0.000311775
-0.053156 0.00282556  0.003351185
-0.096371 0.00928737  0.000933768
0.274786 0.075507346 0.068878759
-0.11539  0.013314852 0.076118655
-0.03901  0.00152178  0.002916952
0.178866 0.031993046 0.023734976
-0.030499 0.000930189 0.021916852
0.01403  0.000196841 0.000991416
-0.075956 0.005769314 0.00404874
-0.0533   0.00284089  0.000256647
-0.086991 0.007567434 0.000567542
0.162977 0.026561503 0.031242001
0.066209 0.004383632 0.004682023
0.044349 0.001966834 0.00023893
-0.115409 0.013319237 0.012761309
-0.095982 0.009212544 0.000188704
0.057138 0.003264751 0.011722867
-0.217497 0.047304945 0.037712192
-0.041381 0.001712387 0.015508423
-0.112031 0.012550945 0.002495711
-0.023534 0.000553849 0.00391586
0.067287 0.00452754  0.004124227
-0.25783  0.066476309 0.052850532
0.301853 0.091115234 0.15662253
0.095239 0.009070467 0.021344672
-0.115772 0.013403156 0.022262821
0.00793  6.28849E-05 0.007651092
-0.004263 1.81732E-05 7.43346E-05
0.005078 2.57861E-05 4.36271E-05
0.078206 0.006116178 0.002673852
0.035256 0.001242986 0.000922351
-0.066054 0.004363131 0.005131858
-0.016329 0.000266636 0.001236288
0.008249 6.8046E-05  0.000302039
0.073177 0.005354873 0.002107823
0.011874 0.000140992 0.001879029
0.010715 0.000114811 6.7164E-07
0.0223   0.00049729  6.71061E-05
0.067226 0.004519335 0.001009173
-0.028959 0.000838624 0.004625777
-0.050556 0.002555909 0.000233215
-0.042183 0.001779405 3.50536E-05
0.004031 1.6249E-05  0.001067867
-0.00604  3.64816E-05 5.07125E-05
-0.013389 0.000179265 2.70039E-05
-0.028776 0.000828058 0.00011838
0.011261 0.00012681  0.000801481
0.047755 0.00228054  0.000665906
0.043962 0.001932657 7.19342E-06
-0.054824 0.003005671 0.004879337
-0.010094 0.000101889 0.001000386
-0.014108 0.000199036 8.0561E-06
-0.180367 0.032532255 0.013821028
-0.011987 0.000143688 0.014175912
0.116542 0.013582038 0.008259852
-0.035682 0.001273205 0.011586073
-0.006035 3.64212E-05 0.000439472
0.019421 0.000377175 0.000324004
0.081196 0.00659279  0.001908075
-0.079418 0.006307219 0.012898428
-0.012071 0.000145709 0.002267809
-0.014185 0.000201214 2.2345E-06
0.026351 0.000694375 0.000821584
-0.002639 6.96432E-06 0.00042021
-0.031142 0.000969824 0.000406211
-0.040372 0.001629898 4.25965E-05
0.00659  4.34281E-05 0.001102715
0.043901 0.001927298 0.000696055
0.010847 0.000117657 0.000546283
0.118321 0.013999859 0.00577533
-0.005512 3.03821E-05 0.007667306
0.054276 0.002945884 0.001787302
0.019316 0.000373108 0.000611101
-0.065741 0.004321879 0.003617347
0.013042 0.000170094 0.003103381
0.079911 0.006385768 0.002235732
0.040993 0.001680426 0.000757305
-0.013806 0.000190606 0.001501465
0.048972 0.002398257 0.001970539
0.052087 0.002713056 4.85161E-06
0.008406 7.06608E-05 0.000954015
-0.015425 0.000237931 0.000283958
-0.100012 0.0100024   0.00357748
0.026322 0.000692848 0.00798014
-0.010262 0.000105309 0.000669195
0.060052 0.003606243 0.002472029
0.010118 0.000102374 0.001246702
0.046098 0.002125026 0.00064728
0.068771 0.00472945  0.000257032
-0.089035 0.007927231 0.012451367
0.075647 0.005722469 0.013560081
-0.05113  0.002614277 0.008036204
-0.041035 0.001683871 5.09545E-05
-0.230616 0.053183739 0.017970478
-0.131509 0.017294617 0.004911099
0.029829 0.000889769 0.013014975
0.084196 0.007088966 0.001477885
0.003076 9.46178E-06 0.003290227
0.0504   0.00254016  0.00111978
0.062128 0.003859888 6.8773E-05
0.02825  0.000798063 0.000573859
;
proc print;run;
proc nlp data=t1;
   max loglik;
   parms alpha0=0,alpha1=0.8,beta=0.1,epsilon=0.5,delta=1;
   bounds epsilon>0,delta>0;
   loglik= -(log(alpha0+alpha1*b**2+beta*c**2)+log(delta)+(1+1/epsilon)*log(1+epsilon*a/delta));
run;

关键词:极大似然估计 极大似然 似然估计 Bounds Delta 程序 极大似然估计

回帖推荐

jingju11 发表于4楼  查看完整内容

2# 董祥桥 Hey, I would specify the convergence criteria explictly and push SAS to overcome some ‘bumps’ or ‘broken points’ or something alike. JingJu

本帖被以下文库推荐

经济数学

沙发
董祥桥 发表于 2010-11-12 17:34:48
2125  data t1;
2126     input a b c;
2127  cards;

NOTE: 数据集 WORK.T1 有 177 个观测和 3 个变量。
NOTE: “DATA 语句”所用时间(总处理时间):
      实际时间          0.01 秒
      CPU 时间          0.01 秒


2305  ;
2306  proc print;run;

NOTE: 有 177 个从数据集 WORK.T1 读取的观测。
NOTE: “PROCEDURE PRINT”所用时间(总处理时间):
      实际时间          0.00 秒
      CPU 时间          0.00 秒


2307  proc nlp data=t1;
2308     max loglik;
2309     parms alpha0=0,alpha1=0.8,beta=0.1,epsilon=0.5,delta=1;
2310     bounds epsilon>0,delta>0;
2311     loglik= -(log(alpha0+alpha1*b**2+beta*c**2)+log(delta)+(1+1/epsilon)*log(1+epsilon*a/delta));
2312  run;

NOTE: Your code contains 1 program statements.
NOTE: Gradient is computed using analytic formulas.
NOTE: Hessian is computed using analytic formulas.
NOTE: The Hessian matrix is sparse.
WARNING: Your program statements cannot be executed completely.
WARNING: Your program statements cannot be executed completely.
WARNING: Your program statements cannot be executed completely.
WARNING: Your program statements cannot be executed completely.
WARNING: Your program statements cannot be executed completely.
WARNING: Your program statements cannot be executed completely.
WARNING: Your program statements cannot be executed completely.
WARNING: Your program statements cannot be executed completely.
WARNING: Your program statements cannot be executed completely.
WARNING: Your program statements cannot be executed completely.
WARNING: Your program statements cannot be executed completely.
WARNING: Your program statements cannot be executed completely.
WARNING: Your program statements cannot be executed completely.
WARNING: Your program statements cannot be executed completely.
WARNING: Your program statements cannot be executed completely.
WARNING: Your program statements cannot be executed completely.
WARNING: Your program statements cannot be executed completely.
WARNING: Your program statements cannot be executed completely.
WARNING: Your program statements cannot be executed completely.
WARNING: Your program statements cannot be executed completely.
WARNING: Your program statements cannot be executed completely.
WARNING: Your program statements cannot be executed completely.
WARNING: Your program statements cannot be executed completely.
ERROR: NRRIDG Optimization cannot be completed.
ERROR: NRRIDG needs more than 50 iterations or 125 function calls.
WARNING: In a total of 23 calls an error occurred during execution of the program statements. NLP attempted to recover by
         using a shorter step size.
NOTE: 有 177 个从数据集 WORK.T1 读取的观测。
NOTE: “PROCEDURE NLP”所用时间(总处理时间):
      实际时间          0.23 秒
      CPU 时间          0.21 秒
经济数学

藤椅
董祥桥 发表于 2010-11-12 17:35:24
小弟,菜鸟一个。请大侠帮助。请联系QQ:328855797
经济数学

板凳
jingju11 发表于 2010-11-12 23:25:23
2# 董祥桥

Hey,
I would specify the convergence criteria explictly and push SAS to overcome some ‘bumps’ or ‘broken points’ or something alike.
JingJu

  1. proc nlp data=t1 absconv=1E-15
  2.            absfconv=1E-15 absgconv=1E-15 absxconv=1E-15;
  3. ...
复制代码

报纸
jingju11 发表于 2010-11-12 23:39:33
重复了。京剧

地板
董祥桥 发表于 2010-11-13 13:58:52
什么东东?
经济数学

7
董祥桥 发表于 2010-11-13 14:07:31
高手能否解释一下。我的问题在哪里?
多谢了!
经济数学

8
董祥桥 发表于 2010-11-13 14:18:13
哪个是我的参数估计结果?请高手说的详细一点!
PROC NLP: Nonlinear Maximization

                                                      Optimization Start
                                                      Parameter Estimates
                                                              Gradient           Lower           Upper
                                                             Objective           Bound           Bound
                          N Parameter         Estimate        Function      Constraint      Constraint

                          1 alpha0                   0     -4119760879               .               .
                          2 alpha1            0.800000     -149.273974               .               .
                          3 beta              0.100000     -575.808205               .               .
                          4 epsilon           0.500000        2.158895               0               .
                          5 delta             1.000000     -178.354030               0               .

                                          Value of Objective Function = 2048.9362591
Newton-Raphson Ridge Optimization

                                                   Without Parameter Scaling

                                           Parameter Estimates                    5
                                           Functions (Observations)             177
                                           Lower Bounds                           2
                                           Upper Bounds                           0

                                                      Optimization Start

         Active Constraints                                  0  Objective Function                       2048.9362591
         Max Abs Gradient Element                   4119760879



                                                     Optimization Results

         Iterations                                          0  Function Calls                                      2
         Hessian Calls                                       1  Active Constraints                                  0
         Objective Function                       2048.9362591  Max Abs Gradient Element                   4119760879
         Ridge                                               0  Actual Over Pred Change                             0

              ABSCONV convergence criterion satisfied.

NOTE: At least one element of the (projected) gradient is greater than 1e-3.
经济数学

9
董祥桥 发表于 2010-11-15 08:40:34
高手帮帮忙啊!
经济数学

10
shmilyqiu 在职认证  发表于 2010-12-7 00:21:28
没必要给参数设初值吧,去掉初值试试

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

本版微信群
加好友,备注cda
拉您进交流群
GMT+8, 2025-12-5 23:12