|
QuantLib: a free/open-source library for quantitative finance
fully annotated source code - version 1.38
|
#include <randomlosslatentmodel.hpp>
Inheritance diagram for RandomLossLM< copulaPolicy, USNG >:
Collaboration diagram for RandomLossLM< copulaPolicy, USNG >:Public Member Functions | |
| RandomLossLM (const ext::shared_ptr< SpotRecoveryLatentModel< copulaPolicy > > &copula, Size nSims=0, Real accuracy=1.e-6, BigNatural seed=2863311530UL) | |
Public Member Functions inherited from RandomLM< derivedRandomLM, copulaPolicy, USNG > | |
| ~RandomLM () override=default | |
Public Member Functions inherited from LazyObject | |
| LazyObject () | |
| ~LazyObject () override=default | |
| void | update () override |
| bool | isCalculated () const |
| void | forwardFirstNotificationOnly () |
| void | alwaysForwardNotifications () |
| void | recalculate () |
| void | freeze () |
| void | unfreeze () |
Public Member Functions inherited from Observable | |
| Observable ()=default | |
| Observable (const Observable &) | |
| Observable & | operator= (const Observable &) |
| Observable (Observable &&)=delete | |
| Observable & | operator= (Observable &&)=delete |
| virtual | ~Observable ()=default |
| void | notifyObservers () |
Public Member Functions inherited from Observer | |
| Observer ()=default | |
| Observer (const Observer &) | |
| Observer & | operator= (const Observer &) |
| virtual | ~Observer () |
| std::pair< iterator, bool > | registerWith (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 () |
Protected Member Functions | |
| void | nextSample (const std::vector< Real > &values) const |
| void | initDates () const |
| Real | getEventRecovery (const defaultSimEvent &evt) const |
| Real | latentVarValue (const std::vector< Real > &factorsSample, Size iVar) const |
| Size | basketSize () const |
| Real | conditionalRecovery (Real latentVarSample, Size iName, const Date &d) const |
Protected Member Functions inherited from RandomLM< derivedRandomLM, copulaPolicy, USNG > | |
| RandomLM (Size numFactors, Size numLMVars, copulaPolicy copula, Size nSims, BigNatural seed) | |
| void | update () override |
| void | performCalculations () const override |
| void | performSimulations () const |
| const std::vector< simEvent< derivedRandomLM< copulaPolicy, USNG > > > & | getSim (const Size iSim) const |
| Real | getEventRecovery (const simEvent< derivedRandomLM< copulaPolicy, USNG > > &evt) const |
| Probability | probAtLeastNEvents (Size n, const Date &d) const override |
| std::vector< Probability > | probsBeingNthEvent (Size n, const Date &d) const override |
| Real | defaultCorrelation (const Date &d, Size iName, Size jName) const override |
| Pearsons' default probability correlation. More... | |
| Real | expectedTrancheLoss (const Date &d) const override |
| virtual std::pair< Real, Real > | expectedTrancheLossInterval (const Date &d, Probability confidencePerc) const |
| std::map< Real, Probability > | lossDistribution (const Date &d) const override |
| Full loss distribution. More... | |
| virtual Histogram | computeHistogram (const Date &d) const |
| Real | expectedShortfall (const Date &d, Real percent) const override |
| Expected shortfall given a default loss percentile. More... | |
| Real | percentile (const Date &d, Real percentile) const override |
| Value at Risk given a default loss percentile. More... | |
| virtual std::tuple< Real, Real, Real > | percentileAndInterval (const Date &d, Real percentile) const |
| std::vector< Real > | splitVaRLevel (const Date &date, Real loss) const override |
| virtual std::vector< std::vector< Real > > | splitVaRAndError (const Date &date, Real loss, Probability confInterval) const |
Protected Member Functions inherited from LazyObject | |
| virtual void | calculate () const |
Protected Member Functions inherited from DefaultLossModel | |
| DefaultLossModel ()=default | |
| virtual Probability | probOverLoss (const Date &d, Real lossFraction) const |
| virtual std::vector< Real > | splitESFLevel (const Date &d, Real loss) const |
| Associated ESF fraction to each counterparty. More... | |
| virtual Real | densityTrancheLoss (const Date &d, Real lossFraction) const |
| Probability density of a given loss fraction of the basket notional. More... | |
| virtual Real | expectedRecovery (const Date &, Size iName, const DefaultProbKey &) const |
Private Types | |
| typedef simEvent< RandomLossLM > | defaultSimEvent |
Private Member Functions | |
| void | resetModel () override |
| Concrete models do now any updates/inits they need on basket reset. More... | |
Private Attributes | |
| const ext::shared_ptr< SpotRecoveryLatentModel< copulaPolicy > > | copula_ |
| Real | accuracy_ |
| std::vector< Probability > | horizonDefaultPs_ |
Friends | |
| class | RandomLM< ::QuantLib::RandomLossLM, copulaPolicy, USNG > |
Additional Inherited Members | |
Public Types inherited from Observer | |
| typedef set_type::iterator | iterator |
Protected Attributes inherited from RandomLM< derivedRandomLM, copulaPolicy, USNG > | |
| const Size | numFactors_ |
| const Size | numLMVars_ |
| const Size | nSims_ |
| std::vector< std::vector< simEvent< derivedRandomLM< copulaPolicy, USNG > > > > | simsBuffer_ |
| copulaPolicy | copula_ |
| ext::shared_ptr< copulaRNG_type > | copulasRng_ |
Protected Attributes inherited from LazyObject | |
| bool | calculated_ = false |
| bool | frozen_ = false |
| bool | alwaysForward_ |
Protected Attributes inherited from DefaultLossModel | |
| RelinkableHandle< Basket > | basket_ |
Static Protected Attributes inherited from RandomLM< derivedRandomLM, copulaPolicy, USNG > | |
| static const Size | maxHorizon_ = 4050 |
Random spot recovery rate loss model simulation for an arbitrary copula.
Definition at line 71 of file randomlosslatentmodel.hpp.
|
private |
Definition at line 74 of file randomlosslatentmodel.hpp.
|
explicit |
Definition at line 80 of file randomlosslatentmodel.hpp.
|
protected |
|
protected |
|
protected |
Definition at line 121 of file randomlosslatentmodel.hpp.
Definition at line 125 of file randomlosslatentmodel.hpp.
|
protected |
Definition at line 129 of file randomlosslatentmodel.hpp.
|
overrideprivatevirtual |
Concrete models do now any updates/inits they need on basket reset.
Implements DefaultLossModel.
Definition at line 134 of file randomlosslatentmodel.hpp.
Here is the call graph for this function:
|
friend |
Definition at line 80 of file randomlosslatentmodel.hpp.
|
private |
Definition at line 76 of file randomlosslatentmodel.hpp.
|
private |
Definition at line 78 of file randomlosslatentmodel.hpp.
|
mutableprivate |
Definition at line 149 of file randomlosslatentmodel.hpp.