Skip to content

Commit

Permalink
Introduce a ParticleSampler type (#86)
Browse files Browse the repository at this point in the history
* Update smc.jl

* Update smc.jl
  • Loading branch information
yebai committed Oct 23, 2023
1 parent f4eae06 commit 16cdfa7
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/smc.jl
@@ -1,4 +1,6 @@
struct SMC{R} <: AbstractMCMC.AbstractSampler
abstract type ParticleSampler <: AbstractMCMC.AbstractSampler end

struct SMC{R} <: ParticleSampler
nparticles::Int
resampler::R
end
Expand Down Expand Up @@ -51,7 +53,7 @@ function AbstractMCMC.sample(
return SMCSample(collect(particles), getweights(particles), logevidence)
end

struct PG{R} <: AbstractMCMC.AbstractSampler
struct PG{R} <: ParticleSampler
"""Number of particles."""
nparticles::Int
"""Resampling algorithm."""
Expand Down Expand Up @@ -84,7 +86,7 @@ struct PGSample{T,L}
logevidence::L
end

struct PGAS{R} <: AbstractMCMC.AbstractSampler
struct PGAS{R} <: ParticleSampler
"""Number of particles."""
nparticles::Int
"""Resampling algorithm."""
Expand Down

0 comments on commit 16cdfa7

Please sign in to comment.