27 const std::vector<Time>& times,
28 const std::vector<Handle<Quote>>& corrSpreads,
29 const bool useAtmReferenceCorrsOnly)
31 times_(times), corrSpreads_(corrSpreads), useAtmReferenceCorrsOnly_(useAtmReferenceCorrsOnly) {
32 QL_REQUIRE(!
times_.empty(),
"SpreadedCorrelationCurve: times are empty");
34 "SpreadedCorrelationCurve: size of times and quote vectors do not match");
35 if (times.size() == 1) {
43 QuantLib::ext::make_shared<LinearInterpolation>(
times_.begin(),
times_.end(),
data_.begin()));
56 CorrelationTermStructure::update();
66 for (Size i = 0; i <
times_.size(); ++i) {
67 QL_REQUIRE(!
corrSpreads_[i].empty(),
"SpreadedCorrelationCurve: quote at index " << i <<
" is empty");
Correlation term structure.
Real correlationImpl(Time t, Real strike) const override
Correlation calculation.
void performCalculations() const override
Calendar calendar() const override
Time minTime() const override
The minimum time for which the curve can return values.
const Date & referenceDate() const override
std::vector< Time > times_
bool useAtmReferenceCorrsOnly_
Natural settlementDays() const override
Date maxDate() const override
QuantLib::ext::shared_ptr< Interpolation > interpolation_
SpreadedCorrelationCurve(const Handle< CorrelationTermStructure > &referenceCorrelation, const std::vector< Time > ×, const std::vector< Handle< Quote > > &corrSpreads, const bool useAtmReferenceVolsOnly=false)
Handle< CorrelationTermStructure > referenceCorrelation_
std::vector< Real > data_
std::vector< Handle< Quote > > corrSpreads_
Spreaded correlation curve.