correlation.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  Copyright (C) 2007 Katiuscia Manzoni
10 
11  This file is part of QuantLib, a free-software/open-source library
12  for financial quantitative analysts and developers - http://quantlib.org/
13 
14  QuantLib is free software: you can redistribute it and/or modify it
15  under the terms of the QuantLib license. You should have received a
16  copy of the license along with this program; if not, please email
17  <quantlib-dev@lists.sf.net>. The license is also available online at
18  <http://quantlib.org/license.shtml>.
19 
20  This program is distributed in the hope that it will be useful, but WITHOUT
21  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
22  FOR A PARTICULAR PURPOSE. See the license for more details.
23 */
24 
25 #ifndef qla_correlation_hpp
26 #define qla_correlation_hpp
27 
28 #include <oh/libraryobject.hpp>
29 
30 #include <ql/types.hpp>
31 
32 namespace QuantLib {
33  class LmCorrelationModel;
34  class PiecewiseConstantCorrelation;
35  class Matrix;
36  class CurveState;
37  class EvolutionDescription;
38  class Date;
39  class Period;
40  class InterestRateIndex;
41  class IborIndex;
42  class SwapIndex;
43  class DayCounter;
44  class HistoricalForwardRatesAnalysis;
45  class HistoricalRatesAnalysis;
46 
47  class GeneralStatistics;
48 
49  template<class Stat>
51 
53 
54  template <class S>
56 
58 
60 
61  template <class StatisticsType>
63 
65 }
66 
67 namespace QuantLibAddin {
68 
69  OH_LIB_CLASS(LmCorrelationModel, QuantLib::LmCorrelationModel);
70 
71  class LmLinearExponentialCorrelationModel : public LmCorrelationModel {
72  public:
73  LmLinearExponentialCorrelationModel(const boost::shared_ptr<ObjectHandler::ValueObject>& properties,
74  QuantLib::Size size,
75  QuantLib::Real rho,
76  QuantLib::Real beta,
77  QuantLib::Size factors,
78  bool permanent);
79 
80  };
81 
82  OH_LIB_CLASS(PiecewiseConstantCorrelation, QuantLib::PiecewiseConstantCorrelation);
83 
84  class TimeHomogeneousForwardCorrelation : public PiecewiseConstantCorrelation {
85  public:
87  const boost::shared_ptr<ObjectHandler::ValueObject>& properties,
88  const QuantLib::Matrix& fwdCorrelation,
89  const std::vector<QuantLib::Time>& rateTimes,
90  bool permanent);
91  };
92 
93  class ExponentialForwardCorrelation : public PiecewiseConstantCorrelation {
94  public:
96  const boost::shared_ptr<ObjectHandler::ValueObject>& properties,
97  const std::vector<QuantLib::Time>& rateTimes,
98  QuantLib::Real longTermCorr,
99  QuantLib::Real beta,
100  QuantLib::Real gamma,
101  const std::vector<QuantLib::Time>& times,
102  bool permanent);
103  };
104 
105  class CotSwapFromFwdCorrelation : public PiecewiseConstantCorrelation {
106  public:
108  const boost::shared_ptr<ObjectHandler::ValueObject>& properties,
109  const boost::shared_ptr<QuantLib::PiecewiseConstantCorrelation>&,
110  const QuantLib::CurveState& curveState,
111  QuantLib::Real displacement,
112  bool permanent);
113  };
114 
116  ObjectHandler::LibraryObject<QuantLib::HistoricalForwardRatesAnalysis> {
117  public:
119  const boost::shared_ptr<ObjectHandler::ValueObject>& properties,
120  const boost::shared_ptr<QuantLib::SequenceStatistics>& stats,
121  const QuantLib::Date& startDate,
122  const QuantLib::Date& endDate,
123  const QuantLib::Period& step,
124  const boost::shared_ptr<QuantLib::InterestRateIndex>&,
125  const QuantLib::Period& initialGap,
126  const QuantLib::Period& horizon,
127  const std::vector<boost::shared_ptr<QuantLib::IborIndex> >&,
128  const std::vector<boost::shared_ptr<QuantLib::SwapIndex> >&,
129  const QuantLib::DayCounter& yieldCurveDayCounter,
130  const std::string& traitsID,
131  const std::string& interpolatorID,
132  QuantLib::Real yieldCurveAccuracy,
133  bool permanent);
134  };
135 
136  class HistoricalRatesAnalysis : public
137  ObjectHandler::LibraryObject<QuantLib::HistoricalRatesAnalysis> {
138  public:
140  const boost::shared_ptr<ObjectHandler::ValueObject>& properties,
141  const boost::shared_ptr<QuantLib::SequenceStatistics>& stats,
142  const QuantLib::Date& startDate,
143  const QuantLib::Date& endDate,
144  const QuantLib::Period& step,
145  const std::vector<boost::shared_ptr<QuantLib::InterestRateIndex> >&,
146  bool permanent);
147  };
148 
149 
150 }
151 
152 #endif
153 
Definition: correlation.hpp:93
HistoricalForwardRatesAnalysis(const boost::shared_ptr< ObjectHandler::ValueObject > &properties, const boost::shared_ptr< QuantLib::SequenceStatistics > &stats, const QuantLib::Date &startDate, const QuantLib::Date &endDate, const QuantLib::Period &step, const boost::shared_ptr< QuantLib::InterestRateIndex > &, const QuantLib::Period &initialGap, const QuantLib::Period &horizon, const std::vector< boost::shared_ptr< QuantLib::IborIndex > > &, const std::vector< boost::shared_ptr< QuantLib::SwapIndex > > &, const QuantLib::DayCounter &yieldCurveDayCounter, const std::string &traitsID, const std::string &interpolatorID, QuantLib::Real yieldCurveAccuracy, bool permanent)
LmLinearExponentialCorrelationModel(const boost::shared_ptr< ObjectHandler::ValueObject > &properties, QuantLib::Size size, QuantLib::Real rho, QuantLib::Real beta, QuantLib::Size factors, bool permanent)
CotSwapFromFwdCorrelation(const boost::shared_ptr< ObjectHandler::ValueObject > &properties, const boost::shared_ptr< QuantLib::PiecewiseConstantCorrelation > &, const QuantLib::CurveState &curveState, QuantLib::Real displacement, bool permanent)
OH_LIB_CLASS(AlphaForm, QuantLib::AlphaForm)
Definition: correlation.hpp:136
GenericSequenceStatistics< Statistics > SequenceStatistics
Definition: correlation.hpp:62
Definition: correlation.hpp:115
GenericRiskStatistics< GaussianStatistics > RiskStatistics
Definition: correlation.hpp:55
ExponentialForwardCorrelation(const boost::shared_ptr< ObjectHandler::ValueObject > &properties, const std::vector< QuantLib::Time > &rateTimes, QuantLib::Real longTermCorr, QuantLib::Real beta, QuantLib::Real gamma, const std::vector< QuantLib::Time > &times, bool permanent)
RiskStatistics Statistics
Definition: correlation.hpp:59
Definition: correlation.hpp:62
Definition: correlation.hpp:50
Definition: abcd.hpp:38
GenericGaussianStatistics< GeneralStatistics > GaussianStatistics
Definition: correlation.hpp:50
TimeHomogeneousForwardCorrelation(const boost::shared_ptr< ObjectHandler::ValueObject > &properties, const QuantLib::Matrix &fwdCorrelation, const std::vector< QuantLib::Time > &rateTimes, bool permanent)
Definition: correlation.hpp:55
Definition: abcd.hpp:30
HistoricalRatesAnalysis(const boost::shared_ptr< ObjectHandler::ValueObject > &properties, const boost::shared_ptr< QuantLib::SequenceStatistics > &stats, const QuantLib::Date &startDate, const QuantLib::Date &endDate, const QuantLib::Period &step, const std::vector< boost::shared_ptr< QuantLib::InterestRateIndex > > &, bool permanent)
Definition: correlation.hpp:105