Skip to main content
. 2022 Jan 12;24(1):115. doi: 10.3390/e24010115
Algorithm 2 Replica Exchange Particle Marginal Metropolis–Hastings (REPMMH) Method.
  • 1:

    initialize the parameters Θ0

  • 2:

    fork=1,,Kdo

  • 3:

       for r=1,,R do

  • 4:

         draw the sample candidate of parameters Θr*qΘr*Θrk1

  • 5:

         calculate the marginal likelihood py1:N|Θr* by using the SMC method according to Equation (13)

  • 6:

         calculate the acceptance probability pacceptr with Equation (14)

  • 7:

         draw a uniform random number αU0,1 (Ua,b is a uniform distribution with range [a,b))

  • 8:

         if αpacceptr then

  • 9:

            set the sample of parameters ΘrkΘr*

  • 10:

         else

  • 11:

            set the sample of parameters ΘrkΘrk1

  • 12:

         end if

  • 13:

       end for

  • 14:

       choose the replica number rEX1 or rEX2 for the exchange

  • 15:

       repeat

  • 16:

         calculate exchange probability pEXΘ,Θ* with Equation (15) for replica numbers rEX and rEX+1

  • 17:

         draw a uniform random number αEXU0,1

  • 18:

         if αEXpEXΘ,Θ* then

  • 19:

            exchange replicas ΘrEXk,ΘrEX+1kΘrEX+1k,ΘrEXk

  • 20:

         end if

  • 21:

         set the replica number rEXrEX+2 for the exchange

  • 22:

       until rEXR1

  • 23:

    end for

  • 24:

    returnΘkk=1K