Skip to main content
. Author manuscript; available in PMC: 2024 Dec 23.
Published in final edited form as: Intell Based Med. 2024 Jul 5;10:100154. doi: 10.1016/j.ibmed.2024.100154

Algorithm 2.

Consensus Monte Carlo and Markov Chain Monte Carlo

Input: positive group P, unlabeled group U, number of splits S in consensus Monte Carlo, number of iterations T and burn-in size B in MCMC, prior distributions p(θ) for the set of all parameters θ in the model
Output: posterior distributions pθData) and classification probabilities pxuPData)
Split U into S subgroups U(1),,U(S) with equal sizes
for s=1 to S do:
 Combine P and U(s) as data D(s)
 Perform MCMC on data D(s) to obtain T posterior samples for θt(s),t=1,,T in the loop:
for t=1 to T
  For the collection θ=ψ1,,ψm, where each ψj represents a parameter in the model
  Draw a sample from its full conditional distribution pψjψ-j,D(s), denote ψj,t(s)
  Let θt(s)=ψ1,t(s),,ψm,t(s)
end for
 Discard B burn-in samples and combine the rest posterior samples from all subgroups
θt=1Sw(s)θt(s)/1Sw(s) according to certain weights w(s) for the subgroups
end for
Return pθData) approximated by posterior samples θt and pxuPData) computed using posterior samples θt