simulateBatchData: Create simulated batch data for testing.

Description Usage Arguments Value Examples

Description

Create simulated batch data for testing.

Usage

1
simulateBatchData(N = 2500, p, theta, sds, batch, zz, df = 10)

Arguments

N

number of observations

p

a vector indicating probability of membership to each component

theta

a matrix of means. Columns are components and rows are batches.

sds

a matrix of standard deviations. Columns are components and rows are batches.

batch

a vector of labels indication from which batch each simulation should come from

zz

a vector indicating latent variable membership. Can be omitted.

df

length-1 numeric vector for the t-distribution degrees of freedom

Value

An object of class 'MultiBatchModel'

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
k <- 3
nbatch <- 3
means <- matrix(c(-1.2, -1.0, -0.8,
                  -0.2, 0, 0.2,
                  0.8, 1, 1.2), nbatch, k, byrow=FALSE)
sds <- matrix(0.1, nbatch, k)
N <- 1500
truth <- simulateBatchData(N=N,
                           batch=rep(letters[1:3], length.out=N),
                           theta=means,
                           sds=sds,
                           p=c(1/5, 1/3, 1-1/3-1/5))

CNPBayes documentation built on May 6, 2019, 4:06 a.m.