RandLib 2.0.0
Probability distributions, fitting, and heavy-tail tools for C++20
Loading...
Searching...
No Matches
randlib Namespace Reference

Namespaces

namespace  consts
 
namespace  detail
 
namespace  legacy
 Engines of RandLib 1.x, kept for comparison with older results.
 
namespace  math
 Beta-related functions.
 

Classes

class  ArcsineRand
 The ArcsineRand class
Arcsine distribution. More...
 
class  AsymmetricLaplaceDistribution
 The AsymmetricLaplaceDistribution class
Abstract parent class for general Laplace and Asymmetric Laplace distributions. More...
 
class  AsymmetricLaplaceRand
 The AsymmetricLaplaceRand class
Asymmetric Laplace distribution. More...
 
class  BaldingNicholsRand
 The BaldingNicholsRand class
Balding-Nichols distribution. More...
 
class  BernoulliRand
 The BernoulliRand class
Bernoulli distribution. More...
 
struct  BestFitResult
 
class  BetaBinomialRand
 The BetaBinomialRand class
Beta-Binomial distribution. More...
 
class  BetaDistribution
 The BetaDistribution class
Abstract class for Beta distribution. More...
 
class  BetaPrimeRand
 The BetaPrimeRand class
Beta-prime distribution. More...
 
class  BetaRand
 The BetaRand class
Beta distribution. More...
 
class  BinomialDistribution
 The BinomialDistribution class
Abstract class for Binomial distribution. More...
 
class  BinomialRand
 The BinomialRand class
Binomial distribution. More...
 
class  BivariateDistribution
 The BivariateDistribution class
Abstract class for all bivariate probability distributions. More...
 
class  BivariateNormalRand
 The BivariateNormalRand class
Bivariate Gaussian (normal) distribution. More...
 
class  CantorRand
 The CantorRand class
Cantor distribution. More...
 
class  CategoricalRand
 The CategoricalRand class
More...
 
class  CauchyRand
 The CauchyRand class
Cauchy distribution. More...
 
struct  CensoredObservation
 
class  CenteredAsymmetricLaplaceRand
 The CenteredAsymmetricLaplaceRand class
Centered Laplace distribution. More...
 
class  ChiRand
 The ChiRand class
Chi distribution. More...
 
class  ChiSquaredRand
 The ChiSquaredRand class
Chi-squared distribution. More...
 
class  CircularDistribution
 The CircularDistribution class
Abstract class for all continuous circular distributions. More...
 
class  ContinuousBivariateDistribution
 The ContinuousBivariateDistribution class
Abstract class for all bivariate probability distributions with marginal continuous distributions. More...
 
class  ContinuousDistribution
 The ContinuousDistribution class
Abstract class for all continuous distributions. More...
 
struct  ContinuousGoodnessOfFit
 
class  DegenerateRand
 The DegenerateRand class
Degenerate distribution. More...
 
class  DiscreteBivariateDistribution
 The DiscreteBivariateDistribution class
Abstract class for all bivariate probability distributions with marginal discrete distributions. More...
 
class  DiscreteDistribution
 The DiscreteDistribution class
Abstract class for all discrete distributions. More...
 
struct  DiscreteGoodnessOfFit
 
class  ErlangRand
 The ErlangRand class
Erlang distibution. More...
 
class  ExponentialFamily
 
class  ExponentiallyModifiedGaussianRand
 The ExponentiallyModifiedGaussianRand class
Exponentially-modified Gaussian distribution. More...
 
class  ExponentialRand
 The ExponentialRand class
Exponential distribution. More...
 
class  FisherFRand
 The FisherFRand class
F-distribution. More...
 
class  fit_error
 The fit_error class Thrown when a distribution cannot be fitted to a sample; code() tells why. More...
 
struct  FitOptions
 
struct  FitResult
 
class  FrechetRand
 The FrechetRand class
Frechet distribution. More...
 
class  FreeRateGammaDistribution
 The FreeRateGammaDistribution class
Abstract class for Gamma distribution with arbitrary scale/rate. More...
 
class  GammaDistribution
 The GammaDistribution class
Abstract class for Gamma distribution. More...
 
class  GammaRand
 The GammaRand class
Gamma distribution. More...
 
