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
LossDistMonteCarlo Class Reference

Loss distribution with Monte Carlo simulation. More...

#include <lossdistribution.hpp>

+ Inheritance diagram for LossDistMonteCarlo:
+ Collaboration diagram for LossDistMonteCarlo:

Public Member Functions

 LossDistMonteCarlo (Size nBuckets, Real maximum, Size simulations, long seed=42, Real epsilon=1e-6)
 
Distribution operator() (const std::vector< Real > &volumes, const std::vector< Real > &probabilities) const override
 
Size buckets () const override
 
Real maximum () const override
 
- 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_
 
Size simulations_
 
long seed_
 
Real epsilon_
 

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

Loss distribution with Monte Carlo simulation.

Loss distribution for varying volumes and probabilities of default via Monte Carlo simulation of independent default events.

Definition at line 193 of file lossdistribution.hpp.

Constructor & Destructor Documentation

◆ LossDistMonteCarlo()

LossDistMonteCarlo ( Size  nBuckets,
Real  maximum,
Size  simulations,
long  seed = 42,
Real  epsilon = 1e-6 
)

Definition at line 195 of file lossdistribution.hpp.

Member Function Documentation

◆ operator()()

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

Implements LossDist.

Definition at line 302 of file lossdistribution.cpp.

+ Here is the call graph for this function:

◆ buckets()

Size buckets ( ) const
overridevirtual

Implements LossDist.

Definition at line 201 of file lossdistribution.hpp.

◆ maximum()

Real maximum ( ) const
overridevirtual

Implements LossDist.

Definition at line 202 of file lossdistribution.hpp.

Member Data Documentation

◆ nBuckets_

Size nBuckets_
private

Definition at line 205 of file lossdistribution.hpp.

◆ maximum_

Real maximum_
private

Definition at line 206 of file lossdistribution.hpp.

◆ simulations_

Size simulations_
private

Definition at line 207 of file lossdistribution.hpp.

◆ seed_

long seed_
private

Definition at line 208 of file lossdistribution.hpp.

◆ epsilon_

Real epsilon_
private

Definition at line 209 of file lossdistribution.hpp.