QuantLib: a free/open-source library for quantitative finance
Fully annotated sources - version 1.32
Loading...
Searching...
No Matches
svddfwdratepc.hpp
1/* -*- mode: c++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2
3/*
4 Copyright (C) 2008 Mark Joshi
5
6 This file is part of QuantLib, a free-software/open-source library
7 for financial quantitative analysts and developers - http://quantlib.org/
8
9 QuantLib is free software: you can redistribute it and/or modify it
10 under the terms of the QuantLib license. You should have received a
11 copy of the license along with this program; if not, please email
12 <quantlib-dev@lists.sf.net>. The license is also available online at
13 <http://quantlib.org/license.shtml>.
14
15 This program is distributed in the hope that it will be useful, but WITHOUT
16 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
17 FOR A PARTICULAR PURPOSE. See the license for more details.
18*/
19
20#ifndef quantlib_svdd_forward_rate_pc_evolver_hpp
21#define quantlib_svdd_forward_rate_pc_evolver_hpp
22
23#include <ql/models/marketmodels/evolver.hpp>
24#include <ql/models/marketmodels/curvestates/lmmcurvestate.hpp>
25#include <ql/models/marketmodels/driftcomputation/lmmdriftcalculator.hpp>
26#include <valarray>
27
28namespace QuantLib {
29
30 class MarketModel;
31 class BrownianGenerator;
32 class BrownianGeneratorFactory;
33 class MarketModelVolProcess;
34
41 {
42 public:
43
44 SVDDFwdRatePc(const ext::shared_ptr<MarketModel>&,
46 const ext::shared_ptr<MarketModelVolProcess>& volProcess,
47 Size firstVolatilityFactor,
48 Size volatilityFactorStep,
49 const std::vector<Size>& numeraires,
50 Size initialStep = 0);
52
53 const std::vector<Size>& numeraires() const override;
54 Real startNewPath() override;
55 Real advanceStep() override;
56 Size currentStep() const override;
57 const CurveState& currentState() const override;
58 void setInitialState(const CurveState&) override;
60 private:
61 void setForwards(const std::vector<Real>& forwards);
62 // inputs
63 ext::shared_ptr<MarketModel> marketModel_;
64 ext::shared_ptr<BrownianGenerator> generator_;
65 ext::shared_ptr<MarketModelVolProcess> volProcess_;
66
69
70 std::vector<Size> numeraires_;
72
73
74 // fixed variables
75 std::vector<std::vector<Real> > fixedDrifts_;
76 std::valarray<bool> isVolVariate_;
77 // working variables
82 std::vector<Real> drifts1_, drifts2_, initialDrifts_;
84 std::vector<Size> alive_;
85 // helper classes
86 std::vector<LMMDriftCalculator> calculators_;
87 };
88
89}
90
91#endif
Curve state for market-model simulations
Definition: curvestate.hpp:41
Curve state for Libor market models
Market-model evolver.
Definition: evolver.hpp:35
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_
std::vector< Rate > initialLogForwards_
ext::shared_ptr< MarketModel > marketModel_
std::vector< Real > initialDrifts_
std::vector< Size > numeraires_
std::vector< Real > correlatedBrownians_
ext::shared_ptr< MarketModelVolProcess > volProcess_
const std::vector< Size > & numeraires() const override
std::vector< LMMDriftCalculator > calculators_
ext::shared_ptr< BrownianGenerator > generator_
void setInitialState(const CurveState &) override
QL_REAL Real
real number
Definition: types.hpp:50
std::size_t Size
size of a container
Definition: types.hpp:58
Definition: any.hpp:35