QuantLib: a free/open-source library for quantitative finance
fully annotated source code - version 1.34
Loading...
Searching...
No Matches
Public Member Functions | Private Attributes | List of all members
LossDistBinomial Class Reference

Binomial loss distribution. More...

#include <lossdistribution.hpp>

+ Inheritance diagram for LossDistBinomial:
+ Collaboration diagram for LossDistBinomial:

Public Member Functions

 LossDistBinomial (Size nBuckets, Real maximum)
 
Distribution operator() (Size n, Real volume, Real probability) const
 
Distribution operator() (const std::vector< Real > &volumes, const std::vector< Real > &probabilities) const override
 
Size buckets () const override
 
Real maximum () const override
 
Real volume () const
 
Size size () const
 
std::vector< Realprobability () const
 
std::vector< RealexcessProbability () const
 
- Public Member Functions inherited from LossDist
 LossDist ()=default
 
virtual ~LossDist ()=default
 
virtual Distribution operator() (const std::vector< Real > &volumes, const std::vector< Real > &probabilities) const =0
 
virtual Size buckets () const =0
 
virtual Real maximum () const =0
 

Private Attributes

Size nBuckets_
 
Real maximum_
 
Real volume_
 
Size n_
 
std::vector< Realprobability_
 
std::vector< RealexcessProbability_
 

Additional Inherited Members

- Static Public Member Functions inherited from LossDist
static Real binomialProbabilityOfNEvents (int n, std::vector< Real > &p)
 
static Real binomialProbabilityOfAtLeastNEvents (int n, std::vector< Real > &p)
 
static std::vector< RealprobabilityOfNEvents (std::vector< Real > &p)
 
static Real probabilityOfNEvents (int n, std::vector< Real > &p)
 
static Real probabilityOfAtLeastNEvents (int n, std::vector< Real > &p)
 

Detailed Description

Binomial loss distribution.

Definition at line 95 of file lossdistribution.hpp.

Constructor & Destructor Documentation

◆ LossDistBinomial()

LossDistBinomial ( Size  nBuckets,
Real  maximum 
)

Definition at line 97 of file lossdistribution.hpp.

Member Function Documentation

◆ operator()() [1/2]

Distribution operator() ( Size  n,
Real  volume,
Real  probability 
) const

Definition at line 146 of file lossdistribution.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ operator()() [2/2]

Distribution operator() ( const std::vector< Real > &  volumes,
const std::vector< Real > &  probabilities 
) const
overridevirtual

Implements LossDist.

Definition at line 175 of file lossdistribution.cpp.

+ Here is the call graph for this function:

◆ buckets()

Size buckets ( ) const
overridevirtual

Implements LossDist.

Definition at line 102 of file lossdistribution.hpp.

◆ maximum()

Real maximum ( ) const
overridevirtual

Implements LossDist.

Definition at line 103 of file lossdistribution.hpp.

◆ volume()

Real volume ( ) const

Definition at line 104 of file lossdistribution.hpp.

+ Here is the caller graph for this function:

◆ size()

Size size ( ) const

Definition at line 105 of file lossdistribution.hpp.

◆ probability()

std::vector< Real > probability ( ) const

Definition at line 106 of file lossdistribution.hpp.

+ Here is the caller graph for this function:

◆ excessProbability()

std::vector< Real > excessProbability ( ) const

Definition at line 107 of file lossdistribution.hpp.

Member Data Documentation

◆ nBuckets_

Size nBuckets_
private

Definition at line 109 of file lossdistribution.hpp.

◆ maximum_

Real maximum_
private

Definition at line 110 of file lossdistribution.hpp.

◆ volume_

Real volume_
mutableprivate

Definition at line 111 of file lossdistribution.hpp.

◆ n_

Size n_
mutableprivate

Definition at line 112 of file lossdistribution.hpp.

◆ probability_

std::vector<Real> probability_
mutableprivate

Definition at line 113 of file lossdistribution.hpp.

◆ excessProbability_

std::vector<Real> excessProbability_
mutableprivate

Definition at line 114 of file lossdistribution.hpp.