initialvalue | R Documentation |
Inittial values for claculating the estimates based on solely on the classified features.
initialvalue(dat, zm, g, ncov = 2)
dat |
An n\times p matrix where each row represents an individual observation |
zm |
An n-dimensional vector containing the class labels including the missing-label denoted as NA. |
g |
Number of multivariate normal classes. |
ncov |
Options of structure of sigma matrix; the default value is 2;
|
pi |
A g-dimensional initial vector of the mixing proportions. |
mu |
A initial p \times g matrix of the location parameters. |
sigma |
A p\times p covariance matrix if |
n<-150 pi<-c(0.25,0.25,0.25,0.25) sigma<-array(0,dim=c(3,3,4)) sigma[,,1]<-diag(1,3) sigma[,,2]<-diag(2,3) sigma[,,3]<-diag(3,3) sigma[,,4]<-diag(4,3) mu<-matrix(c(0.2,0.3,0.4,0.2,0.7,0.6,0.1,0.7,1.6,0.2,1.7,0.6),3,4) dat<-rmix(n=n,pi=pi,mu=mu,sigma=sigma,ncov=2) xi<-c(-0.5,1) m<-rlabel(dat=dat$Y,pi=pi,mu=mu,sigma=sigma,xi=xi,ncov=2) zm<-dat$clust zm[m==1]<-NA inits<-initialvalue(g=4,zm=zm,dat=dat$Y,ncov=2)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.