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 1.

Posterior sampling of spatially meshed model (1) and predictions.

Initialize βj(0) and γj(0) for j=1,...,q, w𝒮(0)w𝒯¯(0), and θ(0)
for t{1,,T*,T*+1,,T*+T} do ⊳ sequential MCMC loop
1:  for j=1,...,q, sample βj(t)y𝒯,w𝒯(t-1),γj(t-1)
2:  for j=1,...,q, sample γj(t)y𝒯,w𝒯(t-1),βj(t)
3:  sample θ(t)w𝒯¯(t-1),w𝒮(t-1)
for cColors(𝒢) do ⊳ sequential
  for ii:Colorai=c do in parallel
4:    sample wi(t)wmb(i)(t),yi,θ(t),{βj(t),γj(t)}j=1q ⊳ reference sampling
for 𝒯¯ do in parallel
5:   sample w()(t)w[](t-1),y(),θ(t),{βj(t),γj(t)}j=1q ⊳ non-reference sampling
Assuming convergence has been attained after T* iterations:
discard {βj(t),γj(t)}j=1q,w𝒮(t),w𝒯¯(t),θ(t) for t=1,,T*
Output: Correlated sample of size T with density
{βj(t),γj(t)}j=1q,w𝒮(t),w𝒯¯(t),θ(t)π𝒢(βj,γjj=1q,w𝒮(t),w𝒯¯(t),θy𝒯).
Predict at *𝒰: for t=1,...,T and j=1,...,q, sample from π(w*(t)w*(t),θ(t)), then from Fj(wj(*)(t),βj(t),γj(t))