Logo
Fully annotated reference manual - version 1.8.12
Loading...
Searching...
No Matches
irmodeldata.hpp
Go to the documentation of this file.
1/*
2 Copyright (C) 2022 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 model/irmodeldata.hpp
20 \brief Generic interest rate model data
21 \ingroup models
22*/
23
24#pragma once
25
27#include <ql/types.hpp>
28#include <vector>
29
30namespace ore {
31namespace data {
32using namespace QuantLib;
33
34//! Supported calibration parameter type
35enum class ParamType {
37 Piecewise // i.e. time-dependent, but piecewise constant
38};
39
40//! Convert parameter type string into enumerated class value
41ParamType parseParamType(const string& s);
42//! Convert enumerated class value into a string
43std::ostream& operator<<(std::ostream& oss, const ParamType& type);
44
45//! Supported calibration types
46enum class CalibrationType {
47 /*! Choose this option if the component's calibration strategy is expected to
48 yield a perfect match of model to market prices. For example, this can be
49 achieved when calibrating an IR component to a series of co-terminal
50 swaptions with given mean reversion speed and piecewise volatility
51 function (alpha) where jump times coincide with expiry dates in the swaption
52 basket. Similarly, when calibrating an FX component to a series of FX Options.
53 The calibration routine will throw an exception if no perfect match is
54 achieved.
55 */
57 /*! Choose this if no perfect match like above can be expected, for example when
58 an IR component with constant parameters is calibrated to a basket of swaptions.
59 The calibration routine will consequently not throw an exception when the match
60 is imperfect.
61 */
62 BestFit,
63 /*! No calibration
64 */
65 None
66};
67
68//! Supported calibration strategies
70
71//! Convert calibration type string into enumerated class value
73//! Convert enumerated class value into a string
74std::ostream& operator<<(std::ostream& oss, const CalibrationType& type);
75
76//! Convert calibration strategy string into enumerated class value
78//! Convert enumerated class value into a string
79std::ostream& operator<<(std::ostream& oss, const CalibrationStrategy& type);
80
81//! Linear Gauss Markov Model Parameters
82/*!
83 This class contains the description of a Linear Gauss Markov interest rate model
84 and instructions for how to calibrate it.
85
86 \ingroup models
87 */
89public:
90 //! minimal constructor
92
93 //! Detailed constructor
94 IrModelData(const std::string& name,const std::string& qualifier, CalibrationType calibrationType)
96
97 //! Clear list of calibration instruments
98 virtual void clear();
99
100 //! Reset member variables to defaults
101 virtual void reset();
102
103 //! \name Serialisation
104 //@{
105 virtual void fromXML(XMLNode* node) override;
106 virtual XMLNode* toXML(XMLDocument& doc) const override;
107 //@}
108
109 //! \name Setters/Getters
110 //@{
111 const std::string& name() { return name_; }
112 std::string& qualifier() { return qualifier_; }
114
115 // ccy associated to qualifier, which might be an ibor / ois index name or a currency
116 virtual std::string ccy() const;
117 //@}
118
119protected:
120 std::string name_;
121 std::string qualifier_;
123};
124
125} // namespace data
126} // namespace ore
Linear Gauss Markov Model Parameters.
Definition: irmodeldata.hpp:88
const std::string & name()
CalibrationType & calibrationType()
IrModelData(const std::string &name)
minimal constructor
Definition: irmodeldata.hpp:91
CalibrationType calibrationType_
virtual std::string ccy() const
IrModelData(const std::string &name, const std::string &qualifier, CalibrationType calibrationType)
Detailed constructor.
Definition: irmodeldata.hpp:94
virtual void fromXML(XMLNode *node) override
virtual XMLNode * toXML(XMLDocument &doc) const override
virtual void clear()
Clear list of calibration instruments.
virtual void reset()
Reset member variables to defaults.
std::string & qualifier()
Small XML Document wrapper class.
Definition: xmlutils.hpp:65
Base class for all serializable classes.
Definition: xmlutils.hpp:101
@ data
Definition: log.hpp:77
std::ostream & operator<<(std::ostream &out, EquityReturnType t)
CalibrationType
Supported calibration types.
Definition: irmodeldata.hpp:46
ParamType
Supported calibration parameter type.
Definition: irmodeldata.hpp:35
CalibrationType parseCalibrationType(const string &s)
Convert calibration type string into enumerated class value.
Definition: irmodeldata.cpp:47
CalibrationStrategy parseCalibrationStrategy(const string &s)
Convert calibration strategy string into enumerated class value.
Definition: irmodeldata.cpp:70
ParamType parseParamType(const string &s)
Convert parameter type string into enumerated class value.
Definition: irmodeldata.cpp:38
CalibrationStrategy
Supported calibration strategies.
Definition: irmodeldata.hpp:69
Serializable Credit Default Swap.
Definition: namespaces.docs:23
XML utility functions.