24#ifndef quantlib_loss_distribution_hpp
25#define quantlib_loss_distribution_hpp
40 const std::vector<Real>& probabilities)
const = 0;
101 const std::vector<Real>& probabilities)
const override;
143 const std::vector<Real>& probabilities)
const override;
176 const std::vector<Real>& probabilities)
const override;
196 long seed = 42,
Real epsilon = 1e-6)
200 const std::vector<Real>& probabilities)
const override;
Probability of at least N events.
BinomialProbabilityOfAtLeastNEvents(int n)
Real operator()(std::vector< Real > p) const
Binomial loss distribution.
Size buckets() const override
std::vector< Real > excessProbability_
std::vector< Real > probability_
std::vector< Real > probability() const
std::vector< Real > excessProbability() const
Real maximum() const override
LossDistBinomial(Size nBuckets, Real maximum)
Distribution operator()(Size n, Real volume, Real probability) const
Loss distribution with Hull-White bucketing.
Distribution operator()(const std::vector< Real > &volumes, const std::vector< Real > &probabilities) const override
Size buckets() const override
int locateTargetBucket(Real loss, Size i0=0) const
Real maximum() const override
LossDistBucketing(Size nBuckets, Real maximum, Real epsilon=1e-6)
Loss Distribution for Homogeneous Pool.
Size buckets() const override
std::vector< Real > excessProbability_
std::vector< Real > probability_
LossDistHomogeneous(Size nBuckets, Real maximum)
Distribution operator()(Real volume, const std::vector< Real > &probabilities) const
std::vector< Real > probability() const
std::vector< Real > excessProbability() const
Real maximum() const override
Probability formulas and algorithms.
static Real binomialProbabilityOfAtLeastNEvents(int n, std::vector< Real > &p)
static std::vector< Real > probabilityOfNEvents(std::vector< Real > &p)
virtual ~LossDist()=default
virtual Real maximum() const =0
virtual Distribution operator()(const std::vector< Real > &volumes, const std::vector< Real > &probabilities) const =0
virtual Size buckets() const =0
static Real probabilityOfAtLeastNEvents(int n, std::vector< Real > &p)
static Real binomialProbabilityOfNEvents(int n, std::vector< Real > &p)
Loss distribution with Monte Carlo simulation.
Distribution operator()(const std::vector< Real > &volumes, const std::vector< Real > &probabilities) const override
Size buckets() const override
LossDistMonteCarlo(Size nBuckets, Real maximum, Size simulations, long seed=42, Real epsilon=1e-6)
Real maximum() const override
Probability of at least N events.
ProbabilityOfAtLeastNEvents(int n)
Real operator()(std::vector< Real > p) const
ProbabilityOfNEvents(int n)
Real operator()(std::vector< Real > p) const
Discretized probability density and cumulative probability.
std::size_t Size
size of a container
One-factor copula base class.