楼主: Lisrelchen
1739 1

[本週專題]WinBUGS: Undefined Real Result [推广有奖]

  • 0关注
  • 62粉丝

VIP

已卖:4194份资源

院士

67%

还不是VIP/贵宾

-

TA的文库  其他...

Bayesian NewOccidental

Spatial Data Analysis

东西方数据挖掘

威望
0
论坛币
50288 个
通用积分
83.6906
学术水平
253 点
热心指数
300 点
信用等级
208 点
经验
41518 点
帖子
3256
精华
14
在线时间
766 小时
注册时间
2006-5-4
最后登录
2022-11-6

楼主
Lisrelchen 发表于 2014-6-26 20:54:11 |AI写论文

+2 论坛币
k人 参与回答

经管之家送您一份

应届毕业生专属福利!

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

经管之家联合CDA

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

感谢您参与论坛问题回答

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

+2 论坛币
I am building a stock-recruitment hierarchical model for Atlantic cod in WinBUGS14. In this case, I'm estimating several hyperparameters across several different and exchangeable stocks. BEFORE I can do that, I must standardize across stocks because recruit age is different for each stock according to the following:

  1. Rp = Rs*exp(-(maxA-sAge)*M)
复制代码

where Rp is the predicted (number of recruits)Rs is the actual observed number of recruits for a given stock, s
maxA is the maximum age recruit that appears for ALL stocks sAge is the recruitment age for stock, M is the mortality rate for recruits.

In this case, I am ONLY interested in looking at how much M varies to determine if the standardization is appropriate to carry through to my stock-recruit model. I have a datafile and initial values for 2 chains. stockstart indicates the starting value of stock s, and stockfinish indicates the finishing value of stock s. I had to set it up this way so that all of my data is in one file. So when you see stockstart[Group]:stockfinish[Group], it simply denotes the start and finish values of stock s with the designation Group[1....12] for 12 groups. CodSR indicates the sum total of all values across 12 stocks (in this case I have 423 recruit values for 12 Groups's). NGroup indicates the total number of Groups (I'm using 12 for my model). When I run the script, I am getting an "Undefined Real Result" Trap, but I'm not sure what the problem is. Here is my code:.
  1. #S-R Standardization

  2. model
  3. {        

  4. for (i in 1:NGroup)
  5. {
  6. M~dnorm(Mo,Mprec)I(,0.000000001)
  7. tau~dnorm(mutau,tauprec)I(,0.000000001)
  8. }

  9. for (i in 1:CodSR)
  10. { #loop over all Ro-S observations for Ncod
  11. Rs~dlnorm(Rp[Group],tau[Group]) #evaluate prob. density of data
  12. Rp<-Rs[stockstart[Group]:stockfinish[Group]]*exp(-(maxA-sAge[stockstart[Group]:stockfinish[Group]])*M[Group])
  13. }
  14. Mo~dlnorm(0.3,0.1)
  15. Mprec~dgamma(0.1,0.01)
  16. mutau~dgamma(0.01,0.01)
  17. tauprec~dgamma(0.01,0.01)
  18. maxA<-4

  19. Mmu<-mean(M[]) #mean mortality of stocks
  20. sdM<-sd(M[])
  21. cvM<-sdM/Mmu #CV for mortality across stocks
  22. }
复制代码

I have attempted to change my starting values, truncate my distributions, provide less information for my prior distributions (gamma distributions), and keepe all my distributions lognormal. It seems that Nothing has worked so I'm pretty stuck at this point. Can anyone help?
二维码

扫码加我 拉你入群

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

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

关键词:Undefined winbugs Defined DEFINE WINBUG different following building because several

沙发
Lisrelchen 发表于 2014-6-26 20:55:22
At first sight it appears you have a prior problem with M values getting negative and going pretty high. Isn't M[i]~dnorm(Mo,Mprec)I(,0.000000001) supposed to be M[i]~dnorm(Mo,Mprec)I(0.000000001,).

Note that even with this correction you will have strange values for M, going super high. therefore I would try finding a more approriate specification for M priors at first. Why not constrain variance or try an uniform distribution.

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

本版微信群
加好友,备注jltj
拉您入交流群
GMT+8, 2026-1-18 11:40