Skip to main content
. Author manuscript; available in PMC: 2016 Mar 31.
Published in final edited form as: J Comput Graph Stat. 2014 Mar 13;24(1):183–204. doi: 10.1080/10618600.2014.889023

Algorithm 1 The EM Algorithm for estimating Ω

1: Initialize E(zi,jxi;Θ^,Ω^)E(zi,jxi,j;Θ^), E(zi,j2xi;Θ^,Ω^)E(zi,j2xi,j;Θ^) and E(zi,jzi,jxi;Θ^,Ω^)E(zi,jxi,j;Θ^)E(zi,jxi,j;Θ^) for i = 1, …, n and j,j′ = 1, …,p;
2: Initialize sj,j for 1 ≤ j,j′ ≤ p using the Line 1 above, and then estimate Ω^ by maximizing criterion (7);
{Start outer loop}
3: repeat
4:  E-step: estimate S in (6);
{Start inner loop}
5: repeat
6:   for i = 1 to n do
7:    if j = jthen
8:     Update E(zi,j2xi;Θ^,Ω^) using RHS of equation (18) for j = 1, …, p;
9:       else
10:     Update E(zi,jxi;Θ^,Ω^) using RHS of equation (17) for j = 1, …, p and then set E(zi,jzi,jxi;Θ^,Ω^)=E(zi,jxi;Θ^,Ω^)E(zi,jxi;Θ^,Ω^) for 1 ≤ jj′ ≤ p;
11:       end if
12:     end for
13:   Update sj,j=1ni=1nE(zi,jzi,jxi;Θ^,Ω^) for 1 ≤ j,j′ ≤ p;
14: until The inner loop converges;
15:  M-step: update Ω^ by maximizing criterion (7);
16: until The outer loop converges.