QuantLib: a free/open-source library for quantitative finance
fully annotated source code - version 1.34
Loading...
Searching...
No Matches
lognormalfwdratepc.hpp
Go to the documentation of this file.
1/* -*- mode: c++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2
3/*
4 Copyright (C) 2006 Ferdinando Ametrano
5 Copyright (C) 2006 Mark Joshi
6
7 This file is part of QuantLib, a free-software/open-source library
8 for financial quantitative analysts and developers - http://quantlib.org/
9
10 QuantLib is free software: you can redistribute it and/or modify it
11 under the terms of the QuantLib license. You should have received a
12 copy of the license along with this program; if not, please email
13 <quantlib-dev@lists.sf.net>. The license is also available online at
14 <http://quantlib.org/license.shtml>.
15
16 This program is distributed in the hope that it will be useful, but WITHOUT
17 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
18 FOR A PARTICULAR PURPOSE. See the license for more details.
19*/
20
21#ifndef quantlib_forward_rate_pc_evolver_hpp
22#define quantlib_forward_rate_pc_evolver_hpp
23
27
28namespace QuantLib {
29
30 class MarketModel;
31 class BrownianGenerator;
32 class BrownianGeneratorFactory;
33
34 //! Predictor-Corrector
36 public:
37 LogNormalFwdRatePc(const ext::shared_ptr<MarketModel>&,
39 const std::vector<Size>& numeraires,
40 Size initialStep = 0);
41 //! \name MarketModel interface
42 //@{
43 const std::vector<Size>& numeraires() const override;
44 Real startNewPath() override;
45 Real advanceStep() override;
46 Size currentStep() const override;
47 const CurveState& currentState() const override;
48 void setInitialState(const CurveState&) override;
49 //@}
50 private:
51 void setForwards(const std::vector<Real>& forwards);
52 // inputs
53 ext::shared_ptr<MarketModel> marketModel_;
54 std::vector<Size> numeraires_;
56 ext::shared_ptr<BrownianGenerator> generator_;
57 // fixed variables
58 std::vector<std::vector<Real> > fixedDrifts_;
59 // working variables
64 std::vector<Real> drifts1_, drifts2_, initialDrifts_;
65 std::vector<Real> brownians_, correlatedBrownians_;
66 std::vector<Size> alive_;
67 // helper classes
68 std::vector<LMMDriftCalculator> calculators_;
69 };
70
71}
72
73#endif
Curve state for market-model simulations
Definition: curvestate.hpp:41
Curve state for Libor market models
std::vector< Rate > displacements_
const CurveState & currentState() const override
void setForwards(const std::vector< Real > &forwards)
Size currentStep() const override
std::vector< std::vector< Real > > fixedDrifts_
std::vector< Rate > initialLogForwards_
ext::shared_ptr< MarketModel > marketModel_
std::vector< Real > initialDrifts_
std::vector< Real > correlatedBrownians_
const std::vector< Size > & numeraires() const override
std::vector< LMMDriftCalculator > calculators_
ext::shared_ptr< BrownianGenerator > generator_
void setInitialState(const CurveState &) override
Market-model evolver.
Definition: evolver.hpp:35
QL_REAL Real
real number
Definition: types.hpp:50
std::size_t Size
size of a container
Definition: types.hpp:58
Drift computation for Libor market model.
Definition: any.hpp:35