rdm: Generate random samples of Dirichelet Multinomial...

Description Usage Arguments Value Examples

Description

Generate random samples of Dirichelet Multinomial observations

Usage

1
rdm(n, m, phi = NULL, p = NULL, scale = NULL)

Arguments

n

number of observations

m

observation sizes vector possibly of length one.

phi

overdispersion paramater. Value must be in [0,1], where phi=0 is 'pure' Multinomial distribuion and increasing values of phi lead to increasingly over-dispersed distributions.

p

matrix or vector of proportions

scale

Scale parameters, vector of matrix.

Value

A matrix of n-rows, each row representing a random draw from

Examples

1
2
3
4
5
6
#simulate reads with 1% sequencing error
genotypes <- matrix( 0.01/3, nrow=4, ncol=4)
diag(genotypes) <- 0.99
round(genotypes,3)
rdm(4, 40, phi=0, p=genotypes)
rdm(4, 40, phi=0.01, p=genotypes)

dwinter/mdm documentation built on May 15, 2019, 4:54 p.m.