|  | Home | Libraries | People | FAQ | More | 
boost::accumulators::impl::peaks_over_threshold_impl — Peaks over Threshold Method for Quantile and Tail Mean Estimation.
// In header: <boost/accumulators/statistics/peaks_over_threshold.hpp> template<typename Sample, typename LeftRight> struct peaks_over_threshold_impl : public accumulator_base { // types typedef numeric::functional::fdiv< Sample, std::size_t >::result_type float_type; typedef boost::tuple< float_type, float_type, float_type > result_type; typedef mpl::int_< is_same< LeftRight, left >::value ? -1 :1 > sign; // construct/copy/destruct template<typename Args> peaks_over_threshold_impl(Args const &); // public member functions template<typename Args> void operator()(Args const &); template<typename Args> result_type result(Args const &) const; template<typename Archive> void serialize(Archive &, const unsigned int); };
According to the theorem of Pickands-Balkema-de Haan, the distribution function  of the excesses
 of the excesses  over some sufficiently high threshold
 over some sufficiently high threshold  of a distribution function
 of a distribution function  may be approximated by a generalized Pareto distribution
 may be approximated by a generalized Pareto distribution 
 with suitable parameters  and
 and  that can be estimated, e.g., with the method of moments, cf. Hosking and Wallis (1987),
 that can be estimated, e.g., with the method of moments, cf. Hosking and Wallis (1987), 
  and
 and  being the empirical mean and variance of the samples over the threshold
 being the empirical mean and variance of the samples over the threshold  . Equivalently, the distribution function
. Equivalently, the distribution function  of the exceedances
 of the exceedances  can be approximated by
 can be approximated by  . Since for
. Since for  the distribution function
 the distribution function  can be written as
 can be written as 
 and the probability  can be approximated by the empirical distribution function
 can be approximated by the empirical distribution function  evaluated at
 evaluated at  , an estimator of
, an estimator of  is given by
 is given by 
 It can be shown that  is a generalized Pareto distribution
 is a generalized Pareto distribution  with
 with  and
 and  . By inverting
. By inverting  , one obtains an estimator for the
, one obtains an estimator for the  -quantile,
-quantile, 
 and similarly an estimator for the (coherent) tail mean, 
 cf. McNeil and Frey (2000).
Note that in case extreme values of the left tail are fitted, the distribution is mirrored with respect to the  axis such that the left tail can be treated as a right tail. The computed fit parameters thus define the Pareto distribution that fits the mirrored left tail. When quantities like a quantile or a tail mean are computed using the fit parameters obtained from the mirrored data, the result is mirrored back, yielding the correct result.
 axis such that the left tail can be treated as a right tail. The computed fit parameters thus define the Pareto distribution that fits the mirrored left tail. When quantities like a quantile or a tail mean are computed using the fit parameters obtained from the mirrored data, the result is mirrored back, yielding the correct result.
For further details, see
J. R. M. Hosking and J. R. Wallis, Parameter and quantile estimation for the generalized Pareto distribution, Technometrics, Volume 29, 1987, p. 339-349
A. J. McNeil and R. Frey, Estimation of Tail-Related Risk Measures for Heteroscedastic Financial Time Series: an Extreme Value Approach, Journal of Empirical Finance, Volume 7, 2000, p. 271-300