1: procedure Gibbs_Sampling (a, p, o, c, w, A) |
2: Setting of hyperparameters {α}, {β}, λ, γ
|
3: Initialization of parameters and latent variables {π}, {ϕ}, θ, {z}, F
|
4: for
j = 1 to iteration_number
do
|
5: πo ∼ Dir(πo | zo, αo) // equation (12) |
6: πc ∼ Dir(πc| zc, αc) // equation (13) |
7: πp ∼ Dir(πp| zp, αp) // equation (14) |
8: πa ∼ Dir(πa| za, αa) // equation (15) |
9: for
k = 1 to Ko
do
|
10: // equation (16) |
11: end for
|
12: for
k = 1 to Kc
do
|
13: // equation (17) |
14: end for
|
15: for
k = 1 to Kp
do
|
16: // equation (18) |
17: end for
|
18: for
k = 1 to Ka
do
|
19: // equation (19) |
20: end for
|
21: for
do
|
22: θl ∼ Dir(θl | wl, γ) // equation (20) |
23: end for
|
24: for
d = 1 to D
do
|
25: for
m = 1 to Md
do
|
26: // equation (21) |
27: // equation (22) |
28: // equation (23) |
29: end for
|
30: // equation (24) |
31: // equation (25) |
32: end for
|
33: end for
|
34: return {π}, {ϕ}, θ, {z}, F
|
35: end procedure
|