hi,
I use the code of model in congdon's bookapplied bayesian
modeling(2003),example 9.5
by some modification for my AFT model as follows,and you can see what I do
only is that I modify the line # z[i] < stain[i] ,I cancel it and in the
line for data input, I use z instead of stain.
Though model's checking,data's loading,as well as data's initing said ok,
when I began to update the model ,it said there were something wrong,I
donnot know how to find what's wrong with my model by the Trap window,will
you help me?
Thank you very much!!!
Jing
model {for (i in 1:n) {# model for mean
mu[i] < lambda * exp(gamma*beta*z[i])
# weibull sampling, survival and density
t[i] ~ dweib(gamma,mu[i]) I(t.cen[i],)
S[i] < exp(mu[i]*pow(t[i],gamma));
f[i] < mu[i]*gamma*pow(t[i],gamma1)*S[i]
# likelihood
Lk[i] < pow(f[i],1delta.cen[i])*pow(S[i],delta.cen[i]);
logLk[i] < log(Lk[i])
G[i] < 1/Lk[i]}
Dev < 2*sum(logLk[]);
# median survival with positive staining
t.50[1] < pow(log(2)/(lambda*exp(gamma*beta)),1/gamma)
t.50[2] < pow(log(2)/lambda,1/gamma)
#Priors
beta ~ dnorm(0,0.001)
gamma ~ dgamma(1,0.001)
# Hazard ratio under proportional hazards
HRPH < exp(beta*gamma)
b0 ~ dnorm(0,0.00001)
lambda < exp(b0)}
# Data
list(n=100,
t=c(465,776,1546,2490,3000,4241,5415,6107,7273,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,NA,
150,167,179,192,250,251,270,305,329,341,372,391,560,630,702,707,754,826,835,NA,NA,NA,NA,NA,NA,
41,44,48,51,58,69,80,83,101,105,112,129,159,161,176,181,185,190,195,NA,NA,NA,NA,NA,NA,
2,3,7,7,8,10,12,13,14,16,18,21,31,34,35,40,42,43,48,50,56,75,NA,NA,NA),
t.cen=c(0,0,0,0,0,0,0,0,0,19930,19930,19930,19930,19930,19930,19930,19930,19930,19930,19930,19930,19930,19930,19930,19930,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1097,1097,1097,1097,1097,1097,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,245,245,245,245,245,245,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,90,90,90),
# positively stained coded 2
z=c(358,358,358,358,358,358,358,358,358,358,358,358,358,358,358,358,358,358,358,358,358,358,358,358,358,
398,398,398,398,398,398,398,398,398,398,398,398,398,398,398,398,398,398,398,398,398,398,398,398,398,
423,423,423,423,423,423,423,423,423,423,423,423,423,423,423,423,423,423,423,423,423,423,423,423,423,
448,448,448,448,448,448,448,448,448,448,448,448,448,448,448,448,448,448,448,448,448,448,448,448,448),
delta.cen=c(0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1))
Inits
list(beta=0,b0=0,gamma=1)
list(beta=1,b0=1,gamma=0.6)
list(beta=2.7,b0=0,gamma=1.2)
What the trap window said are:
undefined real result
GraphWeibull.Node.Likelihood [0000033DH]
.lambda REAL inf
.logLambda REAL inf
.logLikelihood REAL 0.0
.logR REAL 7.742443863477729
.node GraphWeibull.Node [010B9100H]
.r REAL 2304.09640520599
.x REAL inf
UpdaterDFreeARS.Updater.Conditional [000000A6H]
.cond REAL 0.3960963410389164
.linearCoef REAL 0.0
.list GraphStochastic.List [01013DD0H]
.node GraphStochastic.Node [010B9100H]
.prior GraphStochastic.Node [010B7DA0H]
.quadCoef REAL 1.0E5
.updater UpdaterDFreeARS.Updater [01089150H]
.x REAL 281.4591768050622
UpdaterDFreeARS.Updater.Point [000000FEH]
.cursor GraphStochastic.List NIL
.h UpdaterDFreeARS.Hull Fields
.i INTEGER 0
.j INTEGER 2281960
.updater UpdaterDFreeARS.Updater [01089150H]
.x REAL 281.4591768050622
.y REAL 0.0
UpdaterDFreeARS.StdUpdater.InitHull [00001833H]
.dum REAL 5.341769265574418E315
.h UpdaterDFreeARS.Hull Fields
.res INTEGER 0
.updater UpdaterDFreeARS.StdUpdater [01089150H]
.x1 REAL 281.4591768050622
.x2 REAL 1.164257772131673E313
.x3 REAL 5.234929664378671E308
.x4 REAL 0.0
.xm REAL 5.311465294646351E315
.y1 REAL 0.0
.y2 REAL 0.0
.y3 REAL 0.0
.y4 REAL 0.0
.ym REAL 0.0
UpdaterDFreeARS.Updater.MCMC [00002DD7H]
.h UpdaterDFreeARS.Hull Fields
.i INTEGER 1668693535
.k INTEGER 1668612656
.oldValue REAL 281.4591768050622
.overRelax BOOLEAN FALSE
.prior GraphStochastic.Node [010B7DA0H]
.rand REAL 0.0
.res INTEGER 0
.updater UpdaterDFreeARS.Updater [01089150H]
.values POINTER NIL
BugsUpdaters.Updater.MCMC [000005B8H]
.chain INTEGER 0
.depth INTEGER 1
.i INTEGER 0
.name BugsNames.Name [01034CA0H]
.ok BOOLEAN TRUE
.overRelax BOOLEAN FALSE
.res INTEGER 0
.size INTEGER 1
.string ARRAY 120 OF CHAR "" ...
.updater BugsUpdaters.Updater [01089060H]
BugsSampler.MCMC [0000036DH]
.chain INTEGER 0
.cursor BugsSampler.List [01089D30H]
.depth INTEGER 1
.depth0 INTEGER 1
.depth1 INTEGER 2
.offset INTEGER 2287500
.ok BOOLEAN TRUE
.overRelax BOOLEAN FALSE
.updater BugsUpdaters.Updater [01089060H]
BugsCmds.Action.Step [00000B1FH]
.a BugsCmds.Action [010F2370H]
.chain INTEGER 0
.i INTEGER 1
.j INTEGER 0
.numChains INTEGER 1
BugsCmds.Action.Do [00000C58H]
.a BugsCmds.Action [010F2370H]
.elapsedTime LONGINT 632721F163260384H
.profileList ARRAY 2024 OF CHAR 0E814X, """ ...
.res INTEGER 1642746463
.s ARRAY 120 OF CHAR "" ...
Services.Exec [00000136H]
.a Services.Action [010F2370H]
.t POINTER [63260384H]
Services.IterateOverActions [000002F4H]
.p Services.Action [010F2370H]
.t POINTER NIL
.time LONGINT 49681468
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 17236592
Kernel.Try [00003A61H]
.a INTEGER 17236592
.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 "l¨²"" ...
.w INTEGER 2147348480
.wParam INTEGER 1
.wnd INTEGER 17236592
<system> (pc=77D18708H, fp=0022FB84H)
<system> (pc=77D187EAH, fp=0022FBECH)
<system> (pc=77D189A4H, fp=0022FC4CH)
<system> (pc=77D1BCCBH, 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
_________________________________________________________________
Ãâ·ÑÏÂÔØ MSN Explorer: http://explorer.msn.com/lccn/

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
