R: cosmetics + start translation of (selmix.m into) main.R
[valse.git] / R / basicInitParameters.R
CommitLineData
39046da6
BA
1basic_Init_Parameters = function(n,p,m,k)
2{
3 phiInit = array(0, dim=c(p,m,k))
4
5 piInit = (1./k)*rep.int(1,k)
6
7 rhoInit = array(0, dim=c(m,m,k))
8 for(i in 1:k)
9 rhoInit[,,i] = diag(m)
10
11 gamInit = 0.1*array(1, dim=c(n,k))
12 R = sample(1:k,n, replace=TRUE)
13 for(i in 1:n)
14 gamInit[i,R[i]] = 0.9
15 gamInit = gamInit/sum(gamInit[1,])
16
17 return (list(phiInit, rhoInit, piInit, gamInit))
35b42a4b 18}