31 const ext::shared_ptr<MarketModelVolProcess>& volProcess,
32 Size firstVolatilityFactor,
33 Size volatilityFactorStep,
34 const std::vector<Size>& numeraires,
36 : marketModel_(marketModel),
37 volProcess_(volProcess),
38 firstVolatilityFactor_(firstVolatilityFactor),
39 volFactorsPerStep_(volProcess->variatesPerStep()),
40 numeraires_(numeraires),
41 initialStep_(initialStep),
42 isVolVariate_(false,volProcess->variatesPerStep()+marketModel_->numberOfFactors()),
43 numberOfRates_(marketModel->numberOfRates()),
44 numberOfFactors_(marketModel_->numberOfFactors()),
45 curveState_(marketModel->evolution().rateTimes()),
46 forwards_(marketModel->initialRates()),
47 displacements_(marketModel->displacements()),
48 logForwards_(numberOfRates_), initialLogForwards_(numberOfRates_),
49 drifts1_(numberOfRates_), drifts2_(numberOfRates_),
50 initialDrifts_(numberOfRates_), allBrownians_(volProcess->variatesPerStep()+marketModel_->numberOfFactors()),
51 brownians_(numberOfFactors_),
52 volBrownians_(volProcess->variatesPerStep()),
53 correlatedBrownians_(numberOfRates_),
54 alive_(marketModel->evolution().firstAliveRate())
56 QL_REQUIRE(initialStep ==0,
"initial step zero only supported currently. ");
59 Size steps = marketModel->evolution().numberOfSteps();
67 for (
Size j=0; j<steps; ++j)
102 "mismatch between forwards and rateTimes");
160 Real varianceMultiplier = sdMultiplier*sdMultiplier;
188 return weight*weight2;
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)
Matrix used in linear algebra.
const_row_iterator row_begin(Size i) const
const_row_iterator row_end(Size i) const
std::vector< Real > drifts1_
std::vector< Real > allBrownians_
std::vector< Rate > displacements_
std::vector< Real > volBrownians_
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::valarray< bool > isVolVariate_
std::vector< Rate > logForwards_
Size currentStep() const override
std::vector< std::vector< Real > > fixedDrifts_
std::vector< Real > drifts2_
std::vector< Size > alive_
Size firstVolatilityFactor_
std::vector< Rate > initialLogForwards_
ext::shared_ptr< MarketModel > marketModel_
std::vector< Real > initialDrifts_
SVDDFwdRatePc(const ext::shared_ptr< MarketModel > &, const BrownianGeneratorFactory &, const ext::shared_ptr< MarketModelVolProcess > &volProcess, Size firstVolatilityFactor, Size volatilityFactorStep, const std::vector< Size > &numeraires, Size initialStep=0)
std::vector< Size > numeraires_
ext::shared_ptr< MarketModelVolProcess > volProcess_
const std::vector< Size > & numeraires() const override
std::vector< LMMDriftCalculator > calculators_
ext::shared_ptr< BrownianGenerator > generator_
LMMCurveState curveState_
void setInitialState(const CurveState &) override
#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)