37 const ext::shared_ptr<OptionletStripper1>& optionletStripper1,
40 optionletStripper1->iborIndex(),
42 optionletStripper1->volatilityType(),
43 optionletStripper1->displacement()),
44 stripper1_(optionletStripper1), atmCapFloorTermVolCurve_(atmCapFloorTermVolCurve),
45 dc_(stripper1_->termVolSurface()->dayCounter()),
46 nOptionExpiries_(atmCapFloorTermVolCurve->optionTenors().size()),
47 atmCapFloorStrikes_(nOptionExpiries_), atmCapFloorPrices_(nOptionExpiries_),
48 spreadsVolImplied_(nOptionExpiries_), caps_(nOptionExpiries_) {
53 "different day counters provided");
70 const std::vector<Period>& optionExpiriesTenors =
72 const std::vector<Time>& optionExpiriesTimes =
77 optionExpiriesTimes[j], 33.3333);
78 ext::shared_ptr<BlackCapFloorEngine> engine(
new
82 optionExpiriesTenors[j],
99 if (i<=
caps_[j]->floatingLeg().size()) {
105 std::vector<Rate>::const_iterator previous =
126 Volatility guess = 0.0001, minSpread = -0.1, maxSpread = 0.1;
131 minSpread, maxSpread);
157 const ext::shared_ptr<OptionletStripper1>& optionletStripper1,
158 ext::shared_ptr<CapFloor> cap,
161 ext::shared_ptr<OptionletVolatilityStructure> adapter(
new
163 adapter->enableExtrapolation();
169 ext::shared_ptr<OptionletVolatilityStructure> spreadedAdapter(
new
173 ext::shared_ptr<BlackCapFloorEngine> engine(
new
175 optionletStripper1->iborIndex()->forwardingTermStructure(),
178 cap_->setPricingEngine(engine);
183 if (
s!=spreadQuote_->value())
184 spreadQuote_->setValue(
s);
Black-formula cap/floor engine.
Cap/floor at-the-money term-volatility curve.
Black-formula cap/floor engine.
Shared handle to an observable.
virtual void calculate() const
MakeCapFloor & withPricingEngine(const ext::shared_ptr< PricingEngine > &engine)
template class providing a null value for a given type.
std::pair< iterator, bool > registerWith(const ext::shared_ptr< Observable > &)
ext::shared_ptr< CapFloor > cap_
ObjectiveFunction(const ext::shared_ptr< OptionletStripper1 > &, ext::shared_ptr< CapFloor >, Real targetValue)
Real operator()(Volatility spreadVol) const
ext::shared_ptr< SimpleQuote > spreadQuote_
void performCalculations() const override
std::vector< Volatility > spreadsVolImplied_
const ext::shared_ptr< OptionletStripper1 > stripper1_
std::vector< Rate > atmCapFloorStrikes_
std::vector< Real > atmCapFloorPrices_
std::vector< ext::shared_ptr< CapFloor > > caps_
std::vector< Volatility > spreadsVolImplied() const
std::vector< Rate > atmCapFloorStrikes() const
std::vector< Volatility > spreadsVol() const
OptionletStripper2(const ext::shared_ptr< OptionletStripper1 > &optionletStripper1, const Handle< CapFloorTermVolCurve > &atmCapFloorTermVolCurve)
const Handle< CapFloorTermVolCurve > atmCapFloorTermVolCurve_
std::vector< Real > atmCapFloorPrices() const
std::vector< Rate > atmOptionletRate_
std::vector< std::vector< Volatility > > optionletVolatilities_
ext::shared_ptr< IborIndex > iborIndex_
std::vector< Date > optionletPaymentDates_
std::vector< Time > optionletAccrualPeriods_
std::vector< Time > optionletTimes_
std::vector< Date > optionletDates_
std::vector< std::vector< Rate > > optionletStrikes_
Volatility volatility(const Period &optionTenor, Rate strike, bool extrapolate=false) const
returns the volatility for a given option tenor and strike rate
void setMaxEvaluations(Size evaluations)
Real solve(const F &f, Real accuracy, Real guess, Real step) const
Interest-rate term structure.
#define QL_REQUIRE(condition, message)
throw an error if the given pre-condition is not verified
Real Volatility
volatility
std::size_t Size
size of a container
base class for Inter-Bank-Offered-Rate indexes
Helper class to instantiate standard market cap/floor.
optionlet (caplet/floorlet) volatility stripper
optionlet (caplet/floorlet) volatility stripper
Spreaded caplet/floorlet volatility.
StrippedOptionlet Adapter.