A base class for implementing rejection sampling in a generic state space.
See the main method CRejectionSamplingCapable::rejectionSampling To use this class, create your own class as a child of this one and implement the desired virtual methods, and add any required internal data.
#include <mrpt/bayes/CRejectionSamplingCapable.h>

Public Types | |
| typedef CProbabilityParticle < TStateSpace > | TParticle |
Public Member Functions | |
| virtual | ~CRejectionSamplingCapable () |
| Virtual destructor. | |
| void | rejectionSampling (size_t desiredSamples, std::vector< TParticle > &outSamples, size_t timeoutTrials=1000) |
| Generates a set of N independent samples via rejection sampling. | |
Protected Member Functions | |
| virtual void | RS_drawFromProposal (TStateSpace &outSample)=0 |
| Generates one sample, drawing from some proposal distribution. | |
| virtual double | RS_observationLikelihood (const TStateSpace &x)=0 |
| Returns the NORMALIZED observation likelihood (linear, not exponential!!!) at a given point of the state space (values in the range [0,1]). | |
| typedef CProbabilityParticle<TStateSpace> mrpt::bayes::CRejectionSamplingCapable::TParticle |
Definition at line 50 of file CRejectionSamplingCapable.h.
| virtual mrpt::bayes::CRejectionSamplingCapable::~CRejectionSamplingCapable | ( | ) | [inline, virtual] |
Virtual destructor.
Definition at line 54 of file CRejectionSamplingCapable.h.
| void mrpt::bayes::CRejectionSamplingCapable::rejectionSampling | ( | size_t | desiredSamples, |
| std::vector< TParticle > & | outSamples, | ||
| size_t | timeoutTrials = 1000 |
||
| ) | [inline] |
Generates a set of N independent samples via rejection sampling.
| desiredSamples | The number of desired samples to generate |
| outSamples | The output samples. |
| timeoutTrials | The maximum number of rejection trials for each generated sample (i.e. the maximum number of iterations). This can be used to set a limit to the time complexity of the algorithm for difficult probability densities. All will have equal importance weights (a property of rejection sampling), although those samples generated at timeout will have a different importance weights. |
Definition at line 65 of file CRejectionSamplingCapable.h.
| virtual void mrpt::bayes::CRejectionSamplingCapable::RS_drawFromProposal | ( | TStateSpace & | outSample | ) | [protected, pure virtual] |
Generates one sample, drawing from some proposal distribution.
Referenced by mrpt::bayes::CRejectionSamplingCapable< poses::CPose2D >::rejectionSampling().
| virtual double mrpt::bayes::CRejectionSamplingCapable::RS_observationLikelihood | ( | const TStateSpace & | x | ) | [protected, pure virtual] |
Returns the NORMALIZED observation likelihood (linear, not exponential!!!) at a given point of the state space (values in the range [0,1]).
Referenced by mrpt::bayes::CRejectionSamplingCapable< poses::CPose2D >::rejectionSampling().
| Page generated by Doxygen 1.7.5 for MRPT 0.9.5 SVN: at Thu Oct 13 21:25:36 UTC 2011 |