@@ -38,12 +38,12 @@ function AbstractMCMC.sample(
38
38
end
39
39
40
40
# Create a set of particles.
41
- particles = ParticleContainer ([
42
- Trace (model, TracedRNG ()) for _ in 1 : (sampler. nparticles)
43
- ] )
41
+ particles = ParticleContainer (
42
+ [ Trace (model, TracedRNG ()) for _ in 1 : (sampler. nparticles)], rng
43
+ )
44
44
45
45
# Perform particle sweep.
46
- logevidence = sweep! (rng, particles, sampler. resampler)
46
+ logevidence = sweep! (particles . rng, particles, sampler. resampler)
47
47
48
48
return SMCSample (collect (particles), getweights (particles), logevidence)
49
49
end
@@ -85,12 +85,12 @@ function AbstractMCMC.step(
85
85
rng:: Random.AbstractRNG , model:: AbstractMCMC.AbstractModel , sampler:: PG ; kwargs...
86
86
)
87
87
# Create a new set of particles.
88
- particles = ParticleContainer ([
89
- Trace (model, TracedRNG ()) for _ in 1 : (sampler. nparticles)
90
- ] )
88
+ particles = ParticleContainer (
89
+ [ Trace (model, TracedRNG ()) for _ in 1 : (sampler. nparticles)], rng
90
+ )
91
91
92
92
# Perform a particle sweep.
93
- logevidence = sweep! (rng, particles, sampler. resampler)
93
+ logevidence = sweep! (particles . rng, particles, sampler. resampler)
94
94
95
95
# Pick a particle to be retained.
96
96
trajectory = rand (rng, particles)
@@ -115,10 +115,10 @@ function AbstractMCMC.step(
115
115
Trace (model, TracedRNG ())
116
116
end
117
117
end
118
- particles = ParticleContainer (x)
118
+ particles = ParticleContainer (x, rng )
119
119
120
120
# Perform a particle sweep.
121
- logevidence = sweep! (rng, particles, sampler. resampler)
121
+ logevidence = sweep! (particles . rng, particles, sampler. resampler)
122
122
123
123
# Pick a particle to be retained.
124
124
newtrajectory = rand (rng, particles)
0 commit comments