21#ifndef quantlib_constantloss_latentmodel_hpp
22#define quantlib_constantloss_latentmodel_hpp
37 template <
class copulaPolicy>
53 "Incompatible factors and recovery sizes.");
69 "Incompatible model and recovery sizes.");
73 const std::vector<Real>& mktFactors)
const {
78 const std::vector<Real>& mktFactors)
const {
83 const std::vector<Real>& mktFactors)
const {
105 typedef ConstantLossLatentmodel<GaussianCopulaPolicy>
117 template <
class copulaPolicy>
127 const typename copulaPolicy::initTraits& ini =
128 copulaPolicy::initTraits())
130 integralType, ini) {}
137 const typename copulaPolicy::initTraits& ini =
138 copulaPolicy::initTraits())
140 integralType, nVariables,ini) {}
Real conditionalRecovery(const Date &d, Size iName, const std::vector< Real > &mktFactors) const
Real expectedRecovery(const Date &d, Size iName, const DefaultProbKey &defKeys) const
ConstantLossLatentmodel(const std::vector< std::vector< Real > > &factorWeights, const std::vector< Real > &recoveries, LatentModelIntegrationType::LatentModelIntegrationType integralType, const initTraits &ini=initTraits())
const std::vector< Real > recoveries_
Real conditionalRecovery(Real latentVarSample, Size iName, const Date &d) const
ConstantLossLatentmodel(const Handle< Quote > &mktCorrel, const std::vector< Real > &recoveries, LatentModelIntegrationType::LatentModelIntegrationType integralType, Size nVariables, const initTraits &ini=initTraits())
Real conditionalRecoveryInvP(Real invUncondDefP, Size iName, const std::vector< Real > &mktFactors) const
const std::vector< Real > & recoveries() const
Real conditionalRecovery(Probability uncondDefP, Size iName, const std::vector< Real > &mktFactors) const
copulaPolicy::initTraits initTraits
Probability probAtLeastNEvents(Size n, const Date &d) const override
Real defaultCorrelation(const Date &d, Size iName, Size jName) const override
Pearsons' default probability correlation.
ConstantLossModel(const std::vector< std::vector< Real > > &factorWeights, const std::vector< Real > &recoveries, LatentModelIntegrationType::LatentModelIntegrationType integralType, const typename copulaPolicy::initTraits &ini=copulaPolicy::initTraits())
ConstantLossModel(const Handle< Quote > &mktCorrel, const std::vector< Real > &recoveries, LatentModelIntegrationType::LatentModelIntegrationType integralType, Size nVariables, const typename copulaPolicy::initTraits &ini=copulaPolicy::initTraits())
void resetModel() override
Concrete models do now any updates/inits they need on basket reset.
Real expectedRecovery(const Date &d, Size iName, const DefaultProbKey &k) const override
Default event Latent Model.
void resetBasket(const ext::shared_ptr< Basket > &basket) const
Real defaultCorrelation(const Date &d, Size iNamei, Size iNamej) const
Probability probAtLeastNEvents(Size n, const Date &date) const
RelinkableHandle< Basket > basket_
Shared handle to an observable.
const std::vector< std::vector< Real > > & factorWeights() const
Provides values of the factors .
#define QL_REQUIRE(condition, message)
throw an error if the given pre-condition is not verified
Real Probability
probability
std::size_t Size
size of a container
LatentModelIntegrationType
ConstantLossLatentmodel< TCopulaPolicy > TConstantLossLM
ConstantLossLatentmodel< GaussianCopulaPolicy > GaussianConstantLossLM