MCPcopy Create free account
hub / github.com/ObEngine/ObEngine / jackknife

Function jackknife

extlibs/catch/include/catch/catch.hpp:6791–6803  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

6789
6790 template <typename Estimator, typename Iterator>
6791 sample jackknife(Estimator&& estimator, Iterator first, Iterator last) {
6792 auto n = last - first;
6793 auto second = std::next(first);
6794 sample results;
6795 results.reserve(n);
6796
6797 for (auto it = first; it != last; ++it) {
6798 std::iter_swap(it, first);
6799 results.push_back(estimator(second, last));
6800 }
6801
6802 return results;
6803 }
6804
6805 inline double normal_cdf(double x) {
6806 return std::erfc(-x / std::sqrt(2.0)) / 2.0;

Callers 1

bootstrapFunction · 0.85

Calls 2

reserveMethod · 0.45
push_backMethod · 0.45

Tested by

no test coverage detected