[本週專題]R2WinBUGS: Undefined Real Result?-经管之家官网!

人大经济论坛-经管之家 收藏本站
您当前的位置> 考研考博>>

考研

>>

[本週專題]R2WinBUGS: Undefined Real Result?

[本週專題]R2WinBUGS: Undefined Real Result?

发布:Lisrelchen | 分类:考研

关于本站

人大经济论坛-经管之家:分享大学、考研、论文、会计、留学、数据、经济学、金融学、管理学、统计学、博弈论、统计年鉴、行业分析包括等相关资源。
经管之家是国内活跃的在线教育咨询平台!

经管之家新媒体交易平台

提供"微信号、微博、抖音、快手、头条、小红书、百家号、企鹅号、UC号、一点资讯"等虚拟账号交易,真正实现买卖双方的共赢。【请点击这里访问】

提供微信号、微博、抖音、快手、头条、小红书、百家号、企鹅号、UC号、一点资讯等虚拟账号交易,真正实现买卖双方的共赢。【请点击这里访问】

DearRusers,Attachedpleasereviewviewmylogfile.IamusingR2WinBUGStocallWinBUGSfromR.Afterloadingdata,model,andinitialvaluesIcalledthecommandasfollowsandgotsomeinfparametervalues.Idonotunderstandwhythisha ...
坛友互助群


扫码加入各岗位、行业、专业交流群


Dear R users,


Attached please review view my log file. I am using R2WinBUGS to call WinBUGS from R. After loading data, model, and initial values I called the command as follows and got some inf parameter values. I do not understand why this happens as the program was working fine for 5*10^5 iterations. I tried to change the seed values but of no use.

  1. res <- bugs(data = dfile, inits = list(ifile), parameters.to.save = c("beta"), model.file = mfile, working.directory = tdir, n.thin = nthin, n.chains = 1, n.iter = niterations*nthin, n.burnin = 0, DIC = F, debug = T, save.history=F)
