1 #-----------------------------------------------------------------------
2 #' Initialize the parameters in a basic way (zero for the conditional mean,
3 #' uniform for weights, identity for covariance matrices, and uniformly distributed forthe clustering)
4 #' @param n sample size
5 #' @param p number of covariates
6 #' @param m size of the response
7 #' @param k number of clusters
8 #' @return list with phiInit, rhoInit,piInit,gamInit
10 #-----------------------------------------------------------------------
11 basic_Init_Parameters = function(n,p,m,k)
13 phiInit = array(0, dim=c(p,m,k))
15 piInit = (1./k)*rep.int(1,k)
17 rhoInit = array(0, dim=c(m,m,k))
19 rhoInit[,,i] = diag(m)
21 gamInit = 0.1*array(1, dim=c(n,k))
22 R = sample(1:k,n, replace=TRUE)
25 gamInit = gamInit/sum(gamInit[1,])
27 return (data = list(phiInit = phiInit, rhoInit = rhoInit, piInit = piInit, gamInit = gamInit))