Bayes Filters Library
Public Types | Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes | List of all members
bfl::EstimatesExtraction Class Reference

#include <EstimatesExtraction.h>

Public Types

enum  ExtractionMethod {
  ExtractionMethod::mean, ExtractionMethod::smean, ExtractionMethod::wmean, ExtractionMethod::emean,
  ExtractionMethod::mode, ExtractionMethod::smode, ExtractionMethod::wmode, ExtractionMethod::emode,
  ExtractionMethod::map, ExtractionMethod::smap, ExtractionMethod::wmap, ExtractionMethod::emap
}
 

Public Member Functions

 EstimatesExtraction (const std::size_t linear_size) noexcept
 
 EstimatesExtraction (const std::size_t linear_size, const std::size_t circular_size) noexcept
 
 EstimatesExtraction (EstimatesExtraction &&estimate_extraction) noexcept
 
EstimatesExtractionoperator= (EstimatesExtraction &&estimate_extraction) noexcept
 
 ~EstimatesExtraction () noexcept=default
 
bool setMethod (const ExtractionMethod &extraction_method)
 
bool setMobileAverageWindowSize (const int window)
 
std::pair< bool, Eigen::VectorXd > extract (const Eigen::Ref< const Eigen::MatrixXd > &particles, const Eigen::Ref< const Eigen::VectorXd > &weights)
 
std::pair< bool, Eigen::VectorXd > extract (const Eigen::Ref< const Eigen::MatrixXd > &particles, const Eigen::Ref< const Eigen::VectorXd > &weights, const Eigen::Ref< const Eigen::VectorXd > &previous_weights, const Eigen::Ref< const Eigen::VectorXd > &likelihoods, const Eigen::Ref< const Eigen::MatrixXd > &transition_probabilities)
 
bool clear ()
 
std::vector< std::string > getInfo () const
 

Protected Types

enum  Statistics { Statistics::mean, Statistics::mode, Statistics::map }
 

Protected Member Functions

Eigen::VectorXd mean (const Eigen::Ref< const Eigen::MatrixXd > &particles, const Eigen::Ref< const Eigen::VectorXd > &weights) const
 
Eigen::VectorXd mode (const Eigen::Ref< const Eigen::MatrixXd > &particles, const Eigen::Ref< const Eigen::VectorXd > &weights) const
 
Eigen::VectorXd map (const Eigen::Ref< const Eigen::MatrixXd > &particles, const Eigen::Ref< const Eigen::VectorXd > &previous_weights, const Eigen::Ref< const Eigen::VectorXd > &likelihoods, const Eigen::Ref< const Eigen::MatrixXd > &transition_probabilities) const
 Return an approximatation of the MAP (maximum a posteriori) estimate from a running particle filter. More...
 
Eigen::VectorXd simpleAverage (const Eigen::Ref< const Eigen::MatrixXd > &particles, const Eigen::Ref< const Eigen::VectorXd > &weights, const Eigen::Ref< const Eigen::VectorXd > &previous_weights, const Eigen::Ref< const Eigen::VectorXd > &likelihoods, const Eigen::Ref< const Eigen::MatrixXd > &transition_probabilities, const Statistics &base_est_ext)
 
Eigen::VectorXd weightedAverage (const Eigen::Ref< const Eigen::MatrixXd > &particles, const Eigen::Ref< const Eigen::VectorXd > &weights, const Eigen::Ref< const Eigen::VectorXd > &previous_weights, const Eigen::Ref< const Eigen::VectorXd > &likelihoods, const Eigen::Ref< const Eigen::MatrixXd > &transition_probabilities, const Statistics &base_est_ext)
 
Eigen::VectorXd exponentialAverage (const Eigen::Ref< const Eigen::MatrixXd > &particles, const Eigen::Ref< const Eigen::VectorXd > &weights, const Eigen::Ref< const Eigen::VectorXd > &previous_weights, const Eigen::Ref< const Eigen::VectorXd > &likelihoods, const Eigen::Ref< const Eigen::MatrixXd > &transition_probabilities, const Statistics &base_est_ext)
 

Protected Attributes

