monte_carlo | R Documentation |
This function performs basic, uncorrelated Monte Carlo to simulate
uncertainty and/or variability for parameters of
toxicokinetic models. Parameters can be varied according to either a
normal distribution that is truncated at zero
(using argument cv.params
) or from a normal distribution that is
censored for values less than the limit of detection
(censored.params
). Coefficient of variation (cv) and limit of
of detectin can be specified separately for each parameter.
monte_carlo(
parameters,
cv.params = NULL,
censored.params = NULL,
samples = 1000,
suppress.messages = TRUE
)
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. |
suppress.messages |
Whether or not the output message is suppressed. |
A data.table with a row for each individual in the sample and a column for each parater in the model.
John Wambaugh
Pearce, Robert G., et al. "Httk: R package for high-throughput toxicokinetics." Journal of statistical software 79.4 (2017): 1.
#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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.