29 const ext::shared_ptr<MarketModel>& marketModel,
31 const std::vector<Size>& numeraires,
33 : marketModel_(marketModel),
34 numeraires_(numeraires),
35 initialStep_(initialStep),
36 numberOfRates_(marketModel->numberOfRates()),
37 numberOfFactors_(marketModel->numberOfFactors()),
38 curveState_(marketModel->evolution().rateTimes()),
39 forwards_(marketModel->initialRates()),
40 displacements_(marketModel->displacements()),
41 logForwards_(numberOfRates_), initialLogForwards_(numberOfRates_),
42 initialDrifts_(numberOfRates_), brownians_(numberOfFactors_),
43 correlatedBrownians_(numberOfRates_),
44 rateTaus_(marketModel->evolution().rateTaus()),
45 alive_(marketModel->evolution().firstAliveRate())
49 "terminal measure required for iBalland " );
51 Size steps = marketModel->evolution().numberOfSteps();
59 for (
Size j=0; j<steps; ++j) {
60 const Matrix& A = marketModel->pseudoRoot(j);
63 const Matrix& C = marketModel->covariance(j);
82 "mismatch between forwards and rateTimes");
129 drifts2 -= g_[j]*C[i][j];
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< Rate > displacements_
Real advanceStep() override
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< Size > alive_
std::vector< Rate > initialLogForwards_
ext::shared_ptr< MarketModel > marketModel_
std::vector< Real > initialDrifts_
std::vector< Time > rateTaus_
std::vector< Size > numeraires_
const std::vector< Size > & numeraires() const override
std::vector< LMMDriftCalculator > calculators_
ext::shared_ptr< BrownianGenerator > generator_
LogNormalFwdRateiBalland(const ext::shared_ptr< MarketModel > &, const BrownianGeneratorFactory &, const std::vector< Size > &numeraires, Size initialStep=0)
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
QL_INTEGER Integer
integer number
std::size_t Size
size of a container
Drift computation for Libor market model.
void checkCompatibility(const EvolutionDescription &evolution, const std::vector< Size > &numeraires)
bool isInTerminalMeasure(const EvolutionDescription &evolution, const std::vector< Size > &numeraires)