Skip to main content
. Author manuscript; available in PMC: 2019 Oct 1.
Published in final edited form as: J Comput Neurosci. 2018 Sep 6;45(2):83–101. doi: 10.1007/s10827-018-0692-x

Algorithm 2.

Block Gibbs sampler for Ω~π(Ω|Xn,Λ).

Input: S=r=1n(X(r)X¯)(X(r)X¯) and Λ; start value of Ω; number of iterations B.
For b =1,..., B :
    1. For i < j: sample τij1~InvGaussian((λij|ωij|)1,2).
    2. For i = 1, ...,d: compute Ωii=Ωiiη and
        ωii:=ξ+ηΩii1η, where
        ξ ~ Γ(n/2 + 1, Sii/2 + λii), and η ~ N(−ASii,A), with
        A=[(Sii+2λii)Ωii1+D]1 and
        D=2diag(λ1i2τ1i,,λ(i1)i2τ(i1)i,λ(i+1)12τ(i+1)i,,λdi2τdi).
    3. Set Ω(b) = Ω.
Output: Sequence Ω(1),..., Ω(B).