class  GeneralGeometricStableDistribution
 The GeneralGeometricStableDistribution class Abstract class for general interface of Asymmetric Laplace and Geometric-Stable distributions. More...
 
class  GeneralizedExtremeValueRand
 
class  GeneralizedParetoRand
 
class  GeometricRand
 The GeometricRand class
Geometric distribution. More...
 
class  GeometricStableRand
 The GeometricStableRand class
Geometric-Stable distribution. More...
 
class  GumbelRand
 The GumbelRand class
Gumbel distribution. More...
 
class  HoltsmarkRand
 The HoltsmarkRand class
Holtsmark distribution. More...
 
class  HyperGeometricRand
 The HyperGeometricRand class
Hypergeometric distribution. More...
 
class  InverseGammaRand
 The InverseGammaRand class
Inverse-Gamma distribution. More...
 
class  InverseGaussianRand
 The InverseGaussianRand class
Inverse Gaussian (Wald) distribution. More...
 
class  IrwinHallRand
 The IrwinHallRand class
Irwin-Hall distribution. More...
 
class  KolmogorovSmirnovRand
 The KolmogorovSmirnovRand class
Kolmogorov-Smirnov distribution. More...
 
class  LandauRand
 The LandauRand class
Landau distribution. More...
 
class  LaplaceRand
 The LaplaceRand class
Laplace distribution. More...
 
class  LevyRand
 The LevyRand class
Levy distribution. More...
 
class  LogarithmicRand
 The LogarithmicRand class
Logarithmic distribution. More...
 
class  LogisticRand
 The LogisticRand class
Logistic distribution. More...
 
class  LogNormalRand
 The LogNormalRand class
Log-Normal distribution. More...
 
class  LogStableRand
 Exponential transform of a stable distribution. More...
 
class  MarchenkoPasturRand
 The MarchenkoPasturRand class
Marchenko-Pastur distribution. More...
 
class  MaxwellBoltzmannRand
 The MaxwellBoltzmannRand class
Maxwell-Boltzmann distribution. More...
 
class  NakagamiDistribution
 The NakagamiDistribution class
Abstract class for Nakagami distribution. More...
 
class  NakagamiRand
 The NakagamiRand class
Nakagami distribution. More...
 
class  NegativeBinomialDistribution
 The NegativeBinomialDistribution class
Abstract class for Negative binomial distribution. More...
 
class  NegativeBinomialRand
 The NegativeBinomialRand class
Negative binomial distribution. More...
 
class  NegativeHyperGeometricRand
 The NegativeHyperGeometricRand class
Negative hypergeometric distribution. More...
 
class  NoncentralChiSquaredRand
 The NoncentralChiSquaredRand class
Noncentral Chi-Squared distribution. More...
 
class  NoncentralTRand
 Noncentral Student's t-distribution. More...
 
class  NormalInverseGammaRand
 The NormalInverseGammaRand class
Normal-inverse-gamma distribution. More...
 
class  NormalRand
 The NormalRand class
Normal distribution. More...
 
class  not_implemented
 The not_implemented class Thrown when a quantity is not yet available for the given parameters, although the distribution itself is valid (for example, the stable density for exponents close to 1). More...
 
class  ParetoRand
 The ParetoRand class
Pareto distribution. More...
 
class  Pcg32
 The Pcg32 class
