Dear all,
I tried to implement a ODEs population model with OpenBUGS. The model is a simple PK model, a mono-compartmental model with IV administration of a single dose D, and I also consider 10 different subjects (each of one with 10 measures).
The problem is that even if the model is syntactically correct, using a ODE instruction into a cycle gives us the following problem "multiple definition of node t", where t is the internal time computed by the ode itself.
You will find in attachment the code used, that contrariwise works for WinBUGS.
My questions are: is it possible to implement a ODEs population models with OpenBUGS? How I can do that? There is something wrong in the code?
I also tried to use an external solver, BlackBox, in order to write the ODEs using Pascal code, but I found difficulties in hooking up BlackBox with OpenBUGS. I tried with 3 different versions of BlackBox (1.5, 1.6 and 1.7), but none of them works.
Furthermore, BlackBox is available only for windows, but my aim is to use OpenBUGS under Linux distributions. How can I do in this case?
Thank you in advance for your help.
# Population scenario with ODE function
# All parameters indipendent
MODEL
model{
#Prior
lmuV<-log(muV)
lVpop~dnorm(lmuV, tauV)
Vpop<-exp(lVpop)
lmuk<-log(muk)
lkpop~dnorm(lmuk,tauk)
kpop<-exp(lkpop)
Tpop~dgamma(a,b)
lTpop<-log(Tpop)
TVpop~dgamma(aV,bV)
Tkpop~dgamma(ak,bk)
Ttpop~dgamma(at,bt)
# Initial conditions: must be outside the cycle if it is equal for every subject
init[1]<-D
# Stochastic model:
for(j in 1:jend){
#PBPK system equations specified via BUGS language:
# Notation:
# init: initial condition (must be a vector of dimension dim)
# grid: vector of times of length n.grid
# dim: n∞ of differential equations
# D(Q[1:dim],t): system of differential equations
# origin: initial time
# tol: tolerance, level of accuracy of the ODE solver
q[ j,1:n.grid, 1:dim] <- ode(init[1:dim], times[1:n.grid], D(Q[j,1:dim], t), origin, tol)
D(Q[j,1],t) <- -k[j]*Q[j,1]
#first loop to scan subjects
#distribution of k of the j-subject
lk[j]~dnorm(lkpop, Tkpop)
k[j]<-exp(lk[j])
#distribution of V of the j-subject
lV[j]~dnorm(lVpop,TVpop)
V[j]<-exp(lV[j])
#distribution of taue of the j-subject
ltaue[j]~dnorm(lTpop, Ttpop)
taue[j]<-exp(ltaue[j])
for(i in 1: iend){
#second loop for the observations of each person
c[j,i,1]<-q[j,i,1]/V[j]
z[j,i]~dnorm(c[j,i,1],taue[j])
}
}
}
DATA
list(
D=100,
n.grid= 10,
dim=1,
origin=0,
tol=1.0E-3,
muV=5,
tauk=1,
muk=2.2,
tauV=1,
aV=1.1,
bV=3,
ak=1.1,
bk=3,
at=1.1,
bt=3,
a=1.1 ,
b=3 ,
z= structure(.Data=c(95.719019,41.284503,15.399770,9.144803,12.134988,-1.014545,-0.300253,4.884110,4.869009,1.956612,94.574159,36.000342,11.372104,8.406989,2.639308,0.225075,1.512044,3.983669,1.585148,0.779055,100.969180,45.860146,14.786681,14.189449,2.215092,0.275488,-2.877688,-2.771287,-3.494065,1.363900,94.914656,25.519021,13.971814,7.467718,5.481527,-4.590310,-3.896852,3.537963,-0.432175,2.388382,112.187999,54.312136,14.467266,3.605215,-2.147343,1.638322,-1.807269,5.928149,-6.013388,-7.319291,93.798114,38.310986,9.202709,6.113335,5.489114,1.756820,-6.781021,-1.864557,-1.073683,6.816693,89.042034,37.399396,22.423126,13.361799,6.022014,3.329522,-2.103544,3.489108,-3.571924,2.570723,100.459187,41.813368,11.847499,6.661186,8.568834,1.381524,-0.818548,1.913166,-1.004828,1.736036,106.618317,43.785626,24.231272,-1.187391,1.135161,2.222668,-2.945884,-5.075348,2.647047,2.577027,96.093612,39.571312,13.747737,7.891532,11.525570,-0.687947,2.863775,-3.668391,5.064746,-3.579033), .Dim=c(10, 10) ),
iend=10,
jend=10,
times=c(0.000000,0.400000,0.800000,1.200000,1.600000,2.000000,2.400000,2.800000,3.200000,3.600000))
-------------------------------------------------------------------
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
|