31 const std::vector<Swaption>& swaptions,
32 const std::vector<Cap>& caps)
33 : bumps_(bumps), swaptions_(swaptions), caps_(caps), computed_(false,swaptions.size()+caps.size()),
34 derivatives_(swaptions.size()+caps.size(),
std::vector<
Real>(bumps.numberBumps())),
35 bumpMatrix_(swaptions.size()+caps.size(),bumps_.numberBumps())
43 QL_REQUIRE(j <
swaptions_.size()+
caps_.size(),
"too high index passed to VolatilityBumpInstrumentJacobian::derivativesVolatility");
70 v += fullDerivative[
r][
f];
96 v += fullDerivative[
r][
f];
139 const std::vector<VolatilityBumpInstrumentJacobian::Swaption>& swaptions,
140 const std::vector<VolatilityBumpInstrumentJacobian::Cap>& caps,
141 Real multiplierCutOff,
143 derivativesProducer_(bumps,swaptions,caps),
144 multiplierCutOff_(multiplierCutOff),
145 tolerance_(tolerance)
166 Size factors = marketmodel->numberOfFactors();
168 theBumps.resize(numberSteps);
171 for (
auto& theBump : theBumps)
172 theBump.resize(numberRestrictedBumps);
174 Matrix modelMatrix(numberRates, factors,0.0);
176 for (
Size i=0; i< numberSteps; ++i)
177 for (
Size j=0; j < numberRestrictedBumps; ++j)
178 theBumps[i][j] = modelMatrix;
185 for (
Size instrument=0; instrument < projector.
validVectors().size(); ++instrument)
189 for (
Size cluster =0; cluster< bumpClusters.size(); ++cluster)
193 for (
Size step = bumpClusters[cluster].stepBegin(); step < bumpClusters[cluster].stepEnd(); ++step)
194 for (
Size rate = bumpClusters[cluster].rateBegin(); rate < bumpClusters[cluster].rateEnd(); ++rate)
195 for (
Size factor = bumpClusters[cluster].factorBegin(); factor < bumpClusters[cluster].factorEnd(); ++factor)
196 theBumps[step][bumpIndex][rate][factor] = magnitude;
const Matrix & volatilityDerivative(Size i) const
Market-model evolution description.
Size numberOfRates() const
Size numberOfSteps() const
Matrix used in linear algebra.
Size numberValidVectors() const
const std::valarray< bool > & validVectors() const
const std::vector< Real > & GetVector(Size index) const
VolatilityBumpInstrumentJacobian derivativesProducer_
OrthogonalizedBumpFinder(const VegaBumpCollection &bumps, const std::vector< VolatilityBumpInstrumentJacobian::Swaption > &swaptions, const std::vector< VolatilityBumpInstrumentJacobian::Cap > &caps, Real multiplierCutOff, Real tolerance)
void GetVegaBumps(std::vector< std::vector< Matrix > > &theBumps) const
const Matrix & volatilityDerivative(Size i) const
const ext::shared_ptr< MarketModel > & associatedModel() const
const std::vector< VegaBumpCluster > & allBumps() const
const VegaBumpCollection & getInputBumps() const
VolatilityBumpInstrumentJacobian(const VegaBumpCollection &bumps, const std::vector< Swaption > &swaptions, const std::vector< Cap > &caps)
std::valarray< bool > computed_
const Matrix & getAllOnePercentBumps() const
std::vector< std::vector< Real > > derivatives_
std::vector< Swaption > swaptions_
std::vector< Real > onePercentBump(Size j) const
VegaBumpCollection bumps_
std::vector< std::vector< Real > > onePercentBumps_
std::vector< Real > derivativesVolatility(Size j) const
#define QL_REQUIRE(condition, message)
throw an error if the given pre-condition is not verified
std::size_t Size
size of a container
ext::shared_ptr< YieldTermStructure > r
ext::shared_ptr< BlackVolTermStructure > v