30 const ext::shared_ptr<MarketModel>& marketModel,
32 const std::vector<Size>& numeraires,
34 : marketModel_(marketModel),
35 numeraires_(numeraires),
36 initialStep_(initialStep),
37 numberOfRates_(marketModel->numberOfRates()),
38 numberOfFactors_(marketModel_->numberOfFactors()),
39 curveState_(marketModel->evolution().rateTimes()),
40 swapRates_(marketModel->initialRates()),
41 displacements_(marketModel->displacements()),
42 logSwapRates_(numberOfRates_), initialLogSwapRates_(numberOfRates_),
43 drifts1_(numberOfRates_), drifts2_(numberOfRates_),
44 initialDrifts_(numberOfRates_),
45 brownians_(numberOfFactors_), correlatedBrownians_(numberOfRates_),
46 alive_(marketModel->evolution().firstAliveRate())
50 Size steps = marketModel->evolution().numberOfSteps();
58 for (
Size j=0; j<steps; ++j) {
82 "mismatch between swapRates and rateTimes");
virtual ext::shared_ptr< BrownianGenerator > create(Size factors, Size steps) const =0
Curve state for coterminal-swap market models
void setOnCoterminalSwapRates(const std::vector< Rate > &swapRates, Size firstValidIndex=0)
const std::vector< Rate > & coterminalSwapRates() const override
Curve state for market-model simulations
CoterminalSwapCurveState curveState_
std::vector< Rate > initialLogSwapRates_
std::vector< Real > drifts1_
std::vector< Rate > displacements_
LogNormalCotSwapRatePc(const ext::shared_ptr< MarketModel > &, const BrownianGeneratorFactory &, const std::vector< Size > &numeraires, Size initialStep=0)
Real advanceStep() override
void setCoterminalSwapRates(const std::vector< Real > &swapRates)
Real startNewPath() override
std::vector< SMMDriftCalculator > calculators_
const CurveState & currentState() const override
std::vector< Real > brownians_
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_
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
#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)
Drift computation for coterminal-swap market model.