|
Algorithm 1 Particle Marginal Metropolis–Hastings (PMMH) Method. |
-
1:
initialize the parameters
-
2:
for (K is the number of samples) do
-
3:
draw the sample candidate of parameters
-
4:
draw the initial particles for (m is the particle number of the particle that is the source of resampling)
-
5:
calculate the weights of particles with Equation (8)
-
6:
normalize the weights of particles with Equation (7)
-
7:
resample the particles according to the normalized weights
-
8:
for do
-
9:
draw the particles at time step n with Equation (6)
-
10:
calculate the weights of particles with Equation (8)
-
11:
normalize the weights of particles with Equation (7)
-
12:
resample the particles according to the normalized weights
-
13:
end for
-
14:
calculate the marginal likelihood with Equation (9)
-
15:
calculate the acceptance probability with Equation (3)
-
16:
draw a uniform random number ( is a uniform distribution with range )
-
17:
if then
-
18:
set the sample of parameters
-
19:
else
-
20:
set the sample of parameters
-
21:
end if
-
22:
end for
-
23:
return
|