复制代码
  1. display(log)
  2. check(C:/Documents and Settings/sbadamakis/Desktop/model_4/model_4.txt)
  3. model is syntactically correct
  4. data(C:/Documents and Settings/sbadamakis/Desktop/model_4/output1/data.txt)
  5. data loaded
  6. compile(1)
  7. model compiled
  8. inits(1,C:/Documents and Settings/sbadamakis/Desktop/model_4/output1/inits1.txt)
  9. model is initialized
  10. gen.inits()
  11. command #Bugs:gen.inits cannot be executed (is greyed out)
  12. thin.updater(1)
  13. update(0)
  14. set(beta)
  15. update(20)
  16. coda(*,C:/Documents and Settings/sbadamakis/Desktop/model_4/output1/coda)
  17. stats(*)
  18. Node statistics
  19. node mean sd MC error 2.5% median 97.5% start sample
  20. beta[1] 1.588 0.009812 0.003936 1.579 1.584 1.607 1 20
  21. beta[2] -0.04272 0.00263 0.001137 -0.04592 -0.0433 -0.03688 1 20
  22. beta[3] -0.07878 8.531E-4 2.829E-4 -0.07962 -0.07833 -0.07699 1 20
  23. beta[4] -0.3035 0.01016 0.004509 -0.3194 -0.3028 -0.2841 1 20
  24. beta[5] 1.241 0.00854 0.002739 1.228 1.242 1.258 1 20
  25. beta[6] -4.155 0.01242 0.005405 -4.174 -4.152 -4.132 1 20
  26. beta[7] 0.08322 0.001485 6.379E-4 0.08201 0.0824 0.08608 1 20
  27. beta[8] -3.001 0.009335 0.003318 -3.013 -3.004 -2.981 1 20
  28. beta[9] 0.07953 7.547E-4 3.198E-4 0.07777 0.07932 0.08035 1 20
  29. save(C:/Documents and Settings/sbadamakis/Desktop/model_4/output1/log.odc)
  30. save(C:/Documents and Settings/sbadamakis/Desktop/model_4/output1/log.txt)
  31. So far so good. After the end of the last line of the log file, WinBUGS should close and the bugs function in R should return the Markov chain values of the "beta" parameters. The problem is that it doesn't and WinBUGS stays infinitely open. This is a big problem as I have written a code in R and I want to call the bugs function several times. Do you know if there's an option in the bugs function in R to FORCE WinBUGS to close?
  32. Furthermore, some other times (the same code!!!) produces the following TRAP message
  33. undefined real result
  34. GraphStack.Node.Value [00000C9AH]
  35. .i INTEGER 6
  36. .j INTEGER 2
  37. .k INTEGER 1
  38. .node GraphStack.Node [0138C5D0H]
  39. .op INTEGER 6
  40. .p GraphNodes.Node [01544D30H]
  41. .top INTEGER 0
  42. .work ARRAY 10 OF REAL
  43. [0] REAL inf [1] REAL inf [2] REAL inf [3] REAL 1.30212336033939 [4] REAL 4.534462964264759 [5] REAL 1.769649991139459E+167 [6] REAL 1.792592453177908E-307 [7] REAL 9.94060079432588E-321 [8] REAL 5.474495960374562E+67 [9] REAL 5.257527858867595E-308
  44. MonitorsSamples.StdMonitor.Update [0000023DH]
  45. .blocks POINTER NIL
  46. .i INTEGER 1655837286
  47. .index INTEGER 7
  48. .monitor MonitorsSamples.StdMonitor [02155B50H]
  49. .numBlocks INTEGER 0
  50. .value REAL 1.0

  51. SamplesMonitors.Monitor.Update [0000091BH]
  52. .chain INTEGER 0
  53. .i INTEGER 4480
  54. .monitor SamplesMonitors.Monitor [01C0A4E0H]
  55. .size INTEGER 6780

  56. SamplesIndex.Monitor.Update [0000030CH]
  57. .chain INTEGER 0
  58. .cursor SamplesIndex.List [01AB2E30H]
  59. .monitor SamplesIndex.Monitor [01C59510H]
  60. .sampleMonitor SamplesMonitors.Monitor [01C0A4E0H]
  61. UpdaterActions.UpdateMonitors [0000011CH]
  62. .chain INTEGER 0
  63. .monitor UpdaterActions.Monitor [01C59510H]
  64. BugsCmds.Action.Step [00000BCAH]
  65. .a BugsCmds.Action [011D40C0H]
  66. .chain INTEGER 0
  67. .i INTEGER 8
  68. .j INTEGER 1000
  69. .numChains INTEGER 1

  70. BugsCmds.Action.Do [00000C58H]
  71. .a BugsCmds.Action [011D40C0H]
  72. .elapsedTime LONGINT 62EC21F162EB0384H
  73. .profileList ARRAY 2024 OF CHAR "" ...
  74. .res INTEGER 1635734111
  75. .s ARRAY 120 OF CHAR 3X ...

  76. Services.Exec [00000136H]
  77. .a Services.Action [011D40C0H]
  78. .t POINTER [62EB0384H]

  79. Services.IterateOverActions [000002F4H]
  80. .p Services.Action [011D40C0H]
  81. .t POINTER NIL
  82. .time LONGINT 300843187

  83. Services.StdHook.Step [0000034DH]
  84. .h Services.StdHook [0101E380H]
  85. HostWindows.Idle [00004A86H]
  86. .focus BOOLEAN FALSE
  87. .tick Controllers.TickMsg Fields
  88. .w HostWindows.Window NIL
  89. HostMenus.TimerTick [00003422H]
  90. .lParam INTEGER 0
  91. .ops Controllers.PollOpsMsg Fields
  92. .wParam INTEGER 1
  93. .wnd INTEGER 1770006
  94. Kernel.Try [00003A61H]
  95. .a INTEGER 1770006
  96. .b INTEGER 1
  97. .c INTEGER 0
  98. .h PROCEDURE HostMenus.TimerTick
  99. HostMenus.ApplWinHandler [00003841H]
  100. .Proc PROCEDURE NIL
  101. .hit BOOLEAN FALSE
  102. .lParam INTEGER 0
  103. .message INTEGER 275
  104. .res INTEGER 4243644
  105. .s ARRAY 256 OF SHORTCHAR "ˉB", 1X ...
  106. .w INTEGER 2147348480
  107. .wParam INTEGER 1
  108. .wnd INTEGER 1770006
  109. <system> (pc=7E418733H,fp=0022FB84H)<system> (pc=7E418815H,fp=0022FBECH)<system> (pc=7E4189CCH,fp=0022FC4CH)<system> (pc=7E4196C6H,fp=0022FC5CH) HostMenus.Loop [00003BDEH]
  110. .done BOOLEAN FALSE
  111. .f SET {0..5}
  112. .n INTEGER 0
  113. .res INTEGER 0
  114. .w HostWindows.Window NIL
  115. Kernel.Start [00002B8CH]
  116. .code PROCEDURE HostMenus.Loop
  117. Is there anyone who can explain what does this mean and how to understand trap messages? For me, it seems that the problem lies here:
  118. .work ARRAY 10 OF REAL
  119. [0] REAL inf [1] REAL inf [2] REAL inf [3] REAL 1.30212336033939 [4] REAL 4.534462964264759 [5] REAL 1.769649991139459E+167 [6] REAL 1.792592453177908E-307 [7] REAL 9.94060079432588E-321 [8] REAL 5.474495960374562E+67 [9] REAL 5.257527858867595E-308
复制代码

Notes:

  • I am running multilevel models for small area estimation and the above problems seem to appear only with the spatial random effects model. The spatial and non-spatial random effects model seems to behave properly without any problems.
  • The program was working fine for more than 500000 iterations withoud trap messages.
扫码或添加微信号:坛友素质互助


「经管之家」APP:经管人学习、答疑、交友,就上经管之家!
免流量费下载资料----在经管之家app可以下载论坛上的所有资源,并且不额外收取下载高峰期的论坛币。
涵盖所有经管领域的优秀内容----覆盖经济、管理、金融投资、计量统计、数据分析、国贸、财会等专业的学习宝库,各类资料应有尽有。
来自五湖四海的经管达人----已经有上千万的经管人来到这里,你可以找到任何学科方向、有共同话题的朋友。
经管之家(原人大经济论坛),跨越高校的围墙,带你走进经管知识的新世界。
扫描下方二维码下载并注册APP
本文关键词:

本文论坛网址:https://bbs.pinggu.org/thread-3106189-1-1.html

人气文章

1.凡人大经济论坛-经管之家转载的文章,均出自其它媒体或其他官网介绍,目的在于传递更多的信息,并不代表本站赞同其观点和其真实性负责;
2.转载的文章仅代表原创作者观点,与本站无关。其原创性以及文中陈述文字和内容未经本站证实,本站对该文以及其中全部或者部分内容、文字的真实性、完整性、及时性,不作出任何保证或承若;
3.如本站转载稿涉及版权等问题,请作者及时联系本站,我们会及时处理。
经管之家 人大经济论坛 大学 专业 手机版