ParEst: Estimate theta and psi in multinomial mixture model

Description Usage Arguments Value Examples

View source: R/ParEst.R

Description

This function is used to estimate theta and psi in multinomial mixture model given the number of components k.

Usage

1
ParEst(data, d, k, TT = 1000)

Arguments

data

- data in matrix formation with n rows and p columns

d

- number of categories for each variable

k

- number of components

TT

- number of iterations in Gibbs sampler, default value is 1000. T should be an even number for 'burn-in'.

Value

theta - vector of probability for each component

psi - specific probability for each variable in each component

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
# dimension parameters
n<-200; p<-5; d<-rep(2,p);
# generate complete data
Complete<-GenerateData(n, p, d, k = 3)
# mask percentage of data at MCAR
Incomplete<-Complete
Incomplete[sample(1:n*p,0.2*n*p,replace = FALSE)]<-NA
# k identify
K<-kIdentifier(data = Incomplete, d, TT = 10)
Par<-ParEst(data = Incomplete, d, k = K$k_est, TT = 10)

Example output

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 

MMDai documentation built on May 2, 2020, 9:05 a.m.

Related to ParEst in MMDai...