|
TRIQS/TRIQS 4.0.0
Researching Interacting Quantum Systems
|
Resampling algorithms for bias-corrected estimates of functions of averages.
Many physical observables of interest are non-linear functions of statistical averages, for which the naive estimate \( f(\overline{x}_1, \overline{x}_2, \ldots) \) carries a bias of order \( 1/N \) that has to be corrected.
triqs::stat::jackknife performs the delete-one jackknife resampling on one or more sample ranges and returns a tuple containing:
The MPI-aware variant triqs::stat::jackknife_mpi performs the same calculation on samples distributed across multiple ranks; results are made available on all ranks. Both functions accept any callable and any number of triqs::stat::StatCompatibleRange inputs.
Functions | |
| template<typename F, StatCompatibleRange R, StatCompatibleRange... Rs> requires (not std::same_as<std::remove_cvref_t<F>, mpi::communicator>) | |
| auto | triqs::stat::jackknife (F &&f, R &&rg, Rs &&...rgs) |
| Perform jackknife resampling. | |
| template<typename F, StatCompatibleRange R, StatCompatibleRange... Rs> | |
| auto | triqs::stat::jackknife_mpi (mpi::communicator comm, F &&f, R &&rg, Rs &&...rgs) |
| Perform jackknife resampling with MPI support. | |
| auto triqs::stat::jackknife | ( | F && | f, |
| R && | rg, | ||
| Rs &&... | rgs ) |
#include <triqs/stat/jackknife.hpp>
Perform jackknife resampling.
Calculate the value and error of a general function \( f \) of the averages of sampled observables using jackknife resampling.
Let \( \left( X_1, X_2, \ldots \right) \) denote the different observables and let \( \left\{ x_j^{(i)} : i = 1, \ldots, N \right\} \) be the set of their corresponding samples. We define the deleted averages
\[ \overline{x}_j(i) = \frac{1}{N - 1} \sum_{k \neq i} x_j^{(k)} = \frac{N \overline{x}_j - x_j^{(i)}}{N - 1} \; , \]
and their corresponding function evaluations
\[ \overline{f}(i) = f\left( \overline{x}_1(i), \overline{x}_2(i), \ldots \right) \; . \]
We can then calculate the following quantities:
| F | Callable type. |
| R | triqs::stat::StatCompatibleRange type. |
| Rs | triqs::stat::StatCompatibleRange types. |
| f | Callable to be applied to the averages of the sampled observables. |
| rg | Range containing the samples of one observable. |
| rgs | Range objects containing the samples of the other observables. |
Definition at line 120 of file jackknife.hpp.
| auto triqs::stat::jackknife_mpi | ( | mpi::communicator | comm, |
| F && | f, | ||
| R && | rg, | ||
| Rs &&... | rgs ) |
#include <triqs/stat/jackknife.hpp>
Perform jackknife resampling with MPI support.
See triqs::stat::jackknife for more details.
| F | Callable type. |
| R | triqs::stat::StatCompatibleRange type. |
| Rs | triqs::stat::StatCompatibleRange types. |
| comm | MPI communicator. |
| f | Callable to be applied to the averages of the sampled observables. |
| rg | Range containing the samples of one observable. |
| rgs | Range objects containing the samples of the other observables. |
Definition at line 140 of file jackknife.hpp.