Git Product home page Git Product logo

pksensi's Introduction

pksensi

lifecycle Dependencies AppVeyor build status CRAN_Status_Badge CRAN_Download_Badge Total Downloads Codecov test coverage R-CMD-check

pksensi implements the global sensitivity analysis workflow to investigate the parameter uncertainty and sensitivity in physiologically based kinetic (PK) models, especially the physiologically based pharmacokinetic/toxicokinetic model with multivariate outputs. The package also provides some functions to check the convergence and sensitivity of model parameters.

Through pksensi, you can:

  • Run sensitivity analysis for PK models in R with script that were written in C or GNU MCSim.

  • Decision support: The output results and visualization tools can be used to easily determine which parameters have “non-influential” effects on the model output and can be fixed in following model calibration.

Installation

You can install the released version of pksensi from CRAN with:

install.packages("pksensi")

And the development version from GitHub with:

# install.packages("remotes")
remotes::install_github("nanhung/pksensi")
  • This package includes a function that can help you install GNU MCSim more easily through the function mcsim_install().

  • All updated details can be found in NEWS.md.

  • NOTE: Windows users need to install Rtools40 to compile the model code.

Workflow

Note: The parameter correlation (e.g., Vmax and KM in metabolism) might be an issue in the global sensitivity analysis. If you have experiment data, suggest using small datasets as a sample in Markov Chain Monte Carlo Simulation. Then, check correlation before conducting the sensitivity analysis. The issue will try to address in the future version.

Example

This is a basic example of applying pksensi in one-compartment pbtk model:

library(pksensi)

Step 1. Construct 1-cpt pbtk model

pbtk1cpt <- function(t, state, parameters) {
  with(as.list(c(state, parameters)), {
    dAgutlument = - kgutabs * Agutlument
    dAcompartment = kgutabs * Agutlument - ke * Acompartment
    dAmetabolized = ke * Acompartment
    Ccompartment = Acompartment / vdist * BW;
    list(c(dAgutlument, dAcompartment, dAmetabolized), 
         "Ccompartment" = Ccompartment) 
  })
}

Step 2. Define initial conditions, output time steps and variable

initState <- c(Agutlument = 10, Acompartment = 0, Ametabolized = 0)
t <- seq(from = 0.01, to = 24.01, by = 1)
outputs <- c("Ccompartment")

Step 3. Generate parameter matrix

3.1. (Optional) Extract parameter value from httk package

library(httk)
pars1comp <- (parameterize_1comp(chem.name = "acetaminophen"))
#> Human volume of distribution returned in units of L/kg BW.

3.2. Set parameter distributions

q <- c("qunif", "qunif", "qunif", "qnorm")
q.arg <- list(list(min = pars1comp$Vdist / 2, max = pars1comp$Vdist * 2),
              list(min = pars1comp$kelim / 2, max = pars1comp$kelim * 2),
              list(min = pars1comp$kgutabs / 2, max = pars1comp$kgutabs * 2),
              list(mean = pars1comp$BW, sd = 5))

3.3. Create parameter matrix

set.seed(1234)
params <- c("vdist", "ke", "kgutabs", "BW")
x <- rfast99(params, n = 200, q = q, q.arg = q.arg, replicate = 1)

Step 4. Conduct simulation (will take few minutes with more replications)

out <- solve_fun(x, time = t, func = pbtk1cpt, initState = initState, outnames = outputs)
#> Starting time: 2022-01-13 09:47:44
#> Ending time: 2022-01-13 09:47:52

Step 5. Uncertainty analysis

pksim(out)  # Use to compare with "real" data (if any)

Step 6. Check and visualize the result of sensitivity analysis

plot(out)   # Visualize result

check(out)  # Print result to console
#> 
#> Sensitivity check ( Index > 0.05 )
#> ----------------------------------
#> First order:
#>  vdist ke kgutabs 
#> 
#> Interaction:
#>  vdist ke kgutabs 
#> 
#> Total order:
#>  vdist ke kgutabs 
#> 
#> Unselected factors in total order:
#>  BW 
#> 
#> 
#> Convergence check ( Index > 0.05 )
#> ----------------------------------
#> First order:
#>   
#> 
#> Interaction:
#>   
#> 
#> Total order:
#> 

