27 const std::vector<Period>& tenors,
28 const std::vector<double>& detachmentPoints,
29 const std::vector<std::vector<Handle<Quote>>>& corrSpreads,
30 const Date& startDate,
31 boost::optional<DateGeneration::Rule> rule)
33 baseCurve->businessDayConvention(), tenors, detachmentPoints,
34 baseCurve->dayCounter(), startDate, rule),
35 baseCurve_(baseCurve), corrSpreads_(corrSpreads), data_(detachmentPoints_.size(), tenors.size(), 0.0) {
38 QL_REQUIRE(!
times_.empty(),
"SpreadedCorrelationCurve: time points are empty");
39 QL_REQUIRE(!
detachmentPoints_.empty(),
"SpreadedBaseCorrelationCurve: detachmentPoints are empty");
43 QL_REQUIRE(row.size() ==
tenors_.size(),
"Mismatch between number of detachment points and quotes");
47 for (
auto const& q : row)
58 BaseCorrelationTermStructure::update();
70 for (Size j = 0; j < this->
times_.size(); ++j)
std::vector< Period > tenors_
std::vector< double > detachmentPoints_
std::vector< double > times_
BiLinear-interpolation and flat extrapolation factory
Interpolation2D interpolate(const I1 &xBegin, const I1 &xEnd, const I2 &yBegin, const I2 &yEnd, const M &z) const
Real correlationImpl(Time t, Real strike) const override
Correlation calculation.
void performCalculations() const override
Interpolation2D interpolation_
SpreadedBaseCorrelationCurve(const Handle< BaseCorrelationTermStructure > &baseCurve, const std::vector< Period > &tenors, const std::vector< double > &detachmentPoints, const std::vector< std::vector< Handle< Quote > > > &corrSpreads, const Date &startDate=Date(), boost::optional< DateGeneration::Rule > rule=boost::none)
std::vector< std::vector< Handle< Quote > > > corrSpreads_
Handle< BaseCorrelationTermStructure > baseCurve_