Learn R Programming

MMDai (version 1.2.0)

GenerateData: Generate random dataset

Description

This function is used to generate random datasets. It helps to evaluate the performance of this package.

Usage

GenerateData(n, p, d, method = "MixMultinomial", k = 3,
  theta = rdirichlet(1, rep(10, k)), psi = InitialPsi(p, d, k),
  JT = JointTable(p, d))

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.

method

- the method to generate random datasets, including "MixMultinomial" and "General". In "MixMultinomial" method, the dataset follows finite mixture of multinomial distribution In "General" method, the dataset follows general joint distribution.

k

- parameter used in "MixMultinomial" method

theta

- parameter used in "MixMultinomial" method

psi

- parameter used in "MixMultinomial" method

JT

- parameter used in "General" method

Value

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

Examples

Run this code
# NOT RUN {
# dimension parameters
n<-200; p<-5; d<-rep(2,p);
# generate complete data
Complete<-GenerateData(n, p, d, k = 3, method = "MixMultinomial")
# }

Run the code above in your browser using DataLab