19#ifndef quantext_constantloss_latentmodel_hpp
20#define quantext_constantloss_latentmodel_hpp
45 LatentModelIntegrationType::LatentModelIntegrationType integralType,
49 QL_REQUIRE(
recoveries.size() == factorWeights.size(),
"Incompatible factors and recovery sizes.");
53 LatentModelIntegrationType::LatentModelIntegrationType integralType, Size nVariables,
58 QL_REQUIRE(
recoveries.size() == nVariables,
"Incompatible model and recovery sizes.");
65 Real
conditionalRecovery(Probability uncondDefP, Size iName,
const std::vector<Real>& mktFactors)
const {
93template <
class copulaPolicy>
97 LatentModelIntegrationType::LatentModelIntegrationType integralType,
98 const typename copulaPolicy::initTraits& ini = copulaPolicy::initTraits())
102 LatentModelIntegrationType::LatentModelIntegrationType integralType, Size nVariables,
103 const typename copulaPolicy::initTraits& ini = copulaPolicy::initTraits())
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
Real defaultCorrelation(const Date &d, Size iName, Size jName) const
Pearsons' default probability correlation.
Real expectedRecovery(const Date &d, Size iName, const DefaultProbKey &k) const
virtual void resetModel()
Concrete models do now any updates/inits they need on basket reset.
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())
Probability probAtLeastNEvents(Size n, const Date &d) const
Default event Latent Model.
Real defaultCorrelation(const Date &d, Size iNamei, Size iNamej) const
void resetBasket(const QuantLib::ext::shared_ptr< Basket > basket) const
Probability probAtLeastNEvents(Size n, const Date &date) const
RelinkableHandle< QuantExt::Basket > basket_
ConstantLossLatentmodel< TCopulaPolicy > TConstantLossLM
ConstantLossLatentmodel< GaussianCopulaPolicy > GaussianConstantLossLM