35 Real accrualValue = 0.0;
36 Real claimValue = 0.0;
46 bool basketIsHomogeneous =
true;
49 ext::shared_ptr<FixedRateCoupon> coupon = ext::dynamic_pointer_cast<FixedRateCoupon>(i);
71 if (coupon->accrualStartDate() >=
73 d = coupon->accrualStartDate();
85 Probability defProb0 = std::accumulate(probsTriggering.begin(),
87 probsTriggering.end(), Real(0.));
91 std::vector<Probability> probsTriggering, probsTriggering1;
96 if(basketIsHomogeneous) {
99 claimValue -= (defProb1-defProb0)
109 defProb1 = std::accumulate(probsTriggering1.begin(),
110 probsTriggering1.end(),
Real(0.));
128 claimValue -= (probsTriggering1[iName]-
129 probsTriggering[iName])
135 probsTriggering = probsTriggering1;
142 accrualValue += coupon->accruedAmount(
d)*disc*dcfdd;
147 if (stepSize != 1*
Days &&
d > coupon->accrualEndDate()) {
152 while (d <= coupon->accrualEndDate());
162 ext::dynamic_pointer_cast<FixedRateCoupon>(
basket of issuers and related notionals
NthToDefault::results results_
NthToDefault::arguments arguments_
std::map< std::string, ext::any > additionalResults
Handle< YieldTermStructure > discountCurve_
void calculate() const override
Period integrationStepSize_
ext::shared_ptr< Basket > basket
bool settlePremiumAccrual
template class providing a null value for a given type.
DateProxy & evaluationDate()
the date at which pricing is to be performed.
static Settings & instance()
access to the unique instance
Coupon paying a fixed annual rate.
Real DiscountFactor
discount factor between dates
Real Probability
probability
std::size_t Size
size of a container
Interest-rate term structure.