ExtractionMethod extraction_method_ = ExtractionMethod::emode
 
HistoryBuffer hist_buffer_
 
Eigen::VectorXd sm_weights_
 
Eigen::VectorXd wm_weights_
 
Eigen::VectorXd em_weights_
 
std::size_t linear_size_
 
std::size_t circular_size_
 
std::size_t state_size_
 

Detailed Description

Definition at line 23 of file EstimatesExtraction.h.

Member Enumeration Documentation

◆ ExtractionMethod

Enumerator
mean 
smean 
wmean 
emean 
mode 
smode 
wmode 
emode 
map 
smap 
wmap 
emap 

Definition at line 36 of file EstimatesExtraction.h.

◆ Statistics

Enumerator
mean 
mode 
map 

Definition at line 67 of file EstimatesExtraction.h.

Constructor & Destructor Documentation

◆ EstimatesExtraction() [1/3]

EstimatesExtraction::EstimatesExtraction ( const std::size_t  linear_size)
noexcept

Definition at line 16 of file EstimatesExtraction.cpp.

◆ EstimatesExtraction() [2/3]

EstimatesExtraction::EstimatesExtraction ( const std::size_t  linear_size,
const std::size_t  circular_size 
)
noexcept

Definition at line 21 of file EstimatesExtraction.cpp.

◆ EstimatesExtraction() [3/3]

EstimatesExtraction::EstimatesExtraction ( EstimatesExtraction &&  estimate_extraction)
noexcept

Definition at line 29 of file EstimatesExtraction.cpp.

◆ ~EstimatesExtraction()

bfl::EstimatesExtraction::~EstimatesExtraction ( )
defaultnoexcept

Member Function Documentation

◆ clear()

bool EstimatesExtraction::clear ( )

Definition at line 181 of file EstimatesExtraction.cpp.

◆ exponentialAverage()

VectorXd EstimatesExtraction::exponentialAverage ( const Eigen::Ref< const Eigen::MatrixXd > &  particles,
const Eigen::Ref< const Eigen::VectorXd > &  weights,
const Eigen::Ref< const Eigen::VectorXd > &  previous_weights,
const Eigen::Ref< const Eigen::VectorXd > &  likelihoods,
const Eigen::Ref< const Eigen::MatrixXd > &  transition_probabilities,
const Statistics base_est_ext 
)
protected

Definition at line 332 of file EstimatesExtraction.cpp.

References bfl::utils::log_sum_exp().

Here is the call graph for this function:

◆ extract() [1/2]

std::pair<bool, Eigen::VectorXd> bfl::EstimatesExtraction::extract ( const Eigen::Ref< const Eigen::MatrixXd > &  particles,
const Eigen::Ref< const Eigen::VectorXd > &  weights 
)

◆ extract() [2/2]

std::pair<bool, Eigen::VectorXd> bfl::EstimatesExtraction::extract ( const Eigen::Ref< const Eigen::MatrixXd > &  particles,
const Eigen::Ref< const Eigen::VectorXd > &  weights,
const Eigen::Ref< const Eigen::VectorXd > &  previous_weights,
const Eigen::Ref< const Eigen::VectorXd > &  likelihoods,
const Eigen::Ref< const Eigen::MatrixXd > &  transition_probabilities 
)

◆ getInfo()

std::vector< std::string > EstimatesExtraction::getInfo ( ) const

Definition at line 187 of file EstimatesExtraction.cpp.

◆ map()

Eigen::VectorXd bfl::EstimatesExtraction::map ( const Eigen::Ref< const Eigen::MatrixXd > &  particles,
const Eigen::Ref< const Eigen::VectorXd > &  previous_weights,
const Eigen::Ref< const Eigen::VectorXd > &  likelihoods,
const Eigen::Ref< const Eigen::MatrixXd > &  transition_probabilities 
) const
protected

Return an approximatation of the MAP (maximum a posteriori) estimate from a running particle filter.

The approximation is taken from: Saha, S., Boers, Y., Driessen, H., Mandal, P. K., Bagchi, A. (2009), 'Particle Based MAP State Estimation: A Comparison.', 12th International Conference on Information Fusion, Seattle, WA, USA, July 6-9, 2009

