test(){
# differential equations for the PK model
deriv(A1 = - Cl * C - Cl2 * (C - C2) - Cl3 * (C - C3))
deriv(A2 = Cl2 * (C - C2))
deriv(A3 = Cl3 * (C - C3))
# differential equation for Indirect Response model
deriv(E = Kin * (1 - Imax * C ^ gamma / (C ^ gamma + IC50 ^ gamma)) - Kout * E)
# IV dose administration
dosepoint(A1)
# concentrations in central and peripheral compartments
C = A1 / V
C2 = A2 / V2
C3 = A3 / V3
# baseline response R0
sequence{E = Kin / Kout}
# observed response and error model
error(EEps = 1)
observe(EObs = E + EEps)
# PK parameters as frozen fixed effects
fixef(V(freeze) = c(, 0.7633, ))
fixef(V2(freeze) = c(, 1.72876, ))
fixef(V3(freeze) = c(, 3.43857, ))
fixef(Cl(freeze) = c(, 6.2417, ))
fixef(Cl2(freeze) = c(, 5.4595, ))
fixef(Cl3(freeze) = c(, 0.85806, ))
# Indirect response parameters with initial estimates
fixef(Kin = c(, 48.4, ))
fixef(Kout = c(, 4.4, ))
fixef(Imax = c(, 0.82, ))
fixef(IC50 = c(, 300, ))
fixef(gamma = c(, 4, ))
}