Skip to content

ParticleSampler


abstract class ParticleSampler

Particle sampler.

classDiagram ParticleSampler <|-- MarginalizedParticleImportanceSampler ParticleSampler <|-- ConditionalParticleSampler ConditionalParticleSampler <|-- ParticleGibbsSampler ConditionalParticleSampler <|-- MarginalizedParticleGibbsSampler link ParticleSampler "../ParticleSampler/" link MarginalizedParticleImportanceSampler "../MarginalizedParticleImportanceSampler/" link ConditionalParticleSampler "../ConditionalParticleSampler/" link ParticleGibbsSampler "../ParticleGibbsSampler/" link MarginalizedParticleGibbsSampler "../MarginalizedParticleGibbsSampler/"

Member Variables

Name Description
x:Model? Latest sample.
w:Real Log weight of latest sample.
lnormalize:Array<Real> Log normalizing constant estimates for each step.
ess:Array<Real> Effective sample size estimate for each step.
npropagations:Array<Real> Number of propagations at each step.
raccepts:Array<Real> Acceptance rate at each step.
nsamples:Integer Number of samples.

Member Functions

Name Description
size Size.
sample Initialize sampler.
sample Draw one sample.
clearDiagnostics Clear diagnostics.
pushDiagnostics Push to diagnostics.
write Write only the current sample to a buffer.

Member Function Details

clearDiagnostics

function clearDiagnostics()

Clear diagnostics. These are the records of ESS, normalizing constants, etc.

pushDiagnostics

function pushDiagnostics(filter:ParticleFilter)

Push to diagnostics.

sample

function sample(filter:ParticleFilter, archetype:Model)

Initialize sampler.

  • filter: Particle filter.
  • archetype: Archetype. This is an instance of the appropriate model class that may have one more random variables fixed to known values, representing the inference problem (or target distribution).

abstract function sample(filter:ParticleFilter, archetype:Model, n:Integer)

Draw one sample.

  • filter: Particle filter.
  • archetype: Archetype. This is an instance of the appropriate model class that may have one more random variables fixed to known values, representing the inference problem (or target distribution).
  • n: The sample number, beginning at 1.

size

function size() -> Integer

Size. This is the number of calls to sample(..., Integer) to be performed after the initial call to sample(...).

write

function write(buffer:Buffer, n:Integer)

Write only the current sample to a buffer.