marketmodels.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, 2007 Ferdinando Ametrano
5  Copyright (C) 2007 Chiara Fornarola
6  Copyright (C) 2006, 2007 Marco Bianchetti
7  Copyright (C) 2006, 2007 Cristina Duminuco
8  Copyright (C) 2006, 2007 Giorgio Facchinetti
9 
10  This file is part of QuantLib, a free-software/open-source library
11  for financial quantitative analysts and developers - http://quantlib.org/
12 
13  QuantLib is free software: you can redistribute it and/or modify it
14  under the terms of the QuantLib license. You should have received a
15  copy of the license along with this program; if not, please email
16  <quantlib-dev@lists.sf.net>. The license is also available online at
17  <http://quantlib.org/license.shtml>.
18 
19  This program is distributed in the hope that it will be useful, but WITHOUT
20  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
21  FOR A PARTICULAR PURPOSE. See the license for more details.
22 */
23 
24 #ifndef qla_market_models_hpp
25 #define qla_market_models_hpp
26 
27 #include <oh/libraryobject.hpp>
28 
29 #include <ql/types.hpp>
30 
31 namespace QuantLib {
32  class MarketModel;
33  class PiecewiseConstantCorrelation;
34  class EvolutionDescription;
35  class CTSMMCapletCalibration;
36  class YieldTermStructure;
37  class MarketModelFactory;
38 
39  template <class T>
40  class Handle;
41 }
42 
43 namespace QuantLibAddin {
44 
45  // MarketModels
46  OH_LIB_CLASS(MarketModel, QuantLib::MarketModel);
47 
48  class FlatVol : public MarketModel {
49  public:
50  FlatVol(
51  const boost::shared_ptr<ObjectHandler::ValueObject>& properties,
52  const std::vector<QuantLib::Volatility>& volatilities,
53  const boost::shared_ptr<QuantLib::PiecewiseConstantCorrelation>& corr,
54  const QuantLib::EvolutionDescription& evolution,
55  const QuantLib::Size numberOfFactors,
56  const std::vector<QuantLib::Rate>& initialRates,
57  const std::vector<QuantLib::Rate>& displacements,
58  bool permanent);
59  };
60 
61 
62  class AbcdVol : public MarketModel {
63  public:
64  AbcdVol(
65  const boost::shared_ptr<ObjectHandler::ValueObject>& properties,
66  QuantLib::Real a,
67  QuantLib::Real b,
68  QuantLib::Real c,
69  QuantLib::Real d,
70  const std::vector<QuantLib::Real>& ks,
71  const boost::shared_ptr<QuantLib::PiecewiseConstantCorrelation>& corr,
72  const QuantLib::EvolutionDescription& evolution,
73  const QuantLib::Size numberOfFactors,
74  const std::vector<QuantLib::Rate>& initialRates,
75  const std::vector<QuantLib::Rate>& displacements,
76  bool permanent);
77  };
78 
79  class PseudoRootFacade : public MarketModel {
80  public:
82  const boost::shared_ptr<ObjectHandler::ValueObject>& properties,
83  const boost::shared_ptr<QuantLib::CTSMMCapletCalibration> calibrator,
84  bool permanent);
85  };
86 
87  class CotSwapToFwdAdapter : public MarketModel {
88  public:
90  const boost::shared_ptr<ObjectHandler::ValueObject>& properties,
91  const boost::shared_ptr<QuantLib::MarketModel>& coterminalModel,
92  bool permanent);
93  };
94 
95  class FwdPeriodAdapter : public MarketModel {
96  public:
98  const boost::shared_ptr<ObjectHandler::ValueObject>& properties,
99  const boost::shared_ptr<QuantLib::MarketModel>& largeModel,
100  QuantLib::Size period,
101  QuantLib::Size offset,
102  const std::vector<QuantLib::Spread>& newDisplacements_,
103  bool permanent);
104  };
105 
106  class FwdToCotSwapAdapter : public MarketModel {
107  public:
109  const boost::shared_ptr<ObjectHandler::ValueObject>& properties,
110  const boost::shared_ptr<QuantLib::MarketModel>& forwardModel,
111  bool permanent);
112  };
113 
114  // MarketModelFactories
115  OH_LIB_CLASS(MarketModelFactory, QuantLib::MarketModelFactory);
116 
117  class FlatVolFactory : public MarketModelFactory {
118  public:
119  FlatVolFactory(const boost::shared_ptr<ObjectHandler::ValueObject>& properties,
120  QuantLib::Real longTermCorr,
121  QuantLib::Real beta,
122  const std::vector<QuantLib::Time>& times,
123  const std::vector<QuantLib::Volatility>& vols,
125  QuantLib::Spread displacement,
126  bool permanent);
127  };
128 
129 
130  //class SwapCovarianceApproximator : public ObjectHandler::LibraryObject<
131  // QuantLib::SwapCovarianceApproximator> {
132  // public:
133  // SwapCovarianceApproximator(const QuantLib::CurveState& initialCurveState,
134  // QuantLib::Size expiry,
135  // QuantLib::Size maturity,
136  // QuantLib::Spread displacement,
137  // const QuantLib::Matrix& forwardCovarianceMatrix);
138  // QuantLib::Disposable<QuantLib::Matrix> swapCovarianceMatrix();
139  //};
140 
141  std::vector<QuantLib::Real> qlRateVolDifferences(
142  const QuantLib::MarketModel&,
143  const QuantLib::MarketModel&);
144 
145  std::vector<QuantLib::Real> qlRateInstVolDifferences(
146  const QuantLib::MarketModel&,
147  const QuantLib::MarketModel&,
148  QuantLib::Size);
149 }
150 
151 #endif
152 
Definition: basketlossmodels.hpp:32
std::vector< QuantLib::Real > qlRateInstVolDifferences(const QuantLib::MarketModel &, const QuantLib::MarketModel &, QuantLib::Size)
FwdToCotSwapAdapter(const boost::shared_ptr< ObjectHandler::ValueObject > &properties, const boost::shared_ptr< QuantLib::MarketModel > &forwardModel, bool permanent)
PseudoRootFacade(const boost::shared_ptr< ObjectHandler::ValueObject > &properties, const boost::shared_ptr< QuantLib::CTSMMCapletCalibration > calibrator, bool permanent)
Definition: marketmodels.hpp:117
OH_LIB_CLASS(AlphaForm, QuantLib::AlphaForm)
FlatVol(const boost::shared_ptr< ObjectHandler::ValueObject > &properties, const std::vector< QuantLib::Volatility > &volatilities, const boost::shared_ptr< QuantLib::PiecewiseConstantCorrelation > &corr, const QuantLib::EvolutionDescription &evolution, const QuantLib::Size numberOfFactors, const std::vector< QuantLib::Rate > &initialRates, const std::vector< QuantLib::Rate > &displacements, bool permanent)
CotSwapToFwdAdapter(const boost::shared_ptr< ObjectHandler::ValueObject > &properties, const boost::shared_ptr< QuantLib::MarketModel > &coterminalModel, bool permanent)
Definition: marketmodels.hpp:79
std::vector< QuantLib::Real > qlRateVolDifferences(const QuantLib::MarketModel &, const QuantLib::MarketModel &)
Definition: abcd.hpp:38
AbcdVol(const boost::shared_ptr< ObjectHandler::ValueObject > &properties, QuantLib::Real a, QuantLib::Real b, QuantLib::Real c, QuantLib::Real d, const std::vector< QuantLib::Real > &ks, const boost::shared_ptr< QuantLib::PiecewiseConstantCorrelation > &corr, const QuantLib::EvolutionDescription &evolution, const QuantLib::Size numberOfFactors, const std::vector< QuantLib::Rate > &initialRates, const std::vector< QuantLib::Rate > &displacements, bool permanent)
Definition: abcd.hpp:30
Definition: marketmodels.hpp:48
FwdPeriodAdapter(const boost::shared_ptr< ObjectHandler::ValueObject > &properties, const boost::shared_ptr< QuantLib::MarketModel > &largeModel, QuantLib::Size period, QuantLib::Size offset, const std::vector< QuantLib::Spread > &newDisplacements_, bool permanent)
FlatVolFactory(const boost::shared_ptr< ObjectHandler::ValueObject > &properties, QuantLib::Real longTermCorr, QuantLib::Real beta, const std::vector< QuantLib::Time > &times, const std::vector< QuantLib::Volatility > &vols, const QuantLib::Handle< QuantLib::YieldTermStructure > &yieldCurve, QuantLib::Spread displacement, bool permanent)
Definition: marketmodels.hpp:87
Definition: marketmodels.hpp:95
Definition: marketmodels.hpp:106
Definition: marketmodels.hpp:62