prepare structure for R package
[valse.git] / R / basicInitParameters.R
CommitLineData
35b42a4b
B
1basic_Init_Parameters = function(n,p,m,k){
2 phiInit = array(0, dim=c(p,m,k))
3
4 piInit = (1.0/k)*rep.int(1,k)
5
6 rhoInit = array(0, dim=c(m,m,k))
7
8 for(i in 1:k){
9 rhoInit[,,i] = diag(m)
10 }
11
12 gamInit = 0.1*array(1, dim=c(n,k))
13
14 R = sample(1:k,n, replace= TRUE)
15
16 for(i in 1:n){
17 gamInit[i,R[i]] = 0.9
18 }
19 gamInit = gamInit/sum(gamInit[1,])
20
21
22 return(list(phiInit, rhoInit, piInit, gamInit))
23}
24
25n= 10
26p = 10
27m = 5
28k = 5
29list_param = basic_Init_Parameters(n,p,m,k)