Dear WinBugs list,
I am running a fairly complicated (at least to me!) hierarchical model
that is syntatically correct, compiles, and runs for anywhere from 20-120
iterations, but then will always result in Trap 20 (error copied below).
Is there a way to get any information from this Trap message to isolate
the problem? I thought the trap might be due to the dlnorm error
distribution, or the power functions. I tried using a dnorm with and
without a log scale and using restricted priors on parameters in the power
function, but I still get the same trap.
Perhaps the code is a bit too complicated or convoluted to explain here,
but if anyone can see any obvious errors or has any suggestions (how to
interpret the Trap message?), I would very much appreciate your input! I
ran out of ideas!
Regards,
Sabrina
Model:
model {
for(i in 1:nmortobs) {
preddt[i] <- pow(pow(d[i], OMB) + alpha[spobs[i]]*OMB*gt[i],
InvOMB) + a0[spobs[i], gsobs[i]]
meanlog[i] <- log(preddt[i]) - 1/(2*taugr[spobs[i]])
dt[i] ~ dlnorm(meanlog[i], taugr[spobs[i]])
# dt[i] ~ dnorm(preddt[i], taugr[spobs[i]])
theta_dt[i] <- preddt[i] - dt[i]
predgr[i] <- alpha[spobs[i]]*pow(d[i]-a0[spobs[i], gsobs[i]],
beta)
Igr[i] <- alpha[spobs[i]]*pow(d[i]-a0[spobs[i], gsobs[i]] -
theta_dt[i], beta)
theta_gr[i] <- predgr[i] - Igr[i]
mortobs[i] ~ dbern(pt[i])
pt[i] <- 1-pow(s[i], t[i])
logit(s[i]) <- b[1,spobs[i]]*theta_gr[i] + b[2,spobs[i]]*d[i] + mu0
[spobs[i]] + b0[spobs[i], gsobs[i]]
}
for (i in 1:nsp) {
b[1,i] ~ dnorm(0, 0.00001)
b[2,i] ~ dnorm(0, 0.00001)
mu0[i] ~ dnorm(0, 0.00001)
alpha[i] ~ dnorm(0, 0.00001)
taugr[i] <-1/(taugr_sigma[i]*taugr_sigma[i])
taugr_sigma[i] ~ dunif(0.0001,1000)
for (j in 1:ngs){
a0[i,j]~dnorm(0,taua0)
meanb0[i,j] <- regcoef*a0[i,j]
b0[i,j]~dnorm(meanb0[i,j], condprec)
}
}
OMB <- 1-beta
InvOMB <- 1/(1-beta)
beta ~ dnorm(0, 0.00001)
taub0 <-1/(taub0_sigma*taub0_sigma)
taub0_sigma ~ dunif(0.0001,1000)
taua0 <-1/(taua0_sigma*taua0_sigma)
taua0_sigma ~ dunif(0.0001,1000)
rho ~ dunif(-1,1)
condvar <- taub0_sigma*taub0_sigma*(1-rho*rho)
condprec <- 1/condvar
regcoef <- rho* taub0_sigma/taua0_sigma
}
Trap message:
TRAP 20 (precondition violated)
Math.Power [000001D5H]
.x REAL -0.07282187974207233
.y REAL 0.8568073935035582
MathSpecfunc.Power [000008C1H]
.absY REAL 0.8568073935035582
.n INTEGER 0
.power REAL 21.01878864413765
.x REAL -0.07282187974207233
.y REAL 0.8568073935035582
GraphStack.Node.Value [00000F97H]
.i INTEGER 7
.j INTEGER 4
.k INTEGER 1
.node GraphStack.Node [010C86A0H]
.op INTEGER 21
.p GraphNodes.Node [036AEB30H]
.top INTEGER 1
.work ARRAY 10 OF REAL Elements
GraphStack.Node.Value [00000B7DH]
.i INTEGER 1
.j INTEGER 2
.k INTEGER 0
.node GraphStack.Node [01328150H]
.op INTEGER 0
.p GraphNodes.Node [010C86A0H]
.top INTEGER 1
.work ARRAY 10 OF REAL Elements
GraphStack.Node.Value [00000B7DH]
.i INTEGER 1
.j INTEGER 2
.k INTEGER 0
.node GraphStack.Node [02622F50H]
.op INTEGER 0
.p GraphNodes.Node [01328150H]
.top INTEGER 1
.work ARRAY 10 OF REAL Elements
GraphLogit.Node.Value [00000089H]
.node GraphLogit.Node [02EEF3D0H]
.predictor GraphNodes.Node [02622F50H]
.value REAL 5.25484247514655E-308
.x REAL 8.221727400798132E-315
GraphStack.Node.Value [00000B7DH]
.i INTEGER 1
.j INTEGER 1
.k INTEGER 1
.node GraphStack.Node [01291E50H]
.op INTEGER 0
.p GraphNodes.Node [02EEF3D0H]
.top INTEGER 1
.work ARRAY 10 OF REAL Elements
GraphNodes.Node.LogitLogQ [000000BCH]
.logQ REAL -1.0E+10
.logit REAL 1.0E+10
.node GraphNodes.Node [01291E50H]
.x REAL 0.0
GraphBern.Node.Likelihood [000001F5H]
.logQ REAL -1.0E+10
.logit REAL 1.0E+10
.node GraphBern.Node [036FD9C0H]
.x REAL 1.0
GraphStochastic.Node.Conditional [000004BCH]
.likelihood GraphStochastic.List [019FE410H]
.log REAL -5.762925076827327E-8
.node GraphStochastic.Node [036C2E40H]
UpdaterMetnormal.Updater.MCMC [000001B8H]
.alpha REAL 0.02029609680175781
.newDen REAL -10000000050.99366
.newVal REAL 0.107358512255222
.oldDen REAL -1.0E+10
.oldVal REAL 0.09535030465730195
.overRelax BOOLEAN FALSE
.prior GraphStochastic.Node [036C2E40H]
.rate REAL 1.704436166354778E+169
.res INTEGER 0
.updater UpdaterMetnormal.Updater [01A44D00H]
BugsUpdaters.Updater.MCMC [000005B8H]
.chain INTEGER 0
.depth INTEGER 1
.i INTEGER 8
.name BugsNames.Name [010E36B0H]
.ok BOOLEAN TRUE
.overRelax BOOLEAN FALSE
.res INTEGER 0
.size INTEGER 43
.string ARRAY 120 OF CHAR 7CC8X, 0BFE4X, 13DBX, 5F9BX,
6746X, 4035X, 337DX, 56C2X, 6AF7X, 3FEBX, 33EX ...
.updater BugsUpdaters.Updater [0107DEB0H]
BugsSampler.MCMC [0000036DH]
.chain INTEGER 0
.cursor BugsSampler.List [010857D0H]
.depth INTEGER 1
.depth0 INTEGER 1
.depth1 INTEGER 4
.offset INTEGER 2287500
.ok BOOLEAN TRUE
.overRelax BOOLEAN FALSE
.updater BugsUpdaters.Updater [0107DEB0H]
BugsCmds.Action.Step [00000B1FH]
.a BugsCmds.Action [011E69E0H]
.chain INTEGER 0
.i INTEGER 1
.j INTEGER 0
.numChains INTEGER 1
BugsCmds.Action.Do [00000C58H]
.a BugsCmds.Action [011E69E0H]
.elapsedTime LONGINT 635221F163510384H
.profileList ARRAY 2024 OF CHAR "" ...
.res INTEGER 1637175903
.s ARRAY 120 OF CHAR "" ...
Services.Exec [00000136H]
.a Services.Action [011E69E0H]
.t POINTER [63510384H]
Services.IterateOverActions [000002F4H]
.p Services.Action [011E69E0H]
.t POINTER NIL
.time LONGINT 16430328
Services.StdHook.Step [0000034DH]
.h Services.StdHook [0108E380H]
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 655656
Kernel.Try [00003A61H]
.a INTEGER 655656
.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 0
.s ARRAY 256 OF SHORTCHAR 1X ...
.w INTEGER 7
.wParam INTEGER 1
.wnd INTEGER 655656
<system> (pc=77D48733H, fp=0022FB84H)
<system> (pc=77D48815H, fp=0022FBECH)
<system> (pc=77D489CCH, fp=0022FC4CH)
<system> (pc=77D496C6H, fp=0022FC5CH)
HostMenus.Loop [00003BDEH]
.done BOOLEAN FALSE
.f SET {0..5}
.n INTEGER 5
.res INTEGER 0
.w HostWindows.Window NIL
Kernel.Start [00002B8CH]
.code PROCEDURE HostMenus.Loop
-------------------------------------------------------------------
This list is for discussion of modelling issues and the BUGS software.
For help with crashes and error messages, first mail [log in to unmask]
To mail the BUGS list, mail to [log in to unmask]
Before mailing, please check the archive at www.jiscmail.ac.uk/lists/bugs.html
Please do not mail attachments to the list.
To leave the BUGS list, send LEAVE BUGS to [log in to unmask]
If this fails, mail [log in to unmask], NOT the whole list
|