|
62 | 62 | Update reference trajectory. Defaults to `nothing` |
63 | 63 | """ |
64 | 64 | function update_ref!( |
65 | | - particle::Trace, pc::ParticleContainer, sampler::AbstractParticleSampler |
66 | | -) |
| 65 | + particle::Trace, pc::ParticleContainer, sampler::T |
| 66 | +) where {T<:AbstractMCMC.AbstractSampler} |
67 | 67 | return nothing |
68 | 68 | end |
69 | 69 |
|
@@ -171,11 +171,11 @@ of the particle `weights`. For Particle Gibbs sampling, one can provide a refere |
171 | 171 | function resample_propagate!( |
172 | 172 | ::Random.AbstractRNG, |
173 | 173 | pc::ParticleContainer, |
174 | | - sampler::AbstractParticleSampler, |
| 174 | + sampler::T, |
175 | 175 | randcat=DEFAULT_RESAMPLER, |
176 | 176 | ref::Union{Particle,Nothing}=nothing; |
177 | 177 | weights=getweights(pc), |
178 | | -) |
| 178 | +) where {T<:AbstractMCMC.AbstractSampler} |
179 | 179 | # sample ancestor indices |
180 | 180 | n = length(pc) |
181 | 181 | nresamples = ref === nothing ? n : n - 1 |
@@ -233,11 +233,11 @@ end |
233 | 233 | function resample_propagate!( |
234 | 234 | rng::Random.AbstractRNG, |
235 | 235 | pc::ParticleContainer, |
236 | | - sampler::AbstractParticleSampler, |
| 236 | + sampler::T, |
237 | 237 | resampler::ResampleWithESSThreshold, |
238 | 238 | ref::Union{Particle,Nothing}=nothing; |
239 | 239 | weights=getweights(pc), |
240 | | -) |
| 240 | +) where {T<:AbstractMCMC.AbstractSampler} |
241 | 241 | # Compute the effective sample size ``1 / ∑ wᵢ²`` with normalized weights ``wᵢ`` |
242 | 242 | ess = inv(sum(abs2, weights)) |
243 | 243 |
|
|
0 commit comments