22#ifndef QL_PATCH_SOLARIS
43 ext::optional<Real> notional)
44 : basket_(basket), side_(side), upfrontRate_(upfrontRate), runningRate_(runningRate),
45 leverageFactor_(notional ? *notional / basket->trancheNotional() :
Real(1.)),
46 dayCounter_(dayCounter), paymentConvention_(paymentConvention) {
52 "Basket did not exist before contract start.");
65 for (
Size i = 0; i <
basket->names().size(); i++) {
78 defaultProbability(
basket->pool()->defaultKeys()[i]));
204 class ObjectiveFunction {
206 ObjectiveFunction(
Real target,
234 ext::shared_ptr<SimpleQuote> correl(
new SimpleQuote(0.0));
236 ext::shared_ptr<GaussianLHPLossModel> lhp(
new
250 ObjectiveFunction
f(targetNPV, *correl, engineIC,
results);
ext::shared_ptr< PricingEngine > engine_
const Instrument::results * results_
bool empty() const
Returns whether or not the day counter is initialized.
virtual bool hasOccurred(const Date &refDate=Date(), ext::optional< bool > includeRefDate=ext::nullopt) const
returns true if an event has already occurred before a date
helper class building a sequence of fixed rate coupons
FixedRateLeg & withNotionals(Real)
FixedRateLeg & withPaymentAdjustment(BusinessDayConvention)
FixedRateLeg & withCouponRates(Rate, const DayCounter &paymentDayCounter, Compounding comp=Simple, Frequency freq=Annual)
PricingEngine::arguments * getArguments() const override
const PricingEngine::results * getResults() const override
Shared handle to an observable.
void calculate() const override
virtual void fetchResults(const PricingEngine::results *) const
virtual void setupExpired() const
CDO base engine taking schedule steps.
template class providing a null value for a given type.
std::pair< iterator, bool > registerWith(const ext::shared_ptr< Observable > &)
interface for pricing engines
const Date & startDate() const
market element returning a stored value
Real solve(const F &f, Real accuracy, Real guess, Real step) const
ext::shared_ptr< Basket > basket
void validate() const override
BusinessDayConvention paymentConvention
std::vector< Real > expectedTrancheLoss
Real upfrontPremiumValue_
Rate fairUpfrontPremium() const
ext::shared_ptr< Basket > basket_
void setupArguments(PricingEngine::arguments *) const override
const ext::shared_ptr< Basket > & basket() const
bool isExpired() const override
returns whether the instrument might have value greater than zero.
SyntheticCDO(const ext::shared_ptr< Basket > &basket, Protection::Side side, Schedule schedule, Rate upfrontRate, Rate runningRate, const DayCounter &dayCounter, BusinessDayConvention paymentConvention, ext::optional< Real > notional=ext::nullopt)
Real implicitCorrelation(const std::vector< Real > &recoveries, const Handle< YieldTermStructure > &discountCurve, Real targetNPV=0., Real accuracy=1.0e-3) const
Rate protectionValue() const
Real protectionLegNPV() const
BusinessDayConvention paymentConvention_
Real premiumLegNPV() const
void setupExpired() const override
const Real leverageFactor_
void fetchResults(const PricingEngine::results *) const override
std::vector< Real > expectedTrancheLoss() const
Rate premiumValue() const
std::vector< Real > expectedTrancheLoss_
Real remainingNotional() const
#define QL_REQUIRE(condition, message)
throw an error if the given pre-condition is not verified
Base class for events associated with a given date.
Coupon paying a fixed annual rate.
BusinessDayConvention
Business Day conventions.
std::size_t Size
size of a container
Maps optional to either the boost or std implementation.
ext::shared_ptr< YieldTermStructure > r
Synthetic Collateralized Debt Obligation and pricing engines.
Interest-rate term structure.