Commit | Line | Data |
---|---|---|
35b42a4b B |
1 | basic_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 | ||
25 | n= 10 | |
26 | p = 10 | |
27 | m = 5 | |
28 | k = 5 | |
29 | list_param = basic_Init_Parameters(n,p,m,k) |