gov.sandia.cognition.statistics.bayesian
Class AbstractParticleFilter<ObservationType,ParameterType>

java.lang.Object
  extended by gov.sandia.cognition.util.AbstractCloneableSerializable
      extended by gov.sandia.cognition.learning.algorithm.AbstractBatchAndIncrementalLearner<ObservationType,DataDistribution<ParameterType>>
          extended by gov.sandia.cognition.statistics.bayesian.AbstractParticleFilter<ObservationType,ParameterType>
Type Parameters:
ObservationType - Type of observations handled by the algorithm.
ParameterType - Type of parameters to infer.
All Implemented Interfaces:
BatchAndIncrementalLearner<ObservationType,DataDistribution<ParameterType>>, BatchLearner<Collection<? extends ObservationType>,DataDistribution<ParameterType>>, IncrementalLearner<ObservationType,DataDistribution<ParameterType>>, BayesianEstimator<ObservationType,ParameterType,DataDistribution<ParameterType>>, ParticleFilter<ObservationType,ParameterType>, RecursiveBayesianEstimator<ObservationType,ParameterType,DataDistribution<ParameterType>>, CloneableSerializable, Randomized, Serializable, Cloneable
Direct Known Subclasses:
SamplingImportanceResamplingParticleFilter

public abstract class AbstractParticleFilter<ObservationType,ParameterType>
extends AbstractBatchAndIncrementalLearner<ObservationType,DataDistribution<ParameterType>>
implements ParticleFilter<ObservationType,ParameterType>

Partial abstract implementation of ParticleFilter.

Since:
3.0
Author:
Kevin R. Dixon
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from interface gov.sandia.cognition.statistics.bayesian.ParticleFilter
ParticleFilter.Updater<ObservationType,ParameterType>
 
Field Summary
protected  int numParticles
          Number of particles in the filter.
protected  Random random
          Random number generator.
protected  ParticleFilter.Updater<ObservationType,ParameterType> updater
          Updates the particle given an existing particle.
 
Constructor Summary
AbstractParticleFilter()
          Default constructor.
 
Method Summary
 AbstractParticleFilter<ObservationType,ParameterType> clone()
          This makes public the clone method on the Object class and removes the exception that it throws.
 double computeEffectiveParticles(DataDistribution<ParameterType> particles)
          Computes the effective number of particles.
 DataDistribution<ParameterType> createInitialLearnedObject()
          Creates a new initial learned object, before any data is given.
 int getNumParticles()
          Gets the number of particles
 Random getRandom()
          Gets the random number generator used by this object.
 ParticleFilter.Updater<ObservationType,ParameterType> getUpdater()
          Gets the updater
 void setNumParticles(int numParticles)
          Sets the number of particles
 void setRandom(Random random)
          Sets the random number generator used by this object.
 void setUpdater(ParticleFilter.Updater<ObservationType,ParameterType> updater)
          Setter for updater
 
Methods inherited from class gov.sandia.cognition.learning.algorithm.AbstractBatchAndIncrementalLearner
learn, learn, update
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface gov.sandia.cognition.learning.algorithm.BatchLearner
learn
 
Methods inherited from interface gov.sandia.cognition.learning.algorithm.IncrementalLearner
update, update
 

Field Detail

updater

protected ParticleFilter.Updater<ObservationType,ParameterType> updater
Updates the particle given an existing particle.


random

protected transient Random random
Random number generator.


numParticles

protected int numParticles
Number of particles in the filter.

Constructor Detail

AbstractParticleFilter

public AbstractParticleFilter()
Default constructor.

Method Detail

clone

public AbstractParticleFilter<ObservationType,ParameterType> clone()
Description copied from class: AbstractCloneableSerializable
This makes public the clone method on the Object class and removes the exception that it throws. Its default behavior is to automatically create a clone of the exact type of object that the clone is called on and to copy all primitives but to keep all references, which means it is a shallow copy. Extensions of this class may want to override this method (but call super.clone() to implement a "smart copy". That is, to target the most common use case for creating a copy of the object. Because of the default behavior being a shallow copy, extending classes only need to handle fields that need to have a deeper copy (or those that need to be reset). Some of the methods in ObjectUtil may be helpful in implementing a custom clone method. Note: The contract of this method is that you must use super.clone() as the basis for your implementation.

Specified by:
clone in interface CloneableSerializable
Overrides:
clone in class AbstractBatchAndIncrementalLearner<ObservationType,DataDistribution<ParameterType>>
Returns:
A clone of this object.

getUpdater

public ParticleFilter.Updater<ObservationType,ParameterType> getUpdater()
Description copied from interface: ParticleFilter
Gets the updater

Specified by:
getUpdater in interface ParticleFilter<ObservationType,ParameterType>
Returns:
Updater algorithm that updates the particles.

setUpdater

public void setUpdater(ParticleFilter.Updater<ObservationType,ParameterType> updater)
Setter for updater

Parameters:
updater - Updater algorithm that updates the particles.

getRandom

public Random getRandom()
Description copied from interface: Randomized
Gets the random number generator used by this object.

Specified by:
getRandom in interface Randomized
Returns:
The random number generator used by this object.

setRandom

public void setRandom(Random random)
Description copied from interface: Randomized
Sets the random number generator used by this object.

Specified by:
setRandom in interface Randomized
Parameters:
random - The random number generator for this object to use.

createInitialLearnedObject

public DataDistribution<ParameterType> createInitialLearnedObject()
Description copied from interface: IncrementalLearner
Creates a new initial learned object, before any data is given.

Specified by:
createInitialLearnedObject in interface IncrementalLearner<ObservationType,DataDistribution<ParameterType>>
Returns:
The initial learned object.

computeEffectiveParticles

public double computeEffectiveParticles(DataDistribution<ParameterType> particles)
Description copied from interface: ParticleFilter
Computes the effective number of particles.

Specified by:
computeEffectiveParticles in interface ParticleFilter<ObservationType,ParameterType>
Parameters:
particles - Current state of the Particle filter.
Returns:
Effective number of particles.

getNumParticles

public int getNumParticles()
Description copied from interface: ParticleFilter
Gets the number of particles

Specified by:
getNumParticles in interface ParticleFilter<ObservationType,ParameterType>
Returns:
Number of particles.

setNumParticles

public void setNumParticles(int numParticles)
Description copied from interface: ParticleFilter
Sets the number of particles

Specified by:
setNumParticles in interface ParticleFilter<ObservationType,ParameterType>
Parameters:
numParticles - Number of particles.