rexp_matrix: Sim from exponential given rates in matrix form

Description Usage Arguments Examples

View source: R/outcomes.R

Description

This is simple code but it's a separate function to confirm that it performs as expected

Usage

1
rexp_matrix(ratematrix)

Arguments

ratematrix

Matrix of exponential rates to simulate from

Examples

1
2
3
4
5
# Cell-specific rates: two columns of 0.05, two columns of 0.2
m <- cbind(matrix(0.05, nrow=100, ncol=2),
         matrix(0.2, nrow=100, ncol=2))
# Sims reflect cell-specific rates
round(1/colMeans(rexp_matrix(m)), 2)

cancerpolicy/bcimodel documentation built on June 15, 2018, 12:31 a.m.