Description Usage Arguments Value Examples
This function is used to generate random datasets following mixture of product multinomial distribution
1 2 3 4 5 6 7 8 | GenerateData(
n,
p,
d,
k = 3,
theta = rdirichlet(1, rep(10, k)),
psi = InitialPsi(p, d, k)
)
|
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 |
data - generated random dataset, a matrix with n rows and p columns.
1 2 3 4 | # dimension parameters
n<-200; p<-5; d<-rep(2,p);
# generate complete data
Complete<-GenerateData(n, p, d, k = 3)
|
Loading required package: DirichletReg
Loading required package: Formula
Loading required package: rgl
Warning messages:
1: In rgl.init(initValue, onlyNULL) : RGL: unable to open X11 display
2: 'rgl_init' failed, running with rgl.useNULL = TRUE
3: .onUnload failed in unloadNamespace() for 'rgl', details:
call: fun(...)
error: object 'rgl_quit' not found
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.