.. Generated automatically by cpp2rst .. highlight:: c .. role:: red .. role:: green .. role:: param .. _triqs__stat__jackknife: triqs::stat::jackknife ====================== *#include * **Synopsis** .. rst-class:: cppsynopsis 1. | :green:`template` | auto :red:`jackknife` (F && :param:`f`, A const &... :param:`a`) 2. | :green:`template` | auto :red:`jackknife` (F && :param:`f`, accumulator const &... :param:`a`) Calculate the value and error of a general function :math:`f` of the average of sampled observables :math:`f\left(\langle \mathbf{a} \rangle\right)`, using jackknife resampling. **1)** Directly pass data-series in vector like objects **2)** Pass :ref:`accumulators `, where the jacknife acts on the :ref:`linear binned data ` Template parameters ^^^^^^^^^^^^^^^^^^^ * :param:`F` return type of function :param:`f` which acts on data * :param:`A` vector-like object, defining size() and [] * :param:`T` type of data stored in the accumulators Parameters ^^^^^^^^^^ * :param:`a` one or multiple series with data: :math:`\mathbf{a} = \{a_1, a_2, a_3, \ldots\}` Pre-condition: if more than one series is passed, the series have to be equal in size * :param:`f` a function which acts on the :math:`i^\mathrm{th}` elements of the series in :param:`a`: .. math:: \left(a_1[i], a_2[i],a_3[i],\ldots\right) \to f\left(a_1[i],a_2[i],a_3[i],\ldots\right) .. Returns ^^^^^^^ std::tuple with four statistical estimators :math:`\left(f_\mathrm{J}^{*}, \Delta{f}_\mathrm{J}, f_\mathrm{J}, f_\mathrm{direct}\right)`, defined below. Jackknife resampling takes :math:`N` data points :math:`\mathbf{a}[i]` and creates :math:`N` samples ("jackknifed data"), which we denote :math:`\tilde{\mathbf{a}}[i]`. We calculate three statistical estimators for :math:`f\left(\langle \mathbf{a} \rangle\right)`: * The function :math:`f` applied to observed mean of the data .. math:: f_\mathrm{direct} = f\left(\bar{\mathbf{a}}\right),\quad \bar{\mathbf{a}} = \frac{1}{N}\sum_{i=0}^{N}\mathbf{a}[i] .. * The jacknife estimate defined as .. math:: f_\mathrm{J} = \frac{1}{N}\sum_{i=0}^N f(\tilde{\mathbf{a}}[i]) .. * The jacknife estimate, with bias correction to remove :math:`O(1/N)` effects .. math:: f_\mathrm{J}^{*} = N f_\mathrm{direct} - (N - 1) f_\mathrm{J} .. Additionally, an estimate in the errror of :math:`f\left(\langle \mathbf{a} \rangle\right)` is given by the jacknife as .. math:: \Delta{f}_J = \sqrt{N-1} \cdot \sigma_f .. where :math:`\sigma_f` is the standard deviation of :math:`\left\{f(\tilde{\mathbf{a}}[0]), f(\tilde{\mathbf{a}}[1]), \ldots, f(\tilde{\mathbf{a}}[N])\right\}`.