Citation

To cite pksensi in publications use:

  Hsieh, N-H., Reisfeld B., and Chiu W.A., (2020). pksensi: An R
  package to apply global sensitivity analysis in physiologically based
  kinetic modeling SoftwareX, 12, 100609.
  https://doi.org/10.1016/j.softx.2020.100609

A BibTeX entry for LaTeX users is

  @Article{,
    title = {{pksensi}: An R package to apply global sensitivity analysis in physiologically based kinetic modeling},
    author = {Nan-Hung Hsieh and Brad Reisfeld and Weihsueh A. Chiu},
    journal = {SoftwareX},
    year = {2020},
    volume = {12},
    pages = {100609},
    doi = {10.1016/j.softx.2020.100609},
  }

Reference

Hsieh NH, Reisfeld B, Bois FY, Chiu WA. Applying a global sensitivity analysis workflow to improve the computational efficiencies in physiologically-based pharmacokinetic modeling. Frontiers in Pharmacology 2018 Jun; 9:588.

Hsieh NH, Reisfeld B, Chiu WA. pksensi: An R package to apply global sensitivity analysis in physiologically based kinetic modeling. SoftwareX 2020 Jul; 12:100609.

Hsieh NH, Bois FY, Tsakalozou E, Ni Z, Yoon M, Sun W, Klein M, Reisfeld B, Chiu WA. A Bayesian population physiologically based pharmacokinetic absorption modeling approach to support generic drug development: application to bupropion hydrochloride oral dosage forms. Journal of Pharmacokinetics and Pharmacodynamics 2021 Sep; 22:1-6.

pksensi's People

Contributors

nanhung avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

pksensi's Issues

FW: Decision on RJ 2019-153

Sent by Hsieh, Nan-Hung ([email protected]). Created by fire.


Sent from Mail for Windows 10

From:Hsieh, Nan-Hung
Sent: Wednesday, April 1, 2020 5:36 PM
To:[email protected]
Subject: FW: Decision on RJ 2019-153

Sent from Mail for Windows 10

From:Dianne Cook
Sent: Wednesday, April 1, 2020 5:32 PM
To:Hsieh, Nan-Hung
Subject: Decision on RJ 2019-153

Dear Nan-Hun,

We regret to inform you that you article "pksensi: A Package to Apply Global Sensitivity Analysis in Physiologically Based Kinetic Modeling" submitted to the R Journal has been rejected. The editorial board has discussed your submission and based on the reviews (below) have decided that it is not a suitable contribution for the journal.

We wish you all the best and hope you find the reviews useful.

Regards,
Di

REVIEW 1

  • Overview: Is the article important to R the community? Is the approach sensible? Are technology and methods up-to-date?

In terms of methodology, the authors added 'random phase shift' to assess sensitivity index (Sobol index) in GSA, they pretended that they could solve the problem of reliability (robustness) due to a small size of samples. This combined with eFAST (a known algorithm), they mounted a package for the assessment of sensitivity of outputs to model parameters. This package will be useful to the R community.

  • Article: Is anything unclear? Is anything missing? Are the examples helpful? Is there sufficient background, including alternative approaches in R?

I have some concerns about PK examples:

1. In fact, Example 1 is not a PBPK model. It should be simply called a compartment PK model as that used in literature. There are fewer physiological components expressed in this model.

Moreover, the total volume distribution should be written as Vdist/F, where F is the so called bioavalability, but here the author can assume that F=100% for the sake of simplicity. So I suggest the authors to use the general PK terminology to avoid issues raised for the definition of PBPK,

where many organs and tissues should be modeled and integrated into a whole body model. And 'intake' is not a standard term, it should be replaced by 'administration', etc.

In this example, they can use central compartment and depot compartment as that used in NONMEM. Then the code will be simpler.

