Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

monte_carlo

Monte Carlo for pharmacokinetic models


Description

This function performs Monte Carlo to assess uncertainty and variability for toxicokinetic models.

Usage

monte_carlo(
  parameters,
  cv.params = NULL,
  censored.params = NULL,
  samples = 1000
)

Arguments

parameters

These parameters that are also listed in either cv.params or censored.params are sampled using Monte Carlo.

cv.params

The parameters listed in cv.params are sampled from a normal distribution that is truncated at zero. This argument should be a list of coefficients of variation (cv) for the normal distribution. Each entry in the list is named for a parameter in "parameters". New values are sampled with mean equal to the value in "parameters" and standard deviation equal to the mean times the cv.

censored.params

The parameters listed in censored.params are sampled from a normal distribution that is censored for values less than the limit of detection (specified separately for each parameter). This argument should be a list of sub-lists. Each sublist is named for a parameter in "params" and contains two elements: "cv" (coefficient of variation) and "LOD" (limit of detection), below which parameter values are censored. New values are sampled with mean equal to the value in "params" and standard deviation equal to the mean times the cv. Censored values are sampled on a uniform distribution between 0 and the limit of detection.

samples

This argument is the number of samples to be generated for calculating quantiles.

Value

A data.table with a row for each individual in the sample and a column for each parater in the model.

Author(s)

John Wambaugh

References

Pearce, Robert G., et al. "Httk: R package for high-throughput toxicokinetics." Journal of statistical software 79.4 (2017): 1.

Examples

#Example based on Pearce et al. (2017):

# Set up means:
params <- parameterize_pbtk(chem.name="zoxamide")
# Nothing changes:
monte_carlo(params)

vary.params <- NULL
for (this.param in names(params)[!(names(params) %in%
  c("Funbound.plasma", "pKa_Donor", "pKa_Accept" )) &
  !is.na(as.numeric(params))]) vary.params[this.param] <- 0.2
# Most everything varies with CV of 0.2:
monte_carlo(
  parameters=params, 
  cv.params = vary.params)

censored.params <- list(Funbound.plasma = list(cv = 0.2, lod = 0.01))
# Fup is censored below 0.01:
monte_carlo(
  parameters=params, 
  cv.params = vary.params,
  censored.params = censored.params)

httk

High-Throughput Toxicokinetics

v2.0.4
GPL-3
Authors
John Wambaugh [aut, cre] (<https://orcid.org/0000-0002-4024-534X>), Robert Pearce [aut] (<https://orcid.org/0000-0003-3168-4049>), Caroline Ring [aut] (<https://orcid.org/0000-0002-0463-1251>), Greg Honda [aut] (<https://orcid.org/0000-0001-7713-9850>), Mark Sfeir [aut], Matt Linakis [aut] (<https://orcid.org/0000-0003-0526-2395>), Sarah Davidson [aut] (<https://orcid.org/0000-0002-2891-9380>), Miyuki Breen [ctb] (<https://orcid.org/0000-0001-8511-4653>), Shannon Bell [ctb], Xiaoqing Chang [ctb] (<https://orcid.org/0000-0003-0752-1848>), Jimena Davis [ctb], James Sluka [ctb] (<https://orcid.org/0000-0002-5901-1404>), Nisha Sipes [ctb] (<https://orcid.org/0000-0003-4203-6426>), Barbara Wetmore [ctb] (<https://orcid.org/0000-0002-6878-5348>), Woodrow Setzer [ctb] (<https://orcid.org/0000-0002-6709-9186>)
Initial release
2021-05-07

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.