Skip to main content
. Author manuscript; available in PMC: 2023 Jun 2.
Published in final edited form as: Ann Appl Stat. 2023 Jan 24;17(1):1–22. doi: 10.1214/21-aoas1583

Algorithm 1.

Elliptical slice sampler for posterior distribution π(Y,θ)

1 Input: Latent variable from the previous iteration XRd. Observed data Y, previous updated parameter X..
2 Output Updated latent variable value X
3 Sample ellipse Z𝒩(0,Σ(θ))
4 Compute log-likelihood threshold: sample UUniform(0,1) and let
τlogL(YX,θ)+log(U)
5 Sample angle parameter αUniform[0,2π] and αmin,αmax[α2π,α]
6 XXcosα+Zsinα
7 while logLYX,θ<τ do
8 if α<0 then
9 αminα
10 else
11 αmaxα
12 Sample αUniformαmin,αmax.
13 Make new proposal
XXcosα+Zsinα
14 Return X.