2. The authors can separate the technical details and the examples. Otherwise it is too redundant to read as they put all together, from R commands, models, results and analysis of the results (pharmacology as well as R codes).

3. It would be much clearer if the authors can provide the illustration of workflow.

-------------

REVIEW 2

Overview

  • Global SA has a steady stream of attention for a long time, and many packages are developed in R. �sensitivity� is a widely used R package. �pksensi� is developed for assessing reliability, and provides the plot for checking convergence as well as sensitivity index.

1. The main point of this paper is that the authors modified �fast99� function in "sensitivity" library to �rfast99� with replication. This replication is for calculating the convergence index. SI index and CI index are calculated for global SA. To represent the result of these indices, �pksensi� provides �heat_check,� �pksim,� and �plot.rfast99� function for plot and �check� for the summary result.

Even though this modification for replication and heat_map for representation are useful, it is possible to be done with fast99 function in "sensitivity" library with a little effort to replicate. Also, the user cannot use many other methods in �sensitivy� package, which are not provided in �pksensi.�

2. �rfast99� class definition is not clear, and the class of the result from �solve_mcsim� function is not clear. In �https://github.com/nanhung/RJ-pksensi/blob/master/RJ-pksensi.R,� the class of the result in line 122 is �rfast99� ( in example 1). However, the class of the result in line 180 (in example 2) is �array,� not �rfast99.� The result from the same function should have the same class.

The result of line 122

system.time(out <- solve_mcsim(x, mName = mName, params = params,

+ vars = outputs, time = t,

+ condition = conditions))

Starting time: . . .

  • Created input file "sim.in".

Execute: ./mcsim.pbtk1cpt.model.exe sim.in


MCSim v6.1.0

.

.

.

class(out)

[1] "rfast99"

The result of line 180

set.seed(1111)

out <- solve_mcsim(mName = mName, params = params, vars = vars,

+ monte_carlo = 1000, dist = dist, q.arg = q.arg,

+ time = times, condition = conditions,

+ rtol = 1e-7, atol = 1e-9)

Starting time: . . .

  • Created input file "sim.in".

Execute: ./mcsim.pbpk_apap.model.exe sim.in


MCSim v6.1.0

.

.

.

class(out)

[1] "array"

--------------------------------------------------

Article

1. Even though the calculation of SI is from "sensitivity" library, SI is an important index in this paper, and it is better to write how to calculate SI briefly in this paper with the reference.

2. The definition of CI is not clear. In equation on the bottom on page2, what is the meaning of "max"? Max of replications? It is not clear.

3. Typo on the first line of page3. Second $SI_{I,t}^{ub}$ should be $SI_{I,t}^{lb}$

4. In Equations in example 1, there is no equation for "dAmetabolized."

5. On page 5, the name of the parameter is confused. "ka" means "kgutabs"? "Kelim" means "Ke"? It should be consistent.

6. There is no function for Figure 6.

7. The output of the function "check" is not clear. In "sensitivity check" and "convergence check", what are the meaning of "First order:", "Interaction:", "Total order:", and "unselected factors in total order:"?

8. In example 2, the output of "solve_sim" function is not the class of "rfast99". Therefore, plot, print, and check functions do not work.

------------------------

Package

1. The output from rfast99, solve_fun, and solve_mcsin is the object with 'rfast99' class. However, the structure of output from rfast99 is different from the others.

2. The author needs to explain the structure of "rfast99" class in detail.

3. The help files for "check," "heat_check," "plot," and "print" should be separated and explained in detail.

4. The structure of rfast99 in "pksensi" is very similar to the structure of fast99 in "sensitivity." Is there any specific reason to define a new class "rfast99" instead of using "fast99"?

%>%>%>%>%
Professor Dianne Cook
Executive Editor, R Journal
[email protected]

FW: about pksense

Sent by Hsieh, Nan-Hung ([email protected]). Created by fire.


