RandLib 2.0.0
Probability distributions, fitting, and heavy-tail tools for C++20
Loading...
Searching...
No Matches
beta.hpp File Reference
#include <concepts>
#include <type_traits>
#include <randlib/math/constants.hpp>
#include <randlib/math/functions.hpp>
#include <randlib/math/gamma.hpp>
#include <randlib/math/quadrature.hpp>
#include <randlib/math/roots.hpp>
#include <randlib/math/optimize.hpp>
#include <randlib/math/special_functions.hpp>
Include dependency graph for math/beta.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

namespace  randlib
 
namespace  randlib::math
 Beta-related functions.
 
namespace  randlib::math::detail
 

Functions

template<std::floating_point Real>
Real randlib::math::logBeta (Real a, std::type_identity_t< Real > b)
 Calculate logarithm of beta function.
 
template<typename Left , typename Right >
requires (std::is_arithmetic_v<Left> && std::is_arithmetic_v<Right> && (std::integral<Left> || std::integral<Right> || !std::same_as<Left, Right>))
auto randlib::math::logBeta (Left a, Right b) -> std::common_type_t< double, Left, Right >
 
template<std::floating_point Real>
Real randlib::math::ibeta (Real x, std::type_identity_t< Real > a, std::type_identity_t< Real > b, std::type_identity_t< Real > logBetaFun, std::type_identity_t< Real > logX, std::type_identity_t< Real > log1mX)
 Fast calculation of regularized beta function, using precalculated values.
 
template<std::floating_point Real>
Real randlib::math::ibeta (Real x, std::type_identity_t< Real > a, std::type_identity_t< Real > b)
 Calculate regularized beta function.
 
template<std::floating_point Real>
Real randlib::math::ibetaPowerSeries1 (Real x, Real a, Real b, Real logBetaFun, Real logX, Real log1mX)
 
template<std::floating_point Real>
Real randlib::math::ibetacontinuedFraction1 (Real x, Real a, Real b, int number, Real logBetaFun, Real logX, Real log1mX)
 
template<std::floating_point Real>
Real randlib::math::ibetaPowerSeries2 (Real x, Real a, Real b, Real logBetaFun, Real logX, Real log1mX)
 
template<std::floating_point Real>
Real randlib::math::ibetaContinuedFraction2 (Real x, Real a, Real b, int number, Real logBetaFun, Real logX, Real log1mX)
 
template<std::floating_point Real>
Real randlib::math::ibetaContinuedFractionLentz (Real x, Real a, Real b, Real logBetaFun, Real logX, Real log1mX)
 Continued fraction of I(x, a, b) (DiDonato and Morris, also Numerical Recipes betacf) by the modified Lentz method; it converges for x below (a + 1) / (a + b + 2) in far fewer terms than b for large shapes.
 
template<std::floating_point Real>
Real randlib::math::ibetaLowerTail (Real x, Real a, Real b, Real logBetaFun, Real logX, Real log1mX)
 I(x, a, b) for x not above the mean a / (a + b) and shapes up to IBETA_LARGEST_FINITE_SHAPE.
 

Variables

constexpr double randlib::math::detail::IBETA_LARGEST_FINITE_SHAPE = 4096
 Beyond this size of a shape the finite continued fractions of ibetaLowerTail accumulate rounding errors, and its power series converge at the rate x close to 1.