#include <ored/model/blackscholesmodelbuilder.hpp>
|
| BlackScholesModelBuilder (const std::vector< Handle< YieldTermStructure > > &curves, const std::vector< QuantLib::ext::shared_ptr< GeneralizedBlackScholesProcess > > &processes, const std::set< Date > &simulationDates, const std::set< Date > &addDates, const Size timeStepsPerYear=0, const std::string &calibration="ATM", const std::vector< std::vector< Real > > &calibrationStrikes={}) |
|
| BlackScholesModelBuilder (const Handle< YieldTermStructure > &curve, const QuantLib::ext::shared_ptr< GeneralizedBlackScholesProcess > &process, const std::set< Date > &simulationDates, const std::set< Date > &addDates, const Size timeStepsPerYear=0, const std::string &calibration="ATM", const std::vector< Real > &calibrationStrikes={}) |
|
std::vector< QuantLib::ext::shared_ptr< GeneralizedBlackScholesProcess > > | getCalibratedProcesses () const override |
|
| BlackScholesModelBuilderBase (const std::vector< Handle< YieldTermStructure > > &curves, const std::vector< QuantLib::ext::shared_ptr< GeneralizedBlackScholesProcess > > &processes, const std::set< Date > &simulationDates, const std::set< Date > &addDates, const Size timeStepsPerYear) |
|
| BlackScholesModelBuilderBase (const Handle< YieldTermStructure > &curve, const QuantLib::ext::shared_ptr< GeneralizedBlackScholesProcess > &process, const std::set< Date > &simulationDates, const std::set< Date > &addDates, const Size timeStepsPerYear) |
|
Handle< BlackScholesModelWrapper > | model () const |
|
void | forceRecalculate () override |
|
bool | requiresRecalibration () const override |
|
void | recalibrate () const |
|
virtual void | forceRecalculate () |
|
virtual bool | requiresRecalibration () const=0 |
|
◆ BlackScholesModelBuilder() [1/2]
BlackScholesModelBuilder |
( |
const std::vector< Handle< YieldTermStructure > > & |
curves, |
|
|
const std::vector< QuantLib::ext::shared_ptr< GeneralizedBlackScholesProcess > > & |
processes, |
|
|
const std::set< Date > & |
simulationDates, |
|
|
const std::set< Date > & |
addDates, |
|
|
const Size |
timeStepsPerYear = 0 , |
|
|
const std::string & |
calibration = "ATM" , |
|
|
const std::vector< std::vector< Real > > & |
calibrationStrikes = {} |
|
) |
| |
Definition at line 25 of file blackscholesmodelbuilder.cpp.
32 calibrationStrikes_(calibrationStrikes.empty() ? std::vector<std::vector<Real>>(processes.size())
33 : calibrationStrikes) {
35 "calibrationStrikes size (" <<
calibrationStrikes_.size() <<
") must match processes size ("
36 << processes.size() << ")");
37}
BlackScholesModelBuilderBase(const std::vector< Handle< YieldTermStructure > > &curves, const std::vector< QuantLib::ext::shared_ptr< GeneralizedBlackScholesProcess > > &processes, const std::set< Date > &simulationDates, const std::set< Date > &addDates, const Size timeStepsPerYear)
const std::vector< std::vector< Real > > calibrationStrikes_
const std::string calibration_
◆ BlackScholesModelBuilder() [2/2]
BlackScholesModelBuilder |
( |
const Handle< YieldTermStructure > & |
curve, |
|
|
const QuantLib::ext::shared_ptr< GeneralizedBlackScholesProcess > & |
process, |
|
|
const std::set< Date > & |
simulationDates, |
|
|
const std::set< Date > & |
addDates, |
|
|
const Size |
timeStepsPerYear = 0 , |
|
|
const std::string & |
calibration = "ATM" , |
|
|
const std::vector< Real > & |
calibrationStrikes = {} |
|
) |
| |
◆ getCalibratedProcesses()
std::vector< QuantLib::ext::shared_ptr< GeneralizedBlackScholesProcess > > getCalibratedProcesses |
( |
| ) |
const |
|
overridevirtual |
◆ getCurveTimes()
std::vector< std::vector< Real > > getCurveTimes |
( |
| ) |
const |
|
overrideprotectedvirtual |
Implements BlackScholesModelBuilderBase.
Definition at line 54 of file blackscholesmodelbuilder.cpp.
54 {
57 if (d >
curves_.front()->referenceDate()) {
58 timesExt.push_back(
curves_.front()->timeFromReference(d));
59 }
60 }
61 std::sort(timesExt.begin(), timesExt.end());
62 auto it = std::unique(timesExt.begin(), timesExt.end(),
63 [](const Real x, const Real y) { return QuantLib::close_enough(x, y); });
64 timesExt.resize(std::distance(timesExt.begin(), it));
65 return std::vector<std::vector<Real>>(
allCurves_.size(), timesExt);
66}
std::vector< Handle< YieldTermStructure > > allCurves_
const std::set< Date > addDates_
TimeGrid discretisationTimeGrid_
const std::vector< Handle< YieldTermStructure > > curves_
◆ getVolTimesStrikes()
std::vector< std::vector< std::pair< Real, Real > > > getVolTimesStrikes |
( |
| ) |
const |
|
overrideprotectedvirtual |
Implements BlackScholesModelBuilderBase.
Definition at line 68 of file blackscholesmodelbuilder.cpp.
68 {
69 std::vector<std::vector<std::pair<Real, Real>>> volTimesStrikes;
71 Real strike;
73 strike = Null<Real>();
76 } else {
77 QL_FAIL(
"BlackScholesModelBuilder: calibration '" <<
calibration_ <<
"' not known, expected ATM or Deal");
78 }
79 volTimesStrikes.push_back(std::vector<std::pair<Real, Real>>());
82 }
83 }
84 return volTimesStrikes;
85}
◆ calibration_
const std::string calibration_ |
|
private |
◆ calibrationStrikes_
const std::vector<std::vector<Real> > calibrationStrikes_ |
|
private |