PCG-XSH-RR with 64 bits of state and 32-bit output (Melissa O'Neill, https://www.pcg-random.org), seeded exactly as the reference pcg32_srandom_r(seed, stream). More...
 
class  Pcg64
 The Pcg64 class
PCG-XSL-RR with 128 bits of state and 64-bit output, the pcg64 engine of the reference C++ library and of NumPy, seeded as pcg64(seed, stream). More...
 
class  PlanckRand
 The PlanckRand class
Planck distribution. More...
 
class  PoissonRand
 The PoissonRand class
Poisson distribution. More...
 
class  ProbabilityDistribution
 The ProbabilityDistribution class
Abstract class for all probability distributions. More...
 
class  RaabGreenRand
 The RaabGreenRand class
Raab-Green distribution. More...
 
class  RademacherRand
 The RademacherRand class
Rademacher distribution. More...
 
class  RaisedCosineDistribution
 The RaisedCosineDistribution class
Abstract class for Raised-cosine distribution. More...
 
class  RaisedCosineRand
 The RaisedCosineRand class
Raised-cosine distribution. More...
 
class  RayleighRand
 The RayleighRand class
Rayleigh distribution. More...
 
class  RiceRand
 Rice distribution. More...
 
class  SechRand
 The SechRand class
Hyperbolic secant distribution. More...
 
class  ShiftedAsymmetricLaplaceDistribution
 The ShiftedAsymmetricLaplaceDistribution class
Abstract parent class for shifted Laplace and Asymmetric Laplace distributions. More...
 
class  SingularDistribution
 The SingularDistribution class
Abstract class for all singular distributions. More...
 
class  SkellamRand
 The SkellamRand class
Skellam distribution. More...
 
class  SplitMix64
 The SplitMix64 class
Sebastiano Vigna's SplitMix64 generator. More...
 
class  StableCountRand
 Stable Count distribution. More...
 
class  StableDistribution
 The StableDistribution class
Abstract class for Stable distribution. More...
 
class  StableRand
 The StableRand class
Stable distribution. More...
 
class  StudentTRand
 The StudentTRand class
Student's t-distribution. More...
 
struct  TailIndexEstimate
 
class  TriangularRand
 The TriangularRand class
Triangular distribution. More...
 
class  TrinomialRand
 The TrinomialRand class
Trinomial distribution. More...
 
class  UniformDiscreteRand
 The UniformDiscreteRand class
Uniform discrete distribution. More...
 
class  UniformRand
 The UniformRand class
Uniform continuous distribution. More...
 
class  UnivariateDistribution
 The UnivariateDistribution class
Abstract class for all univariate probability distributions. More...
 
class  VonMisesRand
 The VonMisesRand class
Von-Mises distribution. More...
 
class  WeibullRand
 The WeibullRand class
Weibull distribution. More...
 
class  WignerSemicircleRand
 The WignerSemicircleRand class
Wigner-Semicircle distribution. More...
 
class  WrappedExponentialRand
 The WrappedExponentialRand class
Wrapped Exponential distribution. More...
 
class  Xoshiro256pp
 The Xoshiro256pp class
xoshiro256++ 1.0 by David Blackman and Sebastiano Vigna: 256 bits of state, period 2^256 - 1. More...
 
class  YuleRand
 The YuleRand class
Yule distribution. More...
 
class  ZetaRand
 The ZetaRand class
Zeta distribution. More...
 
class  ZipfRand
 The ZipfRand class
Zipf distribution. More...
 

Typedefs

template<typename T >
using Pair = std::pair< T, T >
 
template<typename T >
using Triplet = std::tuple< T, T, T >
 
using IntPair = Pair< int >
 
using DoublePair = Pair< double >
 
using LongDoublePair = Pair< long double >
 
using IntTriplet = Triplet< int >
 
using DoubleTriplet = Triplet< double >
 
using LongDoubleTriplet = Triplet< long double >
 
template<typename IntType = int>
using PascalRand = NegativeBinomialRand< IntType, int >
 
template<typename IntType = int>
using PolyaRand = NegativeBinomialRand< IntType, double >
 
using DefaultEngine = Xoshiro256pp
 The engine used by default, including by the per-instance engines of the distributions.
 

Enumerations

enum class  FitErrorCode {
  WrongSample , NotApplicable , WrongReturn , TooFewElements ,
  WrongLevel , Undefined
}
 Reason why a distribution could not be fitted to a sample. More...
 
enum class  Support { Finite , RightSemiFinite , LeftSemiFinite , Infinite }
 Shape of the support of a univariate distribution. More...
 
enum class  Censoring { Exact , Left , Right , Interval }
 
enum class  Method {
  MLE , MethodOfMoments , UMVU , Bayes ,
  Quantile
}
 
enum class  Criterion { AIC , BIC }
 

Functions

double stableTailQuantile (double p, bool upperTail, double alpha, double beta, double gamma, double mu)
 Quantile of the power-law tails of a stable law with α < 2: P(X > x) ~ C (1 + β) γ^α x^(-α) and P(X < -x) ~ C (1 - β) γ^α x^(-α) as x → ∞, with C = Γ(α) sin(πα/2) / π (1/π for α = 1).
 
std::uint64_t random_seed ()
 
template<class Engine = DefaultEngine>
Engine seed_from (std::seed_seq &sequence)
 
template<class Engine = DefaultEngine>
std::vector< Engine > make_streams (std::uint64_t seed, std::size_t count)
 Engines for parallel simulations, one per thread: consecutive jump() calls for engines that have them (non-overlapping by construction), distinct PCG streams for Pcg32 and Pcg64, and seeds derived with SplitMix64 for any other engine.
 
template<class Distribution , class Prior >
requires detail::ConjugateModel<Distribution, Prior>
auto fit_bayes (std::span< const typename Distribution::value_type > sample, const Prior &prior)
 
template<class Distribution , std::ranges::contiguous_range Range, class Prior >
requires std::same_as<std::remove_cv_t<std::ranges::range_value_t<Range>>, typename Distribution::value_type> && detail::ConjugateModel<Distribution, Prior>
auto fit_bayes (const Range &sample, const Prior &prior)
 
template<class Distribution , std::ranges::contiguous_range Range, class Prior , class Fixed >
requires std::same_as<std::remove_cv_t<std::ranges::range_value_t<Range>>, typename Distribution::value_type> && detail::ConditionalConjugateModel<Distribution, Prior, Fixed>
auto fit_bayes (const Range &sample, const Prior &prior, Fixed fixed)
 
template<std::ranges::contiguous_range Range, std::floating_point Real>
requires std::same_as<std::remove_cv_t<std::ranges::range_value_t<Range>>, Real>
auto fit_bayes (const Range &sample, const NormalInverseGammaRand< Real > &prior)
 
template<std::ranges::contiguous_range Range, std::floating_point Real>
requires std::same_as<std::remove_cv_t<std::ranges::range_value_t<Range>>, Real>
auto fit_bayes (const Range &sample, const GammaRand< Real > &prior)
 
template<std::ranges::contiguous_range Range>
requires std::integral<std::remove_cv_t<std::ranges::range_value_t<Range>>>
auto fit_bayes (const Range &sample, const GammaRand< double > &prior)
 
template<class Distribution >
requires std::floating_point<typename Distribution::value_type> && detail::FittableModel<Distribution>
FitResult< Distribution > fit_censored (std::span< const CensoredObservation< typename Distribution::value_type > > observations, FitOptions options={})
 
template<class Distribution , std::ranges::contiguous_range Range>
requires std::floating_point<typename Distribution::value_type> && detail::FittableModel<Distribution> && std::same_as<std::remove_cv_t<std::ranges::range_value_t<Range>>, CensoredObservation<typename Distribution::value_type>> && (!std::same_as<std::remove_cvref_t<Range>, std::span<const CensoredObservation<typename Distribution::value_type>>>)
FitResult< Distribution > fit_censored (const Range &observations, FitOptions options={})
 
template<class Distribution >
requires std::floating_point<typename Distribution::value_type> && detail::FittableModel<Distribution>
FitResult< Distribution > fit_truncated (std::span< const typename Distribution::value_type > sample, typename Distribution::value_type lower, typename Distribution::value_type upper, FitOptions options={})
 
template<class Distribution , std::ranges::contiguous_range Range>
requires std::floating_point<typename Distribution::value_type> && detail::FittableModel<Distribution> && std::same_as<std::remove_cv_t<std::ranges::range_value_t<Range>>, typename Distribution::value_type> && (!std::same_as<std::remove_cvref_t<Range>, std::span<const typename Distribution::value_type>>)
FitResult< Distribution > fit_truncated (const Range &sample, typename Distribution::value_type lower, typename Distribution::value_type upper, FitOptions options={})
 
template<class Distribution >
requires std::floating_point<typename Distribution::value_type>
ContinuousGoodnessOfFit goodness_of_fit (const Distribution &distribution, std::span< const typename Distribution::value_type > sample)
 
template<class Distribution >
requires std::integral<typename Distribution::value_type>
DiscreteGoodnessOfFit goodness_of_fit (const Distribution &distribution, std::span< const typename Distribution::value_type > sample, int estimatedParameters=0)
 
template<class Distribution , std::ranges::contiguous_range Range>
requires std::same_as<std::remove_cv_t<std::ranges::range_value_t<Range>>, typename Distribution::value_type>
auto goodness_of_fit (const Distribution &distribution, const Range &sample)
 
template<class Distribution , std::ranges::contiguous_range Range>
requires std::integral<typename Distribution::value_type> && std::same_as<std::remove_cv_t<std::ranges::range_value_t<Range>>, typename Distribution::value_type>
DiscreteGoodnessOfFit goodness_of_fit (const Distribution &distribution, const Range &sample, int estimatedParameters)
 
template<class Distribution >
requires detail::FittableModel<Distribution>
FitResult< Distribution > fit (std::span< const typename Distribution::value_type > sample, FitOptions options={})
 
template<class Distribution >
requires detail::FittableModel<Distribution>
FitResult< Distribution > fit (std::span< const typename Distribution::value_type > sample, Method method)
 
template<class Distribution >
requires detail::FittableModel<Distribution>
FitResult< Distribution > fit_moments (std::span< const typename Distribution::value_type > sample)
 
template<class Distribution , std::ranges::contiguous_range Range>
requires std::same_as<std::remove_cv_t<std::ranges::range_value_t<Range>>, typename Distribution::value_type> && detail::FittableModel<Distribution>
FitResult< Distribution > fit_moments (const Range &sample)
 
template<class First , class... Rest>
requires (detail::FittableModel<First> && ... && detail::FittableModel<Rest>) && (std::same_as<typename First::value_type, typename Rest::value_type> && ...)
BestFitResult< First, Rest... > fit_best (std::span< const typename First::value_type > sample, Criterion criterion)
 
template<class First , class... Rest, std::ranges::contiguous_range Range>
requires std::same_as<std::remove_cv_t<std::ranges::range_value_t<Range>>, typename First::value_type> && (detail::FittableModel<First> && ... && detail::FittableModel<Rest>) && (std::same_as<typename First::value_type, typename Rest::value_type> && ...)
BestFitResult< First, Rest... > fit_best (const Range &sample, Criterion criterion)
 
template<std::floating_point Real>
double hill_estimator (std::span< const Real > sample, std::size_t order)
 
template<std::ranges::contiguous_range Range>
requires std::floating_point<std::remove_cv_t<std::ranges::range_value_t<Range>>> && (!std::same_as<std::remove_cvref_t<Range>, std::span<const std::remove_cv_t<std::ranges::range_value_t<Range>>>>)
double hill_estimator (const Range &sample, std::size_t order)
 
template<std::floating_point Real>
std::vector< TailIndexEstimate > hill_plot (std::span< const Real > sample, std::size_t maximumOrder=0)
 
template<std::ranges::contiguous_range Range>
requires std::floating_point<std::remove_cv_t<std::ranges::range_value_t<Range>>> && (!std::same_as<std::remove_cvref_t<Range>, std::span<const std::remove_cv_t<std::ranges::range_value_t<Range>>>>)
std::vector< TailIndexEstimate > hill_plot (const Range &sample, std::size_t maximumOrder=0)
 
template<std::floating_point Real>
double pickands_estimator (std::span< const Real > sample, std::size_t order)
 
template<std::ranges::contiguous_range Range>
requires std::floating_point<std::remove_cv_t<std::ranges::range_value_t<Range>>> && (!std::same_as<std::remove_cvref_t<Range>, std::span<const std::remove_cv_t<std::ranges::range_value_t<Range>>>>)
double pickands_estimator (const Range &sample, std::size_t order)
 
template<std::floating_point Real>
FitResult< GeneralizedParetoRand< Real > > fit_peaks_over_threshold (std::span< const Real > sample, Real threshold, FitOptions options={})
 
template<std::ranges::contiguous_range Range>
requires std::floating_point<std::remove_cv_t<std::ranges::range_value_t<Range>>> && (!std::same_as<std::remove_cvref_t<Range>, std::span<const std::remove_cv_t<std::ranges::range_value_t<Range>>>>)
auto fit_peaks_over_threshold (const Range &sample, std::ranges::range_value_t< Range > threshold, FitOptions options={})
 

Typedef Documentation

◆ DefaultEngine

The engine used by default, including by the per-instance engines of the distributions.

◆ DoublePair

using randlib::DoublePair = typedef Pair<double>

◆ DoubleTriplet

using randlib::DoubleTriplet = typedef Triplet<double>

◆ IntPair

using randlib::IntPair = typedef Pair<int>

◆ IntTriplet

using randlib::IntTriplet = typedef Triplet<int>

◆ LongDoublePair

using randlib::LongDoublePair = typedef Pair<long double>

◆ LongDoubleTriplet

using randlib::LongDoubleTriplet = typedef Triplet<long double>

◆ Pair

template<typename T >
using randlib::Pair = typedef std::pair<T, T>

◆ PascalRand

template<typename IntType = int>
using randlib::PascalRand = typedef NegativeBinomialRand<IntType, int>

◆ PolyaRand

template<typename IntType = int>
using randlib::PolyaRand = typedef NegativeBinomialRand<IntType, double>

◆ Triplet

template<typename T >
using randlib::Triplet = typedef std::tuple<T, T, T>

Enumeration Type Documentation

◆ Censoring

enum class randlib::Censoring
strong
Enumerator
Exact 
Left 
Right 
Interval 

◆ Criterion

enum class randlib::Criterion
strong
Enumerator
AIC 
BIC 

◆ FitErrorCode

enum class randlib::FitErrorCode
strong

Reason why a distribution could not be fitted to a sample.

Enumerator
WrongSample 

the sample could not have been drawn from this distribution

NotApplicable 

the method cannot be applied to this distribution or sample

WrongReturn 

the method returned invalid parameters

TooFewElements 

the sample is too small

WrongLevel 

the significance level is not in (0, 1)

Undefined 

any other failure

◆ Method

enum class randlib::Method
strong
Enumerator
MLE 
MethodOfMoments 
UMVU 
Bayes 
Quantile 

◆ Support

enum class randlib::Support
strong

Shape of the support of a univariate distribution.

Enumerator
Finite 

[a, b]

RightSemiFinite 

[a, ∞)

LeftSemiFinite 

(-∞, b]

Infinite 

(-∞, ∞)

Function Documentation

◆ fit() [1/2]

template<class Distribution >
requires detail::FittableModel<Distribution>
FitResult< Distribution > randlib::fit ( std::span< const typename Distribution::value_type >  sample,
FitOptions  options = {} 
)

◆ fit() [2/2]

template<class Distribution >
requires detail::FittableModel<Distribution>
FitResult< Distribution > randlib::fit ( std::span< const typename Distribution::value_type >  sample,
Method  method 
)

◆ fit_bayes() [1/6]

template<std::ranges::contiguous_range Range>
requires std::integral<std::remove_cv_t<std::ranges::range_value_t<Range>>>
auto randlib::fit_bayes ( const Range &  sample,
const GammaRand< double > &  prior 
)

◆ fit_bayes() [2/6]

template<std::ranges::contiguous_range Range, std::floating_point Real>
requires std::same_as<std::remove_cv_t<std::ranges::range_value_t<Range>>, Real>
auto randlib::fit_bayes ( const Range &  sample,
const GammaRand< Real > &  prior 
)

◆ fit_bayes() [3/6]

template<std::ranges::contiguous_range Range, std::floating_point Real>
requires std::same_as<std::remove_cv_t<std::ranges::range_value_t<Range>>, Real>
auto randlib::fit_bayes ( const Range &  sample,
const NormalInverseGammaRand< Real > &  prior 
)

◆ fit_bayes() [4/6]

template<class Distribution , std::ranges::contiguous_range Range, class Prior >
requires std::same_as<std::remove_cv_t<std::ranges::range_value_t<Range>>, typename Distribution::value_type> && detail::ConjugateModel<Distribution, Prior>
auto randlib::fit_bayes ( const Range &  sample,
const Prior &  prior 
)

◆ fit_bayes() [5/6]

template<class Distribution , std::ranges::contiguous_range Range, class Prior , class Fixed >
requires std::same_as<std::remove_cv_t<std::ranges::range_value_t<Range>>, typename Distribution::value_type> && detail::ConditionalConjugateModel<Distribution, Prior, Fixed>
auto randlib::fit_bayes ( const Range &  sample,
const Prior &  prior,
Fixed  fixed 
)

◆ fit_bayes() [6/6]

template<class Distribution , class Prior >
requires detail::ConjugateModel<Distribution, Prior>
auto randlib::fit_bayes ( std::span< const typename Distribution::value_type >  sample,
const Prior &  prior 
)

◆ fit_best() [1/2]

template<class First , class... Rest, std::ranges::contiguous_range Range>
requires std::same_as<std::remove_cv_t<std::ranges::range_value_t<Range>>, typename First::value_type> && (detail::FittableModel<First> && ... && detail::FittableModel<Rest>) && (std::same_as<typename First::value_type, typename Rest::value_type> && ...)
BestFitResult< First, Rest... > randlib::fit_best ( const Range &  sample,
Criterion  criterion 
)

◆ fit_best() [2/2]

template<class First , class... Rest>
requires (detail::FittableModel<First> && ... && detail::FittableModel<Rest>) && (std::same_as<typename First::value_type, typename Rest::value_type> && ...)
BestFitResult< First, Rest... > randlib::fit_best ( std::span< const typename First::value_type >  sample,
Criterion  criterion 
)

◆ fit_censored() [1/2]

template<class Distribution , std::ranges::contiguous_range Range>
requires std::floating_point<typename Distribution::value_type> && detail::FittableModel<Distribution> && std::same_as<std::remove_cv_t<std::ranges::range_value_t<Range>>, CensoredObservation<typename Distribution::value_type>> && (!std::same_as<std::remove_cvref_t<Range>, std::span<const CensoredObservation<typename Distribution::value_type>>>)
FitResult< Distribution > randlib::fit_censored ( const Range &  observations,
FitOptions  options = {} 
)

◆ fit_censored() [2/2]

template<class Distribution >
requires std::floating_point<typename Distribution::value_type> && detail::FittableModel<Distribution>
FitResult< Distribution > randlib::fit_censored ( std::span< const CensoredObservation< typename Distribution::value_type > >  observations,
FitOptions  options = {} 
)

◆ fit_moments() [1/2]

template<class Distribution , std::ranges::contiguous_range Range>
requires std::same_as<std::remove_cv_t<std::ranges::range_value_t<Range>>, typename Distribution::value_type> && detail::FittableModel<Distribution>
FitResult< Distribution > randlib::fit_moments ( const Range &  sample)

◆ fit_moments() [2/2]

template<class Distribution >
requires detail::FittableModel<Distribution>
FitResult< Distribution > randlib::fit_moments ( std::span< const typename Distribution::value_type >  sample)

◆ fit_peaks_over_threshold() [1/2]

template<std::ranges::contiguous_range Range>
requires std::floating_point<std::remove_cv_t<std::ranges::range_value_t<Range>>> && (!std::same_as<std::remove_cvref_t<Range>, std::span<const std::remove_cv_t<std::ranges::range_value_t<Range>>>>)
auto randlib::fit_peaks_over_threshold ( const Range &  sample,
std::ranges::range_value_t< Range >  threshold,
FitOptions  options = {} 
)

◆ fit_peaks_over_threshold() [2/2]

template<std::floating_point Real>
FitResult< GeneralizedParetoRand< Real > > randlib::fit_peaks_over_threshold ( std::span< const Real >  sample,
Real  threshold,
FitOptions  options = {} 
)

◆ fit_truncated() [1/2]

template<class Distribution , std::ranges::contiguous_range Range>
requires std::floating_point<typename Distribution::value_type> && detail::FittableModel<Distribution> && std::same_as<std::remove_cv_t<std::ranges::range_value_t<Range>>, typename Distribution::value_type> && (!std::same_as<std::remove_cvref_t<Range>, std::span<const typename Distribution::value_type>>)
FitResult< Distribution > randlib::fit_truncated ( const Range &  sample,
typename Distribution::value_type  lower,
typename Distribution::value_type  upper,
FitOptions  options = {} 
)

◆ fit_truncated() [2/2]

template<class Distribution >
requires std::floating_point<typename Distribution::value_type> && detail::FittableModel<Distribution>
FitResult< Distribution > randlib::fit_truncated ( std::span< const typename Distribution::value_type >  sample,
typename Distribution::value_type  lower,
typename Distribution::value_type  upper,
FitOptions  options = {} 
)

◆ goodness_of_fit() [1/4]

template<class Distribution , std::ranges::contiguous_range Range>
requires std::same_as<std::remove_cv_t<std::ranges::range_value_t<Range>>, typename Distribution::value_type>
auto randlib::goodness_of_fit ( const Distribution &  distribution,
const Range &  sample 
)

◆ goodness_of_fit() [2/4]

template<class Distribution , std::ranges::contiguous_range Range>
requires std::integral<typename Distribution::value_type> && std::same_as<std::remove_cv_t<std::ranges::range_value_t<Range>>, typename Distribution::value_type>
DiscreteGoodnessOfFit randlib::goodness_of_fit ( const Distribution &  distribution,
const Range &  sample,
int  estimatedParameters 
)

◆ goodness_of_fit() [3/4]

template<class Distribution >
requires std::floating_point<typename Distribution::value_type>
ContinuousGoodnessOfFit randlib::goodness_of_fit ( const Distribution &  distribution,
std::span< const typename Distribution::value_type >  sample 
)

◆ goodness_of_fit() [4/4]

template<class Distribution >
requires std::integral<typename Distribution::value_type>
DiscreteGoodnessOfFit randlib::goodness_of_fit ( const Distribution &  distribution,
std::span< const typename Distribution::value_type >  sample,
int  estimatedParameters = 0 
)

◆ hill_estimator() [1/2]

template<std::ranges::contiguous_range Range>
requires std::floating_point<std::remove_cv_t<std::ranges::range_value_t<Range>>> && (!std::same_as<std::remove_cvref_t<Range>, std::span<const std::remove_cv_t<std::ranges::range_value_t<Range>>>>)
double randlib::hill_estimator ( const Range &  sample,
std::size_t  order 
)

◆ hill_estimator() [2/2]

template<std::floating_point Real>
double randlib::hill_estimator ( std::span< const Real >  sample,
std::size_t  order 
)

◆ hill_plot() [1/2]

template<std::ranges::contiguous_range Range>
requires std::floating_point<std::remove_cv_t<std::ranges::range_value_t<Range>>> && (!std::same_as<std::remove_cvref_t<Range>, std::span<const std::remove_cv_t<std::ranges::range_value_t<Range>>>>)
std::vector< TailIndexEstimate > randlib::hill_plot ( const Range &  sample,
std::size_t  maximumOrder = 0 
)

◆ hill_plot() [2/2]

template<std::floating_point Real>
std::vector< TailIndexEstimate > randlib::hill_plot ( std::span< const Real >  sample,
std::size_t  maximumOrder = 0 
)

◆ make_streams()

template<class Engine = DefaultEngine>
std::vector< Engine > randlib::make_streams ( std::uint64_t  seed,
std::size_t  count 
)

Engines for parallel simulations, one per thread: consecutive jump() calls for engines that have them (non-overlapping by construction), distinct PCG streams for Pcg32 and Pcg64, and seeds derived with SplitMix64 for any other engine.

Parameters
seedcommon seed
countnumber of engines

◆ pickands_estimator() [1/2]

template<std::ranges::contiguous_range Range>
requires std::floating_point<std::remove_cv_t<std::ranges::range_value_t<Range>>> && (!std::same_as<std::remove_cvref_t<Range>, std::span<const std::remove_cv_t<std::ranges::range_value_t<Range>>>>)
double randlib::pickands_estimator ( const Range &  sample,
std::size_t  order 
)

◆ pickands_estimator() [2/2]

template<std::floating_point Real>
double randlib::pickands_estimator ( std::span< const Real >  sample,
std::size_t  order 
)

◆ random_seed()

std::uint64_t randlib::random_seed ( )
inline
Returns
non-deterministic 64-bit seed: std::random_device mixed with a high-resolution clock and the thread id through SplitMix64

◆ seed_from()

template<class Engine = DefaultEngine>
Engine randlib::seed_from ( std::seed_seq &  sequence)
Parameters
sequenceseed sequence that fills the whole state of the engine
Returns
engine seeded from the sequence

◆ stableTailQuantile()

double randlib::stableTailQuantile ( double  p,
bool  upperTail,
double  alpha,
double  beta,
double  gamma,
double  mu 
)
inline

Quantile of the power-law tails of a stable law with α < 2: P(X > x) ~ C (1 + β) γ^α x^(-α) and P(X < -x) ~ C (1 - β) γ^α x^(-α) as x → ∞, with C = Γ(α) sin(πα/2) / π (1/π for α = 1).

Geometric stable laws have the same tails.

Parameters
pprobability of the tail, small
upperTailtrue for P(X > x) = p, false for P(X < x) = p
alphacharacteristic exponent
betaskewness
gammascale
mulocation
Returns
asymptotic quantile, or NaN if that tail is not a power law