powered by
This function is used to generate random datasets following mixture of product multinomial distribution
GenerateData( n, p, d, k = 3, theta = rdirichlet(1, rep(10, k)), psi = InitialPsi(p, d, k) )
- number of samples
- number of variables
- a vector which denotes the number of categories for each variable. It could be distinct among variables.
- number of latent classes
- probability for latent class
- probability for specific category
data - generated random dataset, a matrix with n rows and p columns.
# NOT RUN { # dimension parameters n<-200; p<-5; d<-rep(2,p); # generate complete data Complete<-GenerateData(n, p, d, k = 3) # }
Run the code above in your browser using DataLab