From:Chimeddulam Dalaijamts
Sent: Tuesday, March 24, 2020 1:29 PM
To:Hsieh, Nan-Hung
Subject: RE: about pksense

Ok, thanks!

Chimka

From: Hsieh, Nan-Hung [email protected]
Sent: Tuesday, March 24, 2020 1:29 PM
To: Chimeddulam Dalaijamts [email protected]
Subject: RE: about pksense

There is another update. After solve_mcsim(...), you can directly use check(y), plot(y), or heat_check(y) without tell(x,y).

NH

From:Chimeddulam Dalaijamts
Sent: Tuesday, March 24, 2020 1:16 PM
To:Hsieh, Nan-Hung
Subject: RE: about pksense

I just found that solve_mcsim() has an option “generate.infile = FALSE”. I think now it works.

Thank you,

Chimka

From: Chimeddulam Dalaijamts
Sent: Tuesday, March 24, 2020 1:10 PM
To: Hsieh, Nan-Hung <[email protected]>
Subject: RE: about pksense

Again, “solve_mcsim” function generates input file automatically and does not load my created in and dat files. What should I do to fix this problem?

Starting time: 2020-03-24 12:45:36

  • Created input file "perc.GSA.setpoint.f.58p.in".

Execute: ./mcsim.perc.v3.4.exe perc.GSA.setpoint.f.58p.in


MCSim v5.6.5

Copyright (c) 1993-2015 Free Software Foundation, Inc.

MCSim comes with ABSOLUTELY NO WARRANTY;

This is free software, and you are welcome to redistribute it

