Skip to main content
. Author manuscript; available in PMC: 2025 Jul 8.
Published in final edited form as: J Mach Learn Res. 2024 Mar;25:87.

Algorithm 3.

Posterior sampling and prediction of LMC model (1) with MGP priors.

Initialize βj(0),Λ(0) and γj(0) for j=1,,q,v𝒮(0), and Φ(0)
for t{1,,T*,T*+1,,T*+T} do ⊳ sequential MCMC loop
for j=1,...,q, do in parallel
1:  use SiMPA to update βj(t),λ[j;:](t)y𝒯,v𝒮(t-1),γj(t-1) O(nq(p+k)2)
for j=1,...,q, do in parallel
2:  use Metropolis-Hastings to update γj(t)y𝒯,v𝒮(t-1),βj(t),λ[j,:](t) O(nq)
3: use Metropolis-Hastings to update Φ(t)v𝒮(t-1) Onkd3m2
for cColors(𝒢) do ⊳ sequential
  for ii:Colorai=c do in parallel
4:    use SiMPA to update vi(t)vmb(i)(t),yi,Λ(t),Φ(t),{βj(t),γj(t)}j=1q Onmk2
Assuming convergence has been attained after T* iterations:
discard {βj(t),γj(t)}j=1q,v𝒮(t),Λ(t),Φ(t) for t=1,,T*
Output: Correlated sample of size T with density
{βj(t),γj(t)}j=1q,v𝒮(t),Λ(t),Φ(t)π𝒢(βj,γjj=1q,v𝒮(t),Λ,Φ,y𝒯).
Predict at *𝒰: for t=1,...,T and j=1,...,q, sample from π(v*(t)v[*](t),Φ(t)), then from Fj(wj(*)(t),βj(t),λ[j,:](t),γj(t))