TRIQS/TRIQS 4.0.0
Researching Interacting Quantum Systems
Loading...
Searching...
No Matches
mean_error.hpp
#include "./concepts.hpp"
#include "./utils.hpp"
#include <itertools/itertools.hpp>
#include <mpi/mpi.hpp>
#include <nda/mpi.hpp>
#include <nda/nda.hpp>
#include <numeric>
#include <optional>
#include <ranges>
#include <utility>

Detailed Description

Provides functions to calculate the arithmetic mean and standard error of a range of values.

Definition in file mean_error.hpp.

Go to the source code of this file.

Enumerations

enum class  triqs::stat::error_tag
 Tag to indicate what to calculate when computing the error of a range of values. More...
enum class  triqs::stat::mean_tag
 Tag to indicate what to calculate when computing the mean of a range of values. More...

Functions

template<error_tag etag, AccCompatible T>
void triqs::stat::apply_error_tag (T &sum_sq_devs, long nsamples)
 Given the sum of squared deviations from the mean, \( S^2 = \sum_{i=1}^N \left| x_i - \overline{x} \right|^2 \), and the number of samples \( N \), apply a transformation to get the result specified by the given error tag.
template<mean_tag mtag, AccCompatible T>
void triqs::stat::apply_mean_tag (T &m, long nsamples)
 Given the mean \( \overline{x} \) and the number of samples \( N \), apply a transformation to get the result specified by the given mean tag.
template<mean_tag mtag = mean_tag::mean, StatCompatibleRange R>
auto triqs::stat::mean (R &&rg)
 Calculate the arithmetic mean or the simple sum of some range of values.
template<error_tag etag = error_tag::err_mean, mean_tag mtag = mean_tag::mean, StatCompatibleRange R>
auto triqs::stat::mean_and_err (R &&rg)
 Calculate the arithmetic mean or the simple sum as well as a corresponding error estimate of some range of values.
template<error_tag etag = error_tag::err_mean, mean_tag mtag = mean_tag::mean, StatCompatibleRange R>
auto triqs::stat::mean_and_err_mpi (std::optional< mpi::communicator > c, R &&rg)
 Calculate the arithmetic mean or the simple sum as well as a corresponding error estimate of some range of values spread across multiple MPI processes.
template<mean_tag mtag = mean_tag::mean, StatCompatibleRange R>
auto triqs::stat::mean_mpi (std::optional< mpi::communicator > c, R &&rg)
 Calculate the arithmetic mean or the simple sum of some range of values spread across multiple MPI processes.
template<StatCompatible T>
auto triqs::stat::tau_estimate_from_errors (T const &s_n, T const &s_0)
 Compute an estimate for the integrated auto-correlation time from standard errors.
auto triqs::stat::tau_estimate_from_vars (auto const &var, auto const &var0)
 Compute an estimate for the integrated auto-correlation time from variances.