under certain conditions; see the GNU General Public License.

  • Using `perc.v3.4.model' model in file "model.c" created by C:/MinGW/msys/1.0/local/bin/mod.exe v5.6.5

Error: Cannot open file "setpts.out".

Fatal errors. Exiting.

Thanks,

Chimka

From: Hsieh, Nan-Hung <[email protected]>
Sent: Tuesday, March 24, 2020 12:44 PM
To: Chimeddulam Dalaijamts <[email protected]>
Subject: RE: about pksense

The error message shows that the compiled model program doesn’t exist. You might need to make sure that the mcsim.perc.V3.4.exe exists in the working directory.

You can put the model program in the "C:/MinGW/msys/1.0/home/chimka/Perc/GSA" and renamed it “mcsim.perc.V3.4.exe” if needed.

Best,

Nan-Hung

From:Chimeddulam Dalaijamts
Sent: Tuesday, March 24, 2020 12:37 PM
To:Hsieh, Nan-Hung
Subject: about pksense

Hi Nan-Hung,

It seems ‘pksense’ package has been updated since I worked last time. When I tried to run “solve_mcsim” it indicates following error. Can you check the attached R-script, if there is any mistake in coding. Do I need all packages listed there?

  • Created input file "perc.GSA.setpoint.f.58p.in".

Error in solve_mcsim(x, mName = mName, params = factors, infile.name = "perc.GSA.setpoint.f.58p.in", :

The mcsim.perc.v3.4.exe doesn't exist.

Thank you,

Chimka

replacement of out with pksensi::out

For the acetaminophen R program in pksensi for windows (10)
system.time(out <- solve_mcsim(x, mName = mName,
params = params,
vars = vars,
time = times,
condition = conditions,
generate.infile = F))

check(out) had to be replaced by pksensi::check(out)

The question is how about for:
check(out, vars = "lnCPL_APAP_mcgL", SI.cutoff = 0.1, CI.cutoff = 0.1)

Also, for tell2(x,out) what should it be replaced by

missing values and NaN

Dear Nan-Hung,

I tried to use pksensi for sensitivity analysis for two parameters in my model but a strange error occurred.

Here is my code:

TMDDQE <- function(t, state, parameters) {
  with(as.list(c(state, parameters)), {
    ksyn = 0.438*0.235 
    Ctotal = Drug/2.77
    Cub = 0.5*((Ctotal-Receptor-KD)+sqrt((Ctotal-Receptor-KD)^2+4*KD*Ctotal))
    Aub = Cub*2.77
    Conc = Drug / 2.77
    dAbsorption = - 0.152/24*Absorption
    dDrug = 0.152/24*Absorption - 0.775/24/2.77*Aub - kint*(Drug-Aub)
    dReceptor = ksyn - 0.235*Receptor - (kint-0.235)*(Ctotal-Cub);
    list(c(dAbsorption, dDrug, dReceptor),
         "Conc" = Conc)
  })
}

initState <- c(Absorption = 500, Drug = 0, Receptor = 0.438)

params <- c("kint", "KD")
q <- c("qunif", "qunif")
q.arg <- list(list(min = 0.03 * 0.75, max = 0.03 * 2),
              list(min = 0.18 * 0.75, max = 0.18 * 2))

t <- seq(from = 0, to = 700, by = 10)

set.seed(1234)
x <- rfast99(params, q = q, q.arg = q.arg, n = 200, rep = 5)

outputs <- c("Conc")
out1 <- solve_fun(x, time = t, func = TMDDQE, initState = initState, outnames = outputs)

The error is :

Starting time: 2021-02-08 16:21:32
Error in quantile.default(newX[, i], ...) : 
  missing values and NaN's not allowed if 'na.rm' is FALSE

Could you find out the reason and solve the problem?

Many thanks,
Min Zhu

mcsim installation issue

Hello,

I was trying to install this software for a user of a computer cluster, and users don't have access to the usual install directories. I have a couple of comments:

  1. it would be nice if you could just tell pksensi where to keep the compiled mcsim software and to look for it there, rather than actually require it to be installed. It seems I can get around this by just setting the PATH variable within R to include the mcsim directory, but this also requires me to manually edit the mcsim code and compile it to reflect the mxstep parameter you recommend, rather than using the mcsim_install() function you provide.

  2. Perhaps more importantly, I think it's inappropriate to ask users for their password and then use it to run sudo inside a function. I don't think your software is doing anything malicious, but this kind of system modification from within an R package is a security issue and generally not good practice.

Error in quantile.default(newX[, i], ...)

Hi Nan-Hung,

I am trying to run pksensi on a pbpk model that I've adapted from one created by Frederic.

The following is my job file:

source("utils/mcsim_utils.R")

library(pksensi)

set.seed(31415)

#----------------------------------------------------------------
# Sensitivity Analysis
#----------------------------------------------------------------

model <- "dmf.model"

q <- "qunif"

condition <- c("InhMag = 10", "InhDur = 7", "InhStart = 2", "InhPeriod = 48",
               "PCAir = 1", "log_PCFat = 1", "Frac = 0.8", "kGut = 0.3", 
               "Kp_sc_vs = 0.2", "fSA_exposed = 0.7", "Ke = 1", 
               "Michaelis = 0", "Vmax = 10", "Km = 1", "CLH = 10")

params <- c("fub", "Ke", "CLH")  
outputs <- c("CVen")

fub <- 0.5 
Ke <- 1
CLH <- 1 

q.arg <- list(list(min = fub * 0.8, max = fub * 1.2),
              list(min = Ke * 0.8, max = Ke * 1.2),
              list(min = CLH * 0.8, max = CLH * 1.2),
              list(min = 0.8, max = 1)) 
x <- rfast99(params, n = 400, q = q, q.arg = q.arg, replicate = 10)
times <- seq(0, 48, 0.5)

out_sens <- solve_mcsim(x, mName = model,
                        params = params, time = times,
                        vars = outputs, condition = condition)

Running the file in RStudio gives the following:

MCSim v6.2.0

Copyright (c) 1993-2020 Free Software Foundation, Inc.

MCSim comes with ABSOLUTELY NO WARRANTY;
This is free software, and you are welcome to redistribute it
under certain conditions; see the GNU General Public License.

* Using `modeling/dmf/dmf.model' model in file "dmf.model.c" created by D:/Projects/MCSim_under_R/MCSim/mod.exe v6.2.0