The vector 'particles' contains the position of the particles at the current time step k. The vector 'previous_weights' contains the weights at the previous time step (k - 1). The vector 'likelihoods' containts the likelihoods at the current time step k. The matrix 'transition_probabilities' contains, in each entry (i, j), the transition probability between the i-th particle at time k and the j-th particle at time (k-1).

◆ mean()

Eigen::VectorXd bfl::EstimatesExtraction::mean ( const Eigen::Ref< const Eigen::MatrixXd > &  particles,
const Eigen::Ref< const Eigen::VectorXd > &  weights 
) const
protected

◆ mode()

Eigen::VectorXd bfl::EstimatesExtraction::mode ( const Eigen::Ref< const Eigen::MatrixXd > &  particles,
const Eigen::Ref< const Eigen::VectorXd > &  weights 
) const
protected

◆ operator=()

EstimatesExtraction & EstimatesExtraction::operator= ( EstimatesExtraction &&  estimate_extraction)
noexcept

Definition at line 43 of file EstimatesExtraction.cpp.

References extraction_method_.

◆ setMethod()

bool EstimatesExtraction::setMethod ( const ExtractionMethod extraction_method)

Definition at line 65 of file EstimatesExtraction.cpp.

◆ setMobileAverageWindowSize()

bool EstimatesExtraction::setMobileAverageWindowSize ( const int  window)

Definition at line 73 of file EstimatesExtraction.cpp.

◆ simpleAverage()

VectorXd EstimatesExtraction::simpleAverage ( const Eigen::Ref< const Eigen::MatrixXd > &  particles,
const Eigen::Ref< const Eigen::VectorXd > &  weights,
const Eigen::Ref< const Eigen::VectorXd > &  previous_weights,
const Eigen::Ref< const Eigen::VectorXd > &  likelihoods,
const Eigen::Ref< const Eigen::MatrixXd > &  transition_probabilities,
const Statistics base_est_ext 
)
protected

Definition at line 266 of file EstimatesExtraction.cpp.

◆ weightedAverage()

VectorXd EstimatesExtraction::weightedAverage ( const Eigen::Ref< const Eigen::MatrixXd > &  particles,
const Eigen::Ref< const Eigen::VectorXd > &  weights,
const Eigen::Ref< const Eigen::VectorXd > &  previous_weights,
const Eigen::Ref< const Eigen::VectorXd > &  likelihoods,
const Eigen::Ref< const Eigen::MatrixXd > &  transition_probabilities,
const Statistics base_est_ext 
)
protected

Definition at line 296 of file EstimatesExtraction.cpp.

References bfl::utils::log_sum_exp().

Here is the call graph for this function:

Member Data Documentation

◆ circular_size_

std::size_t bfl::EstimatesExtraction::circular_size_
protected

Definition at line 103 of file EstimatesExtraction.h.

◆ em_weights_

Eigen::VectorXd bfl::EstimatesExtraction::em_weights_
protected

Definition at line 65 of file EstimatesExtraction.h.

◆ extraction_method_

ExtractionMethod bfl::EstimatesExtraction::extraction_method_ = ExtractionMethod::emode
protected

Definition at line 57 of file EstimatesExtraction.h.

Referenced by operator=().

◆ hist_buffer_

HistoryBuffer bfl::EstimatesExtraction::hist_buffer_
protected

Definition at line 59 of file EstimatesExtraction.h.

◆ linear_size_

std::size_t bfl::EstimatesExtraction::linear_size_
protected

Definition at line 101 of file EstimatesExtraction.h.

◆ sm_weights_

Eigen::VectorXd bfl::EstimatesExtraction::sm_weights_
protected

Definition at line 61 of file EstimatesExtraction.h.

◆ state_size_

std::size_t bfl::EstimatesExtraction::state_size_
protected

Definition at line 105 of file EstimatesExtraction.h.

◆ wm_weights_

Eigen::VectorXd bfl::EstimatesExtraction::wm_weights_
protected

Definition at line 63 of file EstimatesExtraction.h.


The documentation for this class was generated from the following files: