Skip to content

Commit

Permalink
Test passing
Browse files Browse the repository at this point in the history
  • Loading branch information
FredericWantiez committed Oct 3, 2023
1 parent b814bab commit 2fb7000
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
3 changes: 3 additions & 0 deletions src/smc.jl
Expand Up @@ -56,6 +56,9 @@ struct PG{R,T<:AbstractReferenceSampler} <: AbstractMCMC.AbstractSampler
nparticles::Int
"""Resampling algorithm."""
resampler::R

PG{T}(nparticles::Int, resampler::R) where {T,R} = new{R,T}(nparticles, resampler)
PG{R,T}(nparticles::Int, resampler::R) where {T,R} = new{R,T}(nparticles, resampler)
end

"""
Expand Down
4 changes: 3 additions & 1 deletion test/smc.jl
Expand Up @@ -112,7 +112,9 @@
@test sampler.resampler ===
AdvancedPS.ResampleWithESSThreshold(AdvancedPS.resample_multinomial, 0.6)

sampler = AdvancedPS.PG(100, AdvancedPS.resample_systematic)
sampler = AdvancedPS.PG{AdvancedPS.IdentityReferenceSampler}(
100, AdvancedPS.resample_systematic
)
@test sampler.nparticles == 100
@test sampler.resampler === AdvancedPS.resample_systematic
end
Expand Down

0 comments on commit 2fb7000

Please sign in to comment.