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 forwards_(marketModel->initialRates()),
41 displacements_(marketModel->displacements()),
42 logForwards_(numberOfRates_), initialLogForwards_(numberOfRates_),
43 drifts1_(numberOfRates_), drifts2_(numberOfRates_),
44 initialDrifts_(numberOfRates_), brownians_(numberOfFactors_),
45 correlatedBrownians_(numberOfRates_),
46 alive_(marketModel->evolution().firstAliveRate())
50 Size steps = marketModel->evolution().numberOfSteps();
58 for (
Size j=0; j<steps; ++j) {
82 "mismatch between forwards and rateTimes");
virtual ext::shared_ptr< BrownianGenerator > create(Size factors, Size steps) const =0
Curve state for market-model simulations
virtual const std::vector< Rate > & forwardRates() const =0
void setOnForwardRates(const std::vector< Rate > &fwdRates, Size firstValidIndex=0)
std::vector< Real > drifts1_
std::vector< Rate > displacements_
Real advanceStep() override
LogNormalFwdRatePc(const ext::shared_ptr< MarketModel > &, const BrownianGeneratorFactory &, const std::vector< Size > &numeraires, Size initialStep=0)
Real startNewPath() override
std::vector< Rate > forwards_
const CurveState & currentState() const override
void setForwards(const std::vector< Real > &forwards)
std::vector< Real > brownians_
std::vector< Rate > logForwards_
Size currentStep() const override
std::vector< std::vector< Real > > fixedDrifts_
std::vector< Real > drifts2_
std::vector< Size > alive_
std::vector< Rate > initialLogForwards_
ext::shared_ptr< MarketModel > marketModel_
std::vector< Real > initialDrifts_
std::vector< Size > numeraires_
const std::vector< Size > & numeraires() const override
std::vector< LMMDriftCalculator > calculators_
ext::shared_ptr< BrownianGenerator > generator_
LMMCurveState curveState_
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
Drift computation for Libor market model.
void checkCompatibility(const EvolutionDescription &evolution, const std::vector< Size > &numeraires)