GenerateData {MMDai}R Documentation

Generate random dataset

Description

This function is used to generate random datasets following mixture of product multinomial distribution

Usage

GenerateData(
  n,
  p,
  d,
  k = 3,
  theta = rdirichlet(1, rep(10, k)),
  psi = InitialPsi(p, d, k)
)

Arguments

n

- number of samples

p

- number of variables

d

- a vector which denotes the number of categories for each variable. It could be distinct among variables.

k

- number of latent classes

theta

- probability for latent class

psi

- probability for specific category

Value

data - generated random dataset, a matrix with n rows and p columns.

Examples

# dimension parameters
n<-200; p<-5; d<-rep(2,p);
# generate complete data
Complete<-GenerateData(n, p, d, k = 3)

[Package MMDai version 2.0.0 Index]