Description Usage Arguments Value Examples
Simulates maximum metabolite concentrations using a mixture of 2 normal distributions of concentration logarithms.
1 | simulate_max(n, par1, par2 = NULL, p = 0.5, con = NULL)
|
n |
Number of samples to draw. |
par1 |
Parameters (mean, sd) in concentration units for first distribution. These values are converted to logarithms for sampling. |
par2 |
Optional parameters (mean, sd) in concentration units for second distribution. These values are converted to logarithms for sampling. |
p |
Proportion of samples to draw using |
con |
Optional vector of lower and upper constraints on generated samples. |
A vector of concentration values.
1 2 3 4 5 6 7 8 9 10 | # Generating concentrations
out <- simulate_max(10000, c(7, 2), c(0.5, 2), 0.3)
# Formatting output on logarithmic scale
out <- log10(out)
labels <- c(0.1, 0.25, 0.5, 1, 2.5, 5, 10, 25, 50)
hist(out, 20, axes = FALSE, probability = TRUE,
main = '', xlab = 'Maximum metabolite concentration')
axis(side = 2)
axis(at = log10(labels), labels = labels, side = 1)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.