31 const ext::shared_ptr<MarketModel>& fwdModel)
32 : fwdModel_(fwdModel),
33 numberOfFactors_(fwdModel->numberOfFactors()),
34 numberOfRates_(fwdModel->numberOfRates()),
35 numberOfSteps_(fwdModel->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>& initialFwdRates =
70 const std::vector<Size>& alive =
74 for (
Size i=0; i<alive[k]; ++i)
83 const ext::shared_ptr<MarketModelFactory>& forwardFactory)
84 : forwardFactory_(forwardFactory) {
88 ext::shared_ptr<MarketModel>
91 Size numberOfFactors)
const {
92 ext::shared_ptr<MarketModel> forwardModel =
94 return ext::shared_ptr<MarketModel>(
Market-model evolution description.
FwdToCotSwapAdapterFactory(const ext::shared_ptr< MarketModelFactory > &forwardFactory)
ext::shared_ptr< MarketModelFactory > forwardFactory_
ext::shared_ptr< MarketModel > create(const EvolutionDescription &, Size numberOfFactors) const override
const std::vector< Spread > & displacements() const override
std::vector< Matrix > pseudoRoots_
std::vector< Rate > initialRates_
ext::shared_ptr< MarketModel > fwdModel_
FwdToCotSwapAdapter(const ext::shared_ptr< MarketModel > &forwardModel)
Curve state for Libor market models
void setOnForwardRates(const std::vector< Rate > &fwdRates, Size firstValidIndex=0)
const std::vector< Rate > & coterminalSwapRates() const override
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
Utility functions for mapping between swap rate and forward rate.