31 const ext::shared_ptr<MarketModel>& ctModel)
32 : coterminalModel_(ctModel),
33 numberOfFactors_(ctModel->numberOfFactors()),
34 numberOfRates_(ctModel->numberOfRates()),
35 numberOfSteps_(ctModel->numberOfSteps()),
36 pseudoRoots_(numberOfSteps_,
Matrix(numberOfRates_, numberOfFactors_))
48 const std::vector<Time>& rateTimes =
51 const std::vector<Time>& evolutionTimes =
54 i<rateTimes.size() && rateTimes[i]<=evolutionTimes.back(); ++i) {
55 QL_REQUIRE(std::find(evolutionTimes.begin(), evolutionTimes.end(),
56 rateTimes[i])!=evolutionTimes.end(),
61 const std::vector<Rate>& initialCoterminalSwapRates =
70 const std::vector<Size>& alive =
74 for (
Size i=0; i<alive[k]; ++i)
83 const ext::shared_ptr<MarketModelFactory>& coterminalFactory)
84 : coterminalFactory_(coterminalFactory) {
88 ext::shared_ptr<MarketModel>
91 Size numberOfFactors)
const {
92 ext::shared_ptr<MarketModel> coterminalModel =
94 return ext::shared_ptr<MarketModel>(
CotSwapToFwdAdapterFactory(const ext::shared_ptr< MarketModelFactory > &coterminalFactory)
ext::shared_ptr< MarketModelFactory > coterminalFactory_
ext::shared_ptr< MarketModel > create(const EvolutionDescription &, Size numberOfFactors) const override
const std::vector< Spread > & displacements() const override
CotSwapToFwdAdapter(const ext::shared_ptr< MarketModel > &coterminalModel)
std::vector< Matrix > pseudoRoots_
std::vector< Rate > initialRates_
ext::shared_ptr< MarketModel > coterminalModel_
Curve state for coterminal-swap market models
void setOnCoterminalSwapRates(const std::vector< Rate > &swapRates, Size firstValidIndex=0)
const std::vector< Rate > & forwardRates() const override
Market-model evolution description.
Matrix used in linear algebra.
std::pair< iterator, bool > registerWith(const ext::shared_ptr< Observable > &)
static Matrix coterminalSwapZedMatrix(const CurveState &cs, Spread displacement)
#define QL_REQUIRE(condition, message)
throw an error if the given pre-condition is not verified
detail::ordinal_holder ordinal(Size)
outputs naturals as 1st, 2nd, 3rd...
std::size_t Size
size of a container
Matrix inverse(const Matrix &m)
Utility functions for mapping between swap rate and forward rate.