23#ifndef quantext_test_swaptionmarketdata_hpp
24#define quantext_test_swaptionmarketdata_hpp
26#include <boost/make_shared.hpp>
27#include <ql/indexes/ibor/euribor.hpp>
28#include <ql/indexes/swap/euriborswap.hpp>
29#include <ql/math/matrix.hpp>
30#include <ql/math/randomnumbers/mt19937uniformrng.hpp>
31#include <ql/quotes/simplequote.hpp>
32#include <ql/time/calendars/target.hpp>
33#include <ql/time/daycounters/thirty360.hpp>
34#include <ql/time/period.hpp>
47 nVolSpreads(16, vector<Handle<Quote> >(5, Handle<Quote>())),
48 lnVolSpreads(16, vector<Handle<Quote> >(5, Handle<Quote>())),
49 slnVolSpreads(16, vector<Handle<Quote> >(5, Handle<Quote>())) {
64 nVols[0][0] = 0.003543;
65 nVols[0][1] = 0.005270;
66 nVols[0][2] = 0.006978;
67 nVols[0][3] = 0.007918;
68 nVols[1][0] = 0.007013;
69 nVols[1][1] = 0.007443;
70 nVols[1][2] = 0.007820;
71 nVols[1][3] = 0.007363;
72 nVols[2][0] = 0.007519;
73 nVols[2][1] = 0.007807;
74 nVols[2][2] = 0.007698;
75 nVols[2][3] = 0.007117;
76 nVols[3][0] = 0.007668;
77 nVols[3][1] = 0.007705;
78 nVols[3][2] = 0.007611;
79 nVols[3][3] = 0.006848;
174 Size atmStrikeIndex = 2;
177 MersenneTwisterUniformRng rng(42);
178 Real nVolSpreadMin = 0.0010;
179 Real nVolSpreadMax = 0.0050;
180 Real lnVolSpreadMin = 0.1;
181 Real lnVolSpreadMax = 0.3;
182 Real slnVolSpreadMin = 0.05;
183 Real slnVolSpreadMax = 0.25;
185 for (Size j = 0; j <
swapTenors.size(); ++j) {
189 k == atmStrikeIndex ? 0.0 : nVolSpreadMin + rng.nextReal() * (nVolSpreadMax - nVolSpreadMin);
190 nVolSpreads[index][k] = Handle<Quote>(QuantLib::ext::shared_ptr<SimpleQuote>(
new SimpleQuote(nVolSpread)));
192 k == atmStrikeIndex ? 0.0 : lnVolSpreadMin + rng.nextReal() * (lnVolSpreadMax - lnVolSpreadMin);
194 Handle<Quote>(QuantLib::ext::shared_ptr<SimpleQuote>(
new SimpleQuote(lnVolSpread)));
195 Real slnVolSpread = k == atmStrikeIndex
197 : slnVolSpreadMin + rng.nextReal() * (slnVolSpreadMax - slnVolSpreadMin);
199 Handle<Quote>(QuantLib::ext::shared_ptr<SimpleQuote>(
new SimpleQuote(slnVolSpread)));
BusinessDayConvention fixedConvention
DayCounter fixedDayCounter
QuantLib::ext::shared_ptr< SwapIndex > swapIndex
QuantLib::ext::shared_ptr< IborIndex > floatIndex
QuantLib::ext::shared_ptr< SwapIndex > shortSwapIndex
vector< Real > strikeSpreads
vector< vector< Handle< Quote > > > slnVolSpreads
vector< vector< Handle< Quote > > > lnVolSpreads
vector< Period > swapTenors
vector< Period > optionTenors
vector< vector< Handle< Quote > > > nVolSpreads