00001 #ifndef INDII_ML_FILTER_STRATIFIEDPARTICLERESAMPLER_HPP 00002 #define INDII_ML_FILTER_STRATIFIEDPARTICLERESAMPLER_HPP 00003 00004 #include "ParticleResampler.hpp" 00005 00006 namespace indii { 00007 namespace ml { 00008 namespace filter { 00009 /** 00010 * Stratified particle resampler. 00011 * 00012 * @author Lawrence Murray <lawrence@indii.org> 00013 * @version $Rev: 518 $ 00014 * @date $Date: 2008-08-15 14:01:35 +0100 (Fri, 15 Aug 2008) $ 00015 * 00016 * Produces a new approximation of a weighted sample set using a set 00017 * of equally weighted samples, possibly with duplication. Based on 00018 * the deterministic stratified resampling scheme of @ref 00019 * Kitagawa1996 "(Kitagawa 1996)", without sorting. 00020 * 00021 * @section StratifiedParticleResampler_references References 00022 * 00023 * @anchor Kitagawa1996 00024 * Kitagawa, G. Monte Carlo %Filter and %Smoother for Non-Gaussian 00025 * Nonlinear State Space Models. <i>Journal of Computational and 00026 * Graphical Statistics</i>, <b>1996</b>, 5, 1-25. 00027 */ 00028 class StratifiedParticleResampler : public ParticleResampler { 00029 public: 00030 /** 00031 * Constructor. 00032 * 00033 * @param P Number of particles to resample from each distribution 00034 * supplied to resample(). If zero, will resample the same number of 00035 * particles as the distribution supplied. 00036 */ 00037 StratifiedParticleResampler(const unsigned int P = 0); 00038 00039 /** 00040 * Destructor. 00041 */ 00042 virtual ~StratifiedParticleResampler(); 00043 00044 /** 00045 * Set the number of particles to resample. 00046 * 00047 * @param P Number of particles to resample from each distribution 00048 * supplied to resample(). If zero, will resample the same number of 00049 * particles as the distribution supplied. 00050 */ 00051 void setNumParticles(const unsigned int P = 0); 00052 00053 /** 00054 * Resample the distribution. This produces a new approximation of 00055 * the same distribution using a set of equally weighted sample 00056 * points. Sample points are selected using the deterministic 00057 * resampling method given in the appendix of @ref Kitagawa1996 00058 * "Kitagawa (1996)". 00059 * 00060 * @return The resampled distribution. 00061 */ 00062 virtual indii::ml::aux::DiracMixturePdf resample( 00063 indii::ml::aux::DiracMixturePdf& p); 00064 00065 private: 00066 /** 00067 * Number of particles to resample from each distribution. 00068 */ 00069 unsigned int P; 00070 00071 }; 00072 00073 } 00074 } 00075 } 00076 00077 #endif 00078
1.5.3