30 const Size spanningForwards,
31 const ext::shared_ptr<MarketModel>& marketModel,
33 const std::vector<Size>& numeraires,
35 : spanningForwards_(spanningForwards),
36 marketModel_(marketModel),
37 numeraires_(numeraires),
38 initialStep_(initialStep),
39 numberOfRates_(marketModel->numberOfRates()),
40 numberOfFactors_(marketModel_->numberOfFactors()),
41 curveState_(marketModel->evolution().rateTimes(), spanningForwards),
42 swapRates_(marketModel->initialRates()),
43 displacements_(marketModel->displacements()),
44 logSwapRates_(numberOfRates_), initialLogSwapRates_(numberOfRates_),
45 drifts1_(numberOfRates_), drifts2_(numberOfRates_),
46 initialDrifts_(numberOfRates_), brownians_(numberOfFactors_),
47 correlatedBrownians_(numberOfRates_),
48 alive_(marketModel->evolution().firstAliveRate())
52 Size steps = marketModel->evolution().numberOfSteps();
60 for (
Size j=0; j<steps; ++j) {
84 "mismatch between swapRates and rateTimes");
virtual ext::shared_ptr< BrownianGenerator > create(Size factors, Size steps) const =0
Curve state for constant-maturity-swap market models
const std::vector< Rate > & cmSwapRates(Size spanningForwards) const override
void setOnCMSwapRates(const std::vector< Rate > &cmSwapRates, Size firstValidIndex=0)
Curve state for market-model simulations
LogNormalCmSwapRatePc(Size spanningForwards, const ext::shared_ptr< MarketModel > &, const BrownianGeneratorFactory &, const std::vector< Size > &numeraires, Size initialStep=0)
std::vector< Rate > initialLogSwapRates_
std::vector< Real > drifts1_
std::vector< Rate > displacements_
Real advanceStep() override
Real startNewPath() override
void setCMSwapRates(const std::vector< Real > &swapRates)
const CurveState & currentState() const override
std::vector< Real > brownians_
CMSwapCurveState curveState_
Size currentStep() const override
std::vector< std::vector< Real > > fixedDrifts_
std::vector< Real > drifts2_
std::vector< Size > alive_
ext::shared_ptr< MarketModel > marketModel_
std::vector< Rate > swapRates_
std::vector< Real > initialDrifts_
std::vector< Size > numeraires_
std::vector< CMSMMDriftCalculator > calculators_
const std::vector< Size > & numeraires() const override
ext::shared_ptr< BrownianGenerator > generator_
std::vector< Rate > logSwapRates_
void setInitialState(const CurveState &) override
Matrix used in linear algebra.
const_row_iterator row_begin(Size i) const
const_row_iterator row_end(Size i) const
Drift computation for CMS market model.
#define QL_REQUIRE(condition, message)
throw an error if the given pre-condition is not verified
LinearInterpolation variance
std::size_t Size
size of a container
void checkCompatibility(const EvolutionDescription &evolution, const std::vector< Size > &numeraires)