ssmkit  master-68aed98
ess.hpp
Go to the documentation of this file.
1 
7 #ifndef SSMPACK_FILTER_RESAMPLER_CRITERION_ESS
8 #define SSMPACK_FILTER_RESAMPLER_CRITERION_ESS
9 
10 #include <armadillo>
11 
12 namespace ssmkit {
13 namespace filter {
14 namespace resampler {
15 namespace criterion {
16 
17 struct ESS{
18  double th;
22  ESS(double threshold) : th{threshold} {}
23  ESS() = delete;
28  bool operator()(const arma::vec &w){
29  return arma::sum(w)/arma::sum(arma::square(w)) < th;
30  }
31 
32 };
33 } // namespace criterion
34 } // namespace resampler
35 } // namespace filter
36 } // namespace ssmkit
37 #endif // SSMPACK_FILTER_RESAMPLER_CRITERION_ESS
bool operator()(const arma::vec &w)
return true if number of effective samples with weights w falls bellow the threshold ...
Definition: ess.hpp:28