30 ext::shared_ptr<YoYInflationIndex> index,
33 : index_(
std::move(index)), volatility_(
std::move(volatility)),
34 nominalTermStructure_(
std::move(nominalTermStructure)) {
57 std::vector<Real> values(optionlets, 0.0);
58 std::vector<Real> stdDevs(optionlets, 0.0);
59 std::vector<Real> forwards(optionlets, 0.0);
62 auto yoyTS =
index()->yoyInflationTermStructure();
66 for (
Size i=0; i<optionlets; ++i) {
68 if (paymentDate > settlement) {
82 Rate forward = forwards[i];
94 stdDevs[i] = std::sqrt(
101 forward, stdDevs[i],
d);
106 stdDevs[i] = std::sqrt(
110 forward, stdDevs[i],
d);
112 values[i] = floorlet;
115 values[i] -= floorlet;
136 const ext::shared_ptr<YoYInflationIndex>& index,
152 YoYInflationUnitDisplacedBlackCapFloorEngine
153 ::YoYInflationUnitDisplacedBlackCapFloorEngine(
154 const ext::shared_ptr<YoYInflationIndex>& index,
167 forward+1.0, stdDev,
d);
172 const ext::shared_ptr<YoYInflationIndex>& index,
YoYInflationCapFloor::results results_
YoYInflationCapFloor::arguments arguments_
Shared handle to an observable.
std::map< std::string, ext::any > additionalResults
Size unregisterWith(const ext::shared_ptr< Observable > &)
std::pair< iterator, bool > registerWith(const ext::shared_ptr< Observable > &)
Real optionletImpl(Option::Type, Real strike, Real forward, Real stdDev, Real d) const override
descendents only need to implement this
YoYInflationBachelierCapFloorEngine(const ext::shared_ptr< YoYInflationIndex > &, const Handle< YoYOptionletVolatilitySurface > &vol, const Handle< YieldTermStructure > &nominalTermStructure)
Real optionletImpl(Option::Type, Real strike, Real forward, Real stdDev, Real d) const override
descendents only need to implement this
YoYInflationBlackCapFloorEngine(const ext::shared_ptr< YoYInflationIndex > &, const Handle< YoYOptionletVolatilitySurface > &vol, const Handle< YieldTermStructure > &nominalTermStructure)
YoYInflationCapFloor::Type type
std::vector< Time > accrualTimes
std::vector< Date > startDates
std::vector< Real > gearings
std::vector< Rate > floorRates
std::vector< Real > nominals
std::vector< Rate > capRates
std::vector< Date > fixingDates
std::vector< Date > payDates
Base YoY inflation cap/floor engine.
void setVolatility(const Handle< YoYOptionletVolatilitySurface > &vol)
ext::shared_ptr< YoYInflationIndex > index() const
ext::shared_ptr< YoYInflationIndex > index_
YoYInflationCapFloorEngine(ext::shared_ptr< YoYInflationIndex >, Handle< YoYOptionletVolatilitySurface > vol, Handle< YieldTermStructure > nominalTermStructure)
Handle< YieldTermStructure > nominalTermStructure_
void calculate() const override
virtual Real optionletImpl(Option::Type type, Rate strike, Rate forward, Real stdDev, Real d) const =0
descendents only need to implement this
Handle< YoYOptionletVolatilitySurface > volatility_
Real optionletImpl(Option::Type, Real strike, Real forward, Real stdDev, Real d) const override
descendents only need to implement this
Real Time
continuous quantity with 1-year units
Real DiscountFactor
discount factor between dates
std::size_t Size
size of a container
Inflation cap/floor engines.
Real bachelierBlackFormula(Option::Type optionType, Real strike, Real forward, Real stdDev, Real discount)
Real blackFormula(Option::Type optionType, Real strike, Real forward, Real stdDev, Real discount, Real displacement)
ext::shared_ptr< BlackVolTermStructure > v
yoy inflation volatility structures