I am doing a pop pk to understand the effect of different doing regimen of the drug. I have a model developed and all the dosing regimens. Can someone please help me to add weight as covariate in it and do simulation . I’m pasting my codes here.
daramdl = @model begin
@param begin
tvcl ∈ RealDomain(lower = 0, init = 0.00714)
tvvc ∈ RealDomain(lower = 0, init = 4.72)
tvvp ∈ RealDomain(lower = 0, init = 2.44)
tvq ∈ RealDomain(lower = 0, init = 0.0267)
tvvmax ∈ RealDomain(lower = 0, init = 1.1)
tvkdes ∈ RealDomain(lower = 0, init = 0.000228)
tvkm ∈ RealDomain(lower = 0, init = 2.38)
σ_add ∈ RealDomain(lower = 0, init = 32.7)
end
@pre begin
Cl = tvcl
Vc = tvvc
Vp = tvvp
Q = tvq
Vmax = tvvmax
Kdes = tvkdes
Km = tvkm
tdvm = Vmax * exp(-Kdes * t) #time-dependent maximum capacity
end
@dynamics begin
Central' = -(Cl / Vc) * Central -(tdvm / (Km + (Central / Vc))) -(Q / Vc) * Central +(Q / Vp) * Peripheral
Peripheral' = (Q / Vc) * Central -(Q / Vp) * Peripheral
end
@derived begin
cp = @. Central / Vc
dv ~ @. Normal(cp, sqrt(σ_add^2))
end
end
ev1 = DosageRegimen(16*70; time = 0, addl =7 , ii = 168, rate= 125)
ev2 = DosageRegimen(16*70; time = 168*8, addl =7 , ii = 336, rate= 125)
ev_norm = DosageRegimen(ev1, ev2)
s1 = Subject(; id=1, events= ev_norm)
Random.seed!(123)
sim_s1 = simobs(
daramdl,
s1,
init_params(daramdl),
obstimes = 0:24:168*24
)
simdf = DataFrame(sim_s1)
lines(simdf.time./ 168, simdf.cp)