simulate_rel_change: Simulate concentration changes

View source: R/simulation.R

simulate_rel_changeR Documentation

Simulate concentration changes

Description

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

Usage

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

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 Nov. 3, 2024, 11:22 p.m.