blog
Class ParticleFilter

java.lang.Object
  extended by blog.InferenceEngine
      extended by blog.ParticleFilter

public class ParticleFilter
extends InferenceEngine

A Particle Filter. It works by keeping a set of Particles, each representing a partial world, weighted by the evidence. The number of particles used is specified by the property numParticles given at construction time (default is 100). If property useDecayedMCMC is set to true (default is false), it uses the rejuvenation method presented by W. R. Gilks and C. Berzuini. "Following a moving target --- Monte Carlo inference for dynamic Bayesian models." Journal of the Royal Statistical Society, Series B, 63:127--146, 2001. The number of moves used is specified by the property numMoves given at construction time (default is 1).

The ParticleFilter is an unusual InferenceEngine in that it takes evidence and queries additional to the ones taken by InferenceEngine.setEvidence(Evidence) and InferenceEngine.setQueries(List). The evidence set by InferenceEngine.setEvidence(Evidence) is used in the very beginning of inference (thus keeping the general InferenceEngine semantics for it) and the queries set by InferenceEngine.setQueries(List) are used by answerQueries() only (again keeping the original InferenceEngine semantics).


Field Summary
 
Fields inherited from class blog.InferenceEngine
evidence, model, queries
 
Constructor Summary
ParticleFilter(Model model, java.util.Properties properties)
          Creates a new particle filter for the given BLOG model, with configuration parameters specified by the given properties table.
 
Method Summary
 void answer(java.util.Collection queries)
           
 void answerQueries()
          Answers the queries provided at construction time.
 void resetParticleFilters()
          Prepares particle filter for a new sequence of evidence and queries by generating a new set of particles from scratch, which are consistent with evidence set by InferenceEngine.setEvidence(Evidence) (if it has not been invoked, empty evidence is assumed), ensuring behavior consistent with other InferenceEngines.
 void take(Evidence evidence)
          Takes more evidence.
 
Methods inherited from class blog.InferenceEngine
constructEngine, setEvidence, setQueries
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ParticleFilter

public ParticleFilter(Model model,
                      java.util.Properties properties)
Creates a new particle filter for the given BLOG model, with configuration parameters specified by the given properties table.

Method Detail

answerQueries

public void answerQueries()
Answers the queries provided at construction time.

Specified by:
answerQueries in class InferenceEngine

resetParticleFilters

public void resetParticleFilters()
Prepares particle filter for a new sequence of evidence and queries by generating a new set of particles from scratch, which are consistent with evidence set by InferenceEngine.setEvidence(Evidence) (if it has not been invoked, empty evidence is assumed), ensuring behavior consistent with other InferenceEngines.


take

public void take(Evidence evidence)
Takes more evidence. resetParticleFilters() must have been called.


answer

public void answer(java.util.Collection queries)