[本週專題]R2WinBUGS: Undefined Real Result?
发布:Lisrelchen | 分类:考研
关于本站
人大经济论坛-经管之家:分享大学、考研、论文、会计、留学、数据、经济学、金融学、管理学、统计学、博弈论、统计年鉴、行业分析包括等相关资源。
经管之家是国内活跃的在线教育咨询平台!
经管之家新媒体交易平台
提供"微信号、微博、抖音、快手、头条、小红书、百家号、企鹅号、UC号、一点资讯"等虚拟账号交易,真正实现买卖双方的共赢。【请点击这里访问】
期刊
- 期刊库 | 马上cssci就要更新 ...
- 期刊库 | 【独家发布】《财 ...
- 期刊库 | 【独家发布】“我 ...
- 期刊库 | 【独家发布】“我 ...
- 期刊库 | 【独家发布】国家 ...
- 期刊库 | 请问Management S ...
- 期刊库 | 英文期刊库
- 核心期刊 | 歧路彷徨:核心期 ...
TOP热门关键词
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.
- 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)
- display(log)
- check(C:/Documents and Settings/sbadamakis/Desktop/model_4/model_4.txt)
- model is syntactically correct
- data(C:/Documents and Settings/sbadamakis/Desktop/model_4/output1/data.txt)
- data loaded
- compile(1)
- model compiled
- inits(1,C:/Documents and Settings/sbadamakis/Desktop/model_4/output1/inits1.txt)
- model is initialized
- gen.inits()
- command #Bugs:gen.inits cannot be executed (is greyed out)
- thin.updater(1)
- update(0)
- set(beta)
- update(20)
- coda(*,C:/Documents and Settings/sbadamakis/Desktop/model_4/output1/coda)
- stats(*)
- Node statistics
- node mean sd MC error 2.5% median 97.5% start sample
- beta[1] 1.588 0.009812 0.003936 1.579 1.584 1.607 1 20
- beta[2] -0.04272 0.00263 0.001137 -0.04592 -0.0433 -0.03688 1 20
- beta[3] -0.07878 8.531E-4 2.829E-4 -0.07962 -0.07833 -0.07699 1 20
- beta[4] -0.3035 0.01016 0.004509 -0.3194 -0.3028 -0.2841 1 20
- beta[5] 1.241 0.00854 0.002739 1.228 1.242 1.258 1 20
- beta[6] -4.155 0.01242 0.005405 -4.174 -4.152 -4.132 1 20
- beta[7] 0.08322 0.001485 6.379E-4 0.08201 0.0824 0.08608 1 20
- beta[8] -3.001 0.009335 0.003318 -3.013 -3.004 -2.981 1 20
- beta[9] 0.07953 7.547E-4 3.198E-4 0.07777 0.07932 0.08035 1 20
- save(C:/Documents and Settings/sbadamakis/Desktop/model_4/output1/log.odc)
- save(C:/Documents and Settings/sbadamakis/Desktop/model_4/output1/log.txt)
- 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?
- Furthermore, some other times (the same code!!!) produces the following TRAP message
- undefined real result
- GraphStack.Node.Value [00000C9AH]
- .i INTEGER 6
- .j INTEGER 2
- .k INTEGER 1
- .node GraphStack.Node [0138C5D0H]
- .op INTEGER 6
- .p GraphNodes.Node [01544D30H]
- .top INTEGER 0
- .work ARRAY 10 OF REAL
- [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
- MonitorsSamples.StdMonitor.Update [0000023DH]
- .blocks POINTER NIL
- .i INTEGER 1655837286
- .index INTEGER 7
- .monitor MonitorsSamples.StdMonitor [02155B50H]
- .numBlocks INTEGER 0
- .value REAL 1.0
- SamplesMonitors.Monitor.Update [0000091BH]
- .chain INTEGER 0
- .i INTEGER 4480
- .monitor SamplesMonitors.Monitor [01C0A4E0H]
- .size INTEGER 6780
- SamplesIndex.Monitor.Update [0000030CH]
- .chain INTEGER 0
- .cursor SamplesIndex.List [01AB2E30H]
- .monitor SamplesIndex.Monitor [01C59510H]
- .sampleMonitor SamplesMonitors.Monitor [01C0A4E0H]
- UpdaterActions.UpdateMonitors [0000011CH]
- .chain INTEGER 0
- .monitor UpdaterActions.Monitor [01C59510H]
- BugsCmds.Action.Step [00000BCAH]
- .a BugsCmds.Action [011D40C0H]
- .chain INTEGER 0
- .i INTEGER 8
- .j INTEGER 1000
- .numChains INTEGER 1
- BugsCmds.Action.Do [00000C58H]
- .a BugsCmds.Action [011D40C0H]
- .elapsedTime LONGINT 62EC21F162EB0384H
- .profileList ARRAY 2024 OF CHAR "" ...
- .res INTEGER 1635734111
- .s ARRAY 120 OF CHAR 3X ...
- Services.Exec [00000136H]
- .a Services.Action [011D40C0H]
- .t POINTER [62EB0384H]
- Services.IterateOverActions [000002F4H]
- .p Services.Action [011D40C0H]
- .t POINTER NIL
- .time LONGINT 300843187
- Services.StdHook.Step [0000034DH]
- .h Services.StdHook [0101E380H]
- HostWindows.Idle [00004A86H]
- .focus BOOLEAN FALSE
- .tick Controllers.TickMsg Fields
- .w HostWindows.Window NIL
- HostMenus.TimerTick [00003422H]
- .lParam INTEGER 0
- .ops Controllers.PollOpsMsg Fields
- .wParam INTEGER 1
- .wnd INTEGER 1770006
- Kernel.Try [00003A61H]
- .a INTEGER 1770006
- .b INTEGER 1
- .c INTEGER 0
- .h PROCEDURE HostMenus.TimerTick
- HostMenus.ApplWinHandler [00003841H]
- .Proc PROCEDURE NIL
- .hit BOOLEAN FALSE
- .lParam INTEGER 0
- .message INTEGER 275
- .res INTEGER 4243644
- .s ARRAY 256 OF SHORTCHAR "ˉB", 1X ...
- .w INTEGER 2147348480
- .wParam INTEGER 1
- .wnd INTEGER 1770006
- <system> (pc=7E418733H,fp=0022FB84H)<system> (pc=7E418815H,fp=0022FBECH)<system> (pc=7E4189CCH,fp=0022FC4CH)<system> (pc=7E4196C6H,fp=0022FC5CH) HostMenus.Loop [00003BDEH]
- .done BOOLEAN FALSE
- .f SET {0..5}
- .n INTEGER 0
- .res INTEGER 0
- .w HostWindows.Window NIL
- Kernel.Start [00002B8CH]
- .code PROCEDURE HostMenus.Loop
- 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:
- .work ARRAY 10 OF REAL
- [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
免流量费下载资料----在经管之家app可以下载论坛上的所有资源,并且不额外收取下载高峰期的论坛币。
涵盖所有经管领域的优秀内容----覆盖经济、管理、金融投资、计量统计、数据分析、国贸、财会等专业的学习宝库,各类资料应有尽有。
来自五湖四海的经管达人----已经有上千万的经管人来到这里,你可以找到任何学科方向、有共同话题的朋友。
经管之家(原人大经济论坛),跨越高校的围墙,带你走进经管知识的新世界。
扫描下方二维码下载并注册APP
您可能感兴趣的文章
本站推荐的文章
人气文章
本文标题:[本週專題]R2WinBUGS: Undefined Real Result?
本文链接网址:https://bbs.pinggu.org/jg/kaoyankaobo_kaoyan_3106189_1.html
2.转载的文章仅代表原创作者观点,与本站无关。其原创性以及文中陈述文字和内容未经本站证实,本站对该文以及其中全部或者部分内容、文字的真实性、完整性、及时性,不作出任何保证或承若;
3.如本站转载稿涉及版权等问题,请作者及时联系本站,我们会及时处理。