TRIQS/TRIQS 4.0.0
Researching Interacting Quantum Systems
Loading...
Searching...
No Matches
Resampling techniques

Detailed Description

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 bias-corrected estimate \( f_{\mathrm{corr}} = N \overline{f} - (N - 1) \overline{f}_{\mathrm{JK}} \),
  • the jackknife error estimate \( s_f \),
  • the jackknife function estimate \( \overline{f}_{\mathrm{JK}} \), and
  • the naive estimate \( \overline{f} = f(\overline{x}_1, \overline{x}_2, \ldots) \).

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.

Function Documentation

◆ jackknife()

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 )

#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:

  • naive function estimate: \( \overline{f} = f(\overline{x}_1, \overline{x}_2 \ldots) \),
  • jackknife function estimate: \( \overline{f}_{\mathrm{JK}} = \frac{1}{N} \sum_{i = 1}^N \overline{f}(i) \),
  • bias corrected function estimate: \( f_{\mathrm{corr}} = N \overline{f} - (N - 1) \overline{f}_{\mathrm{JK}} \) and
  • jackknife error estimate: \( s_f^2 = \frac{N - 1}{N} \sum_{i = 1}^N \left( \overline{f}(i) - \overline{f}_{\mathrm{JK}} \right)^2 \).
Template Parameters
FCallable type.
Rtriqs::stat::StatCompatibleRange type.
Rstriqs::stat::StatCompatibleRange types.
Parameters
fCallable to be applied to the averages of the sampled observables.
rgRange containing the samples of one observable.
rgsRange objects containing the samples of the other observables.
Returns
std::tuple containing the bias corrected function estimate, the jackknife error estimate, the jackknife function estimate and the naive function estimate.

Definition at line 120 of file jackknife.hpp.

◆ jackknife_mpi()

template<typename F, StatCompatibleRange R, StatCompatibleRange... Rs>
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.

Template Parameters
FCallable type.
Rtriqs::stat::StatCompatibleRange type.
Rstriqs::stat::StatCompatibleRange types.
Parameters
commMPI communicator.
fCallable to be applied to the averages of the sampled observables.
rgRange containing the samples of one observable.
rgsRange objects containing the samples of the other observables.
Returns
std::tuple containing the bias corrected function estimate, the jackknife error estimate, the jackknife function estimate and the naive function estimate.

Definition at line 140 of file jackknife.hpp.