Reading experiment 1.
Doing analysis - 0 SetPoints runs... 1 experiment  each
0 runs specified for SetPoint(). Reading entire file.


Wrote results to "simmc.out"
Done.

Error in quantile.default(newX[, i], ...) : 
  missing values and NaN's not allowed if 'na.rm' is FALSE

Attached is the model file.

I didn't see anything obvious in the code for run_mcsim, but I am not an R expert.
There is no traceback, so I don't know where to begin.

Thanks.

-Brad

dmf.model.txt

three questions when using pksensi

Dear Nan-Hung,

Thanks for the amazing package.
I met an error when using it. But I have no idea how to solve it. Could you please give me some suggestions on it? Thanks in advance~~~

**the error is
Starting time: 2023-11-07 11:25:45.597959
DLSODE- At T (=R1) and step size H (=R2), the
corrector convergence failed repeatedly
or with ABS(H) = HMIN
In above message, R1 = 0, R2 = 3.8147e-08

Error in tmp[k + 1, vars[l]] : subscript out of bounds
In addition: Warning messages:
1: In lsode(y, times, func, parms, ...) :
repeated convergence test failures on a step, but integration was successful - inaccurate Jacobian matrix?
2: In lsode(y, times, func, parms, ...) :
Returning early. Results are accurate, as far as they go**

@my code is here, if it needed:
##the tv of parameters
Qecf = 0.2/1000;
Qcsf = 2.2/1000;
Vbr = 1.73;
Vlv = 50/1000;
Vtfv = 50/1000;
Vcm = 17/1000;
Vsas = 180/1000;

CL = 15.41;
Vcen = 60.34;
Q = 24.27;
CLin = 212.92/1000;
CLout = 211.7/1000;
CLpl = 1.89/1000;
CLlp = 3.48/1000;
CLpt = 29.01/1000;
CLtp = 68.12/1000;
Vper = 151.86;

omega

omega_para <- data.frame(
omega_Vcen = 16.9,
omega_CL = 4.58,
omega_Vper = 4.14,
omega_Q = 15,
omega_CLin = 23,
omega_CLout = 5.67,
omega_CLlp = 15.6,
omega_CLpl = 17.9,
omega_CLtp = 23.4,
omega_CLpt = 7.76
)

calculate sd

{
sd_Vcen = sqrt(exp(omega_para$omega_Vcen^2)-1)
sd_CL = sqrt(exp(omega_para$omega_CL^2)-1)
sd_Vper = sqrt(exp(omega_para$omega_Vper^2)-1)
sd_Q = sqrt(exp(omega_para$omega_Q^2)-1)
sd_CLin = sqrt(exp(omega_para$omega_CLin^2)-1)
sd_CLout = sqrt(exp(omega_para$omega_CLout^2)-1)
sd_CLlp = sqrt(exp(omega_para$omega_CLlp^2)-1)
sd_CLpl = sqrt(exp(omega_para$omega_CLpl^2)-1)
sd_CLtp = sqrt(exp(omega_para$omega_CLtp^2)-1)
sd_CLpt = sqrt(exp(omega_para$omega_CLpt^2)-1)
}

initial value

yini <- unlist(c(data.frame(
Acen = 150.251^6, # Quantity in plasma compartment (ng)
Aper = 0.0, # ~ peripheral compartment
Aecf = 0.0, # ~ ECF
Alv = 0.0, # ~
Atfv = 0.0, # ~
Acm = 0.0, # ~
Asas = 0.0
)))

