Closed Anks2030 closed 1 month ago
Hi
If you estimate the residual variability on the SD scale then you should square that value when assuming that you estimate the variances in PopED. The expected SE estimates will be approximately twice as large as when you estimate the SD values, but should not affect the design optimization.
Best regards, Andy
Hi @andrewhooker, I have a NM code in which the error model is described as fixed effect. I wish to correctly transfer it to the popED. I have two questions pertaining to the code below:
My NM Code as follows
; $SUBROUTINE ADVAN3 TRANS4 ; $PK CLALLO = (BWT/93.0)THETA(7) VALLO = (BWT/93.0)THETA(8) TVCL = THETA(3)CLALLO TVV1 = THETA(4)VALLO TVQ = THETA(5) TVV2 = THETA(6) CL = TVCL EXP(ETA(1)) V1 = TVV1 EXP(ETA(2)) Q = TVQ EXP(ETA(3)) V2 = TVV2 EXP(ETA(4)) S1 = V1/1000 S2 = V2/1000
$ERROR IPRED = F IRES = DV-IPRED ERRADD = THETA(1) ERRPROP = THETA(2) W = SQRT(ERRPROP*2IPRED2 + ERRADD2) DEL = 0 IF(W.EQ.0) DEL = 1 IWRES = IRES/(W + DEL) Y = IPRED + W*EPS(1)
$THETA
(0,100) ; TH1_ERRADD (0,1) ; TH2_ERRPROP (0,0.1) ; TH3_CL (0,2) ; TH4_V1 (0,1) ; TH5_Q (0,2) ; TH6_V2 0.75 ; TH7_CLALLO 1.0 ; TH8_VALLO
$OMEGA
0.1 ; n_CL 0.1 ; n_V1 0 FIX ; n_Q 0.1 ; n_V2
$SIGMA 1 FIX $ESTIMATION METHOD=1 INTER POSTHOC MAXEVAL=9999 NOABORT PRINT=5
My popED code is as below:
PK_2comp_ode_inf <- function(Time, State, Pars){ with(as.list(c(State, Pars)), { CL=CL(WT/93)^(WT_CL) V1=V1(WT/93)^(WT_V1) if( Time %% TAU < TINF ){In <- DOSE/TINF} else { In <- 0 } dA1 <- In - CL/V1A1- Q/V1A1+ Q/V2A2 dA2 <- Q/V1A1-Q/V2*A2
})
} PK_2comp_ode_inf_ff <- function(model_switch, xt, parameters, poped.db){ with(as.list(parameters),{
initial conditions of ODE system
times_xt <- drop(xt)# sample times event_times <- seq(from=0,to=max(times_xt),by=TAU)# dose times times <- c(0,times_xt,event_times) ## add extra time for start of integration
times<-seq(0,1344,10)
}) }
-- parameter definition function
-- names match parameters in function ff
sfg <- function(x,a,bpop,b,bocc){
parameters=c( CL=bpop[1]exp(b[1]), V1=bpop[2]exp(b[2]), Q= bpop[3]exp(b[3]), V2=bpop[4]exp(b[4]),
BL=bpop[5]*exp(b[5]),
return( parameters )
}
-- Residual unexplained variablity (RUV) function
-- Proportional + additive
feps.add.prop <- function(model_switch,xt,parameters,epsi,poped.db){ returnArgs <- do.call(poped.db$model$ff_pointer,list(model_switch,xt,parameters,poped.db)) returnArgs <- ff(model_switch,xt,parameters,poped.db) y <- returnArgs[[1]] poped.db <- returnArgs[[2]]
y = y*(1+epsi[,1])+epsi[,2]
return(list( y= y,poped.db =poped.db )) }
Original Design
poped.db_original <- create.poped.database(ff_file = "PK_2comp_ode_inf_ff", fg_file="sfg", fError_file="feps.add.prop",