Documentation strings

Types

SequentialMonteCarlo.SMCModelType
SMCModel(M!::F1, lG::F2, maxn::Int64, particle::Type, pScratch::Type) where
  {F1<:Function,F2<:Function}
  • M! Mutation function
  • lG Log potential function
  • maxn Maximum n for which the model is well-defined
  • particle Type of a particle
  • pScratch Type of particle scratch space
source
SequentialMonteCarlo.SMCIOType
SMCIO{Particle, ParticleScratch}

Structs of this type should be constructed using the provided constructor. Important fields:

  • N::Int64 Number of particles $N$
  • n::Int64 Number of steps $n$
  • nthreads::Int64 Number of threads
  • fullOutput::Bool Whether particle system history should be recorded
  • essThreshold::Float64 Relative ESS Threshold $\tau$
  • zetas::Vector{Particle} Time n particles $\zeta_n^1, \ldots, \zeta_n^N$
  • eves::Vector{Int64} Time n Eve indices $E_n^1, \ldots, E_n^N$
  • ws::Vector{Float64} Time n weights $W_n^1, \ldots, W_n^N$
  • logZhats::Vector{Float64} $\log(\hat{Z}^N_1), \ldots, \log(\hat{Z}^N_n)$
  • Vhat1s::Vector{Float64} $\hat{V}_1^N(1), \ldots, \hat{V}_n^N(1)$
  • esses::Vector{Float64} Relative ESS values $\mathcal{E}_1^N, \ldots, \mathcal{E}_n^N$
  • resample::Vector{Bool} Resampling indicators $R_1, \ldots, R_{n-1}$

Populated only if fullOutput == true

  • allZetas::Vector{Vector{Particle}} All the particles
  • allWs::Vector{Vector{Float64}} All the weights
  • allAs::Vector{Vector{Int64}} All the ancestor indices
  • allEves::Vector{Vector{Int64}} All the Eve indices
source

Functions

SequentialMonteCarlo.smc!Method
smc!(model::SMCModel, smcio::SMCIO)

Run the SMC algorithm for the given model and input/output arguments.

If smcio.nthreads == 1 the algorithm will run in serial.

source
SequentialMonteCarlo.csmc!Method
csmc!(model::SMCModel, smcio::SMCIO, ref::Vector{Particle}, refout::Vector{Particle})

Run the conditional SMC algorithm for the given model, input/output arguments, reference path and output path.

It is permitted for ref and refout to be the same. If smcio.nthreads == 1 the algorithm will run in serial.

source
SequentialMonteCarlo.SMCIOMethod
SMCIO{Particle, ParticleScratch}(N::Int64, n::Int64, nthreads::Int64,
  fullOutput::Bool, essThreshold::Float64 = 2.0) where
  {Particle, ParticleScratch}

Constructor for SMCIO structs.

source
SequentialMonteCarlo.etaMethod
eta(smcio::SMCIO{Particle}, f::F, hat::Bool, p::Int64) where {Particle, F<:Function}

Compute:

  • !hat: $\eta^N_p(f)$
  • hat: $\hat{\eta}_p^N(f)$
source
SequentialMonteCarlo.allEtasMethod
allEtas(smcio::SMCIO, f::F, hat::Bool) where F<:Function

Compute eta(smcio::SMCIO, f::F, hat::Bool, p) for p in {1, …, smcio.n}

source
SequentialMonteCarlo.slgammaMethod
slgamma(smcio::SMCIO, f::F, hat::Bool, p::Int64) where {Particle, F<:Function}

Compute:

  • !hat: $(\eta^N_p(f) \geq 0, \log |\gamma^N_p(f)|)$
  • hat: $(\hat{\eta}^N_p(f) \geq 0, \log |\hat{\gamma}_p^N(f)|)$

The result is returned as a Tuple{Bool, Float64}: the first component represents whether the returned value is non-negative, the second is the logarithm of the absolute value of the approximation.

source
SequentialMonteCarlo.allGammasMethod
allGammas(smcio::SMCIO, f::F, hat::Bool) where F<:Function

Compute slgamma(smcio::SMCIO, f::F, hat::Bool, p) for p in {1, …, smcio.n}

source
SequentialMonteCarlo.VMethod
V(smcio::SMCIO{Particle}, f::F, hat::Bool, centred::Bool, p::Int64) where
  {Particle, F<:Function}

Compute:

  • !hat & !centred: $V^N_p(f)$
  • !hat & centred: $V^N_p(f-\eta_p^N(f))$
  • hat & !centred: $\hat{V}_p^N(f)$
  • hat & centred: $\hat{V}_p^N(f-\hat{\eta}_p^N(f))$
source
SequentialMonteCarlo.vpnsMethod
vpns(smcio::SMCIO, f::F, hat::Bool, centred::Bool, n::Int64) where F<:Function

Compute a vector of the values of, for p = 1, …, n,

  • !hat & !centred: $v^N_{p,n}(f)$
  • !hat & centred: $v^N_{p,n}(f-\eta_n^N(f))$
  • hat & !centred: $\hat{v}_{p,n}^N(f)$
  • hat & centred: $\hat{v}_{p,n}^N(f-\hat{\eta}_n^N(f))$

Note: if essThreshold <= 1.0, and resampling did not occur at every time, the length of the output will be less than n.

source
SequentialMonteCarlo.vMethod
v(smcio::SMCIO, f::F, hat::Bool, centred::Bool, n::Int64) where F<:Function

Compute:

  • !hat & !centred: $v^N_n(f)$
  • !hat & centred: $v^N_n(f-\eta_n^N(f))$
  • hat & !centred: $\hat{v}_n^N(f)$
  • hat & centred: $\hat{v}_n^N(f-\hat{\eta}_n^N(f))$
source