rmdm: Generate random samples from a mixture of Dirchelet...

Description Usage Arguments Value Examples

Description

Generate random samples from a mixture of Dirchelet Multinomials

Usage

1
rmdm(n, m, f, phi = NULL, p = NULL, scale = NULL)

Arguments

n

number of observations

m

observation sizes vector possibly of length one.

f

mixture proportions

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
7
#simulate reads with 1% sequencing error
#from AT-biased genome
genotypes <- matrix( 0.01/3, nrow=4, ncol=4)
diag(genotypes) <- 0.99
nfreq <- c(0.4, 0.1, 0.1, 0.4)
rmdm(10, 40, phi=0,    f=nfreq, p=genotypes)
rmdm(10, 40, phi=0.01, f=nfreq, p=genotypes)

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