PBPKmodAPAP <- function(t,state,parameters){
with(as.list(c(state,parameters)), {
Ccen <- Acen/Vcen
Cper <- Aper/Vper
Cecf <- Aecf/Vbr
Clv <- Alv/Vlv
Ctfv <- Atfv/Vtfv
Ccm <- Acm/Vcm
Csas <- Asas/Vsas

#ODE equations
dAcen = Q * Cper - Q * Ccen - CL * Ccen - CLin * Ccen + CLout * Cecf + Clv * CLlp - Ccen * CLpl + Ctfv * CLtp - Ccen * CLpt + Qcsf * Csas + 0.02/100*200000
dAper = Q * Ccen - Q * Cper
dAecf = CLin * Ccen -CLout * Cecf - Qecf * Cecf
dAlv = Qecf * Cecf - Clv * Qcsf - CLlp * Clv + CLpl * Ccen
dAtfv = Qcsf* Clv - Ctfv * Qcsf + CLpt *Ccen - CLtp * Ctfv
dAcm = Qcsf* Ctfv - Ccm * Qcsf
dAsas = Qcsf* Ccm - Csas * Qcsf;

    list(c(dAcen, dAper, dAecf, dAlv, dAtfv, dAcm, dAsas), 
         "Ccen" = Ccen, "Cecf" = Cecf, "Clv" = Clv, "Ccm" = Ccm) 
  })
}

outputs = c("Ccen","Cecf","Clv","Ccm")
results <- ode(y=yini, times=times, func=PBPKmodAPAP, parms=para, method="lsoda")
APAPamount <- as.data.frame(results)
q <- c("qunif", "qunif","qunif","qunif","qunif","qunif","qunif", "qlnorm","qlnorm","qlnorm","qlnorm","qlnorm","qlnorm","qlnorm","qlnorm","qlnorm")
params <- c("Qecf", "Qcsf", "Vbr","Vlv", "Vtfv", "Vcm", "Vsas", "Vcen", "CL","Q","CLin","CLout","CLpl","CLlp","CLpt","CLtp")
LL <- 0.1 # 10% lower limit
UL <- 1.1.
q.arg <- list(
list(min = para["Qecf"]*LL, max= para["Qecf"]*UL), ##uniform with bounds corresponding to LL and UL of the nominal value
list(min = para["Qcsf"]*LL, max= para["Qcsf"]*UL),
list(min = para["Vbr"]*LL, max = para["Vbr"]*UL),
list(min = para["Vlv"]*LL, max = para["Vlv"]*UL),
list(min = para["Vtfv"]*LL, max = para["Vtfv"]*UL),
list(min = para["Vcm"]*LL, max = para["Vcm"]*UL),
list(min = para["Vsas"]*LL, max = para["Vsas"]*UL),
list(meanlog = log(max(para["Vcen"], 1e-10)), sdlog = log(sd_Vcen)), ##lognormal distribution with CV from Monolix
list(meanlog = log(max(para["CL"], 1e-10)), sdlog = log(sd_CL)),
list(meanlog = log(max(para["Q"], 1e-10)), sdlog = log(sd_Q)),
list(meanlog = log(max(para["CLin"], 1e-10)), sdlog = log(sd_CLin)),
list(meanlog = log(max(para["CLout"], 1e-10)), sdlog = log(sd_CLout)),
list(meanlog = log(max(para["CLpl"], 1e-10)), sdlog = log(sd_CLpl)),
list(meanlog = log(max(para["CLlp"], 1e-10)), sdlog = log(sd_CLlp)),
list(meanlog = log(max(para["CLpt"], 1e-10)), sdlog = log(sd_CLpt)),
list(meanlog = log(max(para["CLtp"], 1e-10)), sdlog = log(sd_CLtp)))
set.seed(1234)
length(params)==length(q)
x <- rfast99(params = params, n = 20, q = q, q.arg = q.arg, rep = 1)

dim(x$a)
out <- solve_fun(x, time=times, func = PBPKmodAPAP, initState = yini, outnames = outputs) # error occurred here

Thanks again
Best wishes,
Yuqing

Confidence intervals

Hi,

More questions than an issue - I am firstly wondering whether it is possible using the 'plot' function to filter parameters for which to visualise?

Secondly, in the event I'd like to make my own visualisations using the 'out' list, I am wondering, say for total order sesitivity, how the confidence interval is calculated? In the $tSI object, I cannot find multiple values for some parameters at timepoints where the 'plot' function shows a CI.

Best,

Paul

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.