Logo
Fully annotated reference manual - version 1.8.12
Loading...
Searching...
No Matches
defaultcurve.hpp
Go to the documentation of this file.
1/*
2 Copyright (C) 2016 Quaternion Risk Management Ltd
3 All rights reserved.
4
5 This file is part of ORE, a free-software/open-source library
6 for transparent pricing and risk analysis - http://opensourcerisk.org
7
8 ORE is free software: you can redistribute it and/or modify it
9 under the terms of the Modified BSD License. You should have received a
10 copy of the license along with this program.
11 The license is also available online at <http://opensourcerisk.org>
12
13 This program is distributed on the basis that it will form a useful
14 contribution to risk analytics and model standardisation, but WITHOUT
15 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
16 FITNESS FOR A PARTICULAR PURPOSE. See the license for more details.
17*/
18
19/*! \file ored/marketdata/defaultcurve.hpp
20 \brief Wrapper class for building Default curves
21 \ingroup curves
22*/
23
24#pragma once
25
30#include <ql/termstructures/credit/interpolatedhazardratecurve.hpp>
31#include <ql/termstructures/credit/piecewisedefaultcurve.hpp>
33
34namespace ore {
35namespace data {
38using QuantLib::Date;
39
40class YieldCurve;
41
42//! Wrapper class for building Swaption volatility structures
43/*!
44 \ingroup curves
45*/
47public:
48 //! \name Constructors
49 //@{
50 //! Default constructor
52
53 //! Detailed constructor
55 map<string, QuantLib::ext::shared_ptr<YieldCurve>>& yieldCurves,
56 map<string, QuantLib::ext::shared_ptr<DefaultCurve>>& defaultCurves);
57 //@}
58 //! \name Inspectors
59 //@{
60 const DefaultCurveSpec& spec() const { return spec_; }
61 const QuantLib::ext::shared_ptr<QuantExt::CreditCurve>& creditCurve() const { return curve_; }
62 Real recoveryRate() { return recoveryRate_; }
63 //@}
64private:
66 QuantLib::ext::shared_ptr<QuantExt::CreditCurve> curve_;
68
69 //! Build a default curve from CDS spread quotes
70 void buildCdsCurve(const std::string& curveID, const DefaultCurveConfig::Config& config, const QuantLib::Date& asof,
71 const DefaultCurveSpec& spec, const Loader& loader,
72 std::map<std::string, QuantLib::ext::shared_ptr<YieldCurve>>& yieldCurves);
73
74 //! Build a default curve from hazard rate quotes
75 void buildHazardRateCurve(const std::string& curveID, const DefaultCurveConfig::Config& config,
76 const QuantLib::Date& asof, const DefaultCurveSpec& spec, const Loader& loader);
77
78 //! Build a default curve implied from a spread over a benchmark curve
79 void buildBenchmarkCurve(const std::string& curveID, const DefaultCurveConfig::Config& config,
80 const QuantLib::Date& asof, const DefaultCurveSpec& spec, const Loader& loader,
81 std::map<std::string, QuantLib::ext::shared_ptr<YieldCurve>>& yieldCurves);
82
83 //! Build a multi section curve
84 void buildMultiSectionCurve(const std::string& curveID, const DefaultCurveConfig::Config& config, const Date& asof,
85 const DefaultCurveSpec& spec, const Loader& loader,
86 map<string, QuantLib::ext::shared_ptr<DefaultCurve>>& defaultCurves);
87
88 void buildTransitionMatrixCurve(const std::string& curveID, const DefaultCurveConfig::Config& config,
89 const Date& asof, const DefaultCurveSpec& spec, const Loader& loader,
90 map<string, QuantLib::ext::shared_ptr<DefaultCurve>>& defaultCurves);
91
92 //! Build a null curve (null rate, null recovery)
93 void buildNullCurve(const std::string& curveID, const DefaultCurveConfig::Config& config, const Date& asof,
94 const DefaultCurveSpec& spec);
95};
96
97} // namespace data
98} // namespace ore
Repository for currency dependent market conventions.
Container class for all Curve Configurations.
Wrapper class for building Swaption volatility structures.
QuantLib::ext::shared_ptr< QuantExt::CreditCurve > curve_
DefaultCurveSpec spec_
DefaultCurve()
Default constructor.
void buildHazardRateCurve(const std::string &curveID, const DefaultCurveConfig::Config &config, const QuantLib::Date &asof, const DefaultCurveSpec &spec, const Loader &loader)
Build a default curve from hazard rate quotes.
const DefaultCurveSpec & spec() const
void buildMultiSectionCurve(const std::string &curveID, const DefaultCurveConfig::Config &config, const Date &asof, const DefaultCurveSpec &spec, const Loader &loader, map< string, QuantLib::ext::shared_ptr< DefaultCurve > > &defaultCurves)
Build a multi section curve.
void buildCdsCurve(const std::string &curveID, const DefaultCurveConfig::Config &config, const QuantLib::Date &asof, const DefaultCurveSpec &spec, const Loader &loader, std::map< std::string, QuantLib::ext::shared_ptr< YieldCurve > > &yieldCurves)
Build a default curve from CDS spread quotes.
void buildBenchmarkCurve(const std::string &curveID, const DefaultCurveConfig::Config &config, const QuantLib::Date &asof, const DefaultCurveSpec &spec, const Loader &loader, std::map< std::string, QuantLib::ext::shared_ptr< YieldCurve > > &yieldCurves)
Build a default curve implied from a spread over a benchmark curve.
void buildTransitionMatrixCurve(const std::string &curveID, const DefaultCurveConfig::Config &config, const Date &asof, const DefaultCurveSpec &spec, const Loader &loader, map< string, QuantLib::ext::shared_ptr< DefaultCurve > > &defaultCurves)
const QuantLib::ext::shared_ptr< QuantExt::CreditCurve > & creditCurve() const
void buildNullCurve(const std::string &curveID, const DefaultCurveConfig::Config &config, const Date &asof, const DefaultCurveSpec &spec)
Build a null curve (null rate, null recovery)
Default curve description.
Definition: curvespec.hpp:132
Market data loader base class.
Definition: loader.hpp:47
Currency and instrument specific conventions/defaults.
Curve configuration repository.
Curve requirements specification.
Market Datum Loader Interface.
@ data
Definition: log.hpp:77
Serializable Credit Default Swap.
Definition: namespaces.docs:23
vector< string > curveConfigs