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

Base class for random default models. More...

#include <randomdefaultmodel.hpp>

+ Inheritance diagram for RandomDefaultModel:
+ Collaboration diagram for RandomDefaultModel:

Public Member Functions

 RandomDefaultModel (const ext::shared_ptr< Pool > &pool, const std::vector< DefaultProbKey > &defaultKeys)
 
 ~RandomDefaultModel () override=default
 
void update () override
 
virtual void nextSequence (Real tmax=QL_MAX_REAL)=0
 
virtual void reset ()=0
 
- Public Member Functions inherited from Observer
 Observer ()=default
 
 Observer (const Observer &)
 
Observeroperator= (const Observer &)
 
virtual ~Observer ()
 
std::pair< iterator, boolregisterWith (const ext::shared_ptr< Observable > &)
 
void registerWithObservables (const ext::shared_ptr< Observer > &)
 
Size unregisterWith (const ext::shared_ptr< Observable > &)
 
void unregisterWithAll ()
 
virtual void update ()=0
 
virtual void deepUpdate ()
 
- Public Member Functions inherited from Observable
 Observable ()
 
 Observable (const Observable &)
 
Observableoperator= (const Observable &)
 
 Observable (Observable &&)=delete
 
Observableoperator= (Observable &&)=delete
 
virtual ~Observable ()=default
 
void notifyObservers ()
 

Protected Attributes

ext::shared_ptr< Poolpool_
 
std::vector< DefaultProbKeydefaultKeys_
 

Additional Inherited Members

- Public Types inherited from Observer
typedef set_type::iterator iterator
 

Detailed Description

Base class for random default models.

Provides sequences of random default times for each name in the pool.

Definition at line 37 of file randomdefaultmodel.hpp.

Constructor & Destructor Documentation

◆ RandomDefaultModel()

RandomDefaultModel ( const ext::shared_ptr< Pool > &  pool,
const std::vector< DefaultProbKey > &  defaultKeys 
)

Definition at line 39 of file randomdefaultmodel.hpp.

◆ ~RandomDefaultModel()

~RandomDefaultModel ( )
overridedefault

Member Function Documentation

◆ update()

void update ( )
overridevirtual

This method must be implemented in derived classes. An instance of Observer does not call this method directly: instead, it will be called by the observables the instance registered with when they need to notify any changes.

Implements Observer.

Definition at line 46 of file randomdefaultmodel.hpp.

+ Here is the call graph for this function:

◆ nextSequence()

virtual void nextSequence ( Real  tmax = QL_MAX_REAL)
pure virtual

Generate a sequence of random default times, one for each name in the pool, and store the result in the Pool using method setTime(name). tmax denotes the maximum relevant time- default times > tmax are not computed but set to tmax + 1 instead to save coputation time.

Implemented in GaussianRandomDefaultModel.

◆ reset()

virtual void reset ( )
pure virtual

Implemented in GaussianRandomDefaultModel.

Member Data Documentation

◆ pool_

ext::shared_ptr<Pool> pool_
protected

Definition at line 56 of file randomdefaultmodel.hpp.

◆ defaultKeys_

std::vector<DefaultProbKey> defaultKeys_
protected

Definition at line 57 of file randomdefaultmodel.hpp.