simulate_rel_change: Simulate concentration changes

Description Usage Arguments Value Examples

View source: R/simulation.R

Description

Simulates relative (fractional) changes in metabolite concentrations using a mixture of beta distributions.

Usage

1
simulate_rel_change(n, par1, par2 = NULL, p = 0.5, con = NULL)

Arguments

n

Number of samples to draw.

par1

Parameters (alpha, beta) for first distribution.

par2

Optional parameters (alpha, beta) for second distribution.

p

Proportion of samples to draw using par1 vs. par2. Note, p is ignored if par2 is not specified.

con

Optional vector of lower and upper constraints on generated samples.

Value

A vector of relative concentration values.

Examples

1
2
3
out <- simulate_rel_change(10000, c(2, 5), c(0.5, 0.5), 0.7, c(0.1, 1))
hist(out, 20, probability = TRUE,
     main = '', xlab = 'Fractional change in concentration')

ssokolen/metcourse documentation built on May 30, 2019, 8:43 a.m.