Logo
Fully annotated reference manual - version 1.8.12
Loading...
Searching...
No Matches
crcirdata.hpp
Go to the documentation of this file.
1/*
2 Copyright (C) 2020 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/model/crcirdata.hpp
20 \brief CIR credit model data
21 \ingroup models
22*/
23
24#pragma once
25
26#include <vector>
27
28#include <ql/time/daycounters/actualactual.hpp>
29#include <ql/types.hpp>
30
35
36namespace ore {
37namespace data {
38using namespace QuantLib;
39
40class CrCirData : public XMLSerializable {
41public:
43
44 //! Default constructor
46
47 //! Detailed constructor
50 Real volatility, bool relaxedFeller, Real fellerFactor, Real tolerance,
51 std::vector<std::string> optionExpiries = std::vector<std::string>(),
52 std::vector<std::string> optionTerms = std::vector<std::string>(),
53 std::vector<std::string> optionStrikes = std::vector<std::string>())
58
59 //! \name Serialisation
60 //@{
61 void fromXML(XMLNode* node) override;
62 XMLNode* toXML(XMLDocument& doc) const override;
63 //@}
64
65 //! setter/getter for qualifier in derived classes
66
67 //! \name Setters/Getters
68 //@{
69 std::string& name() { return name_; }
70 std::string& currency() { return currency_; }
73 Real& startValue() { return startValue_; }
74 Real& reversionValue() { return reversionValue_; }
75 Real& longTermValue() { return longTermValue_; }
76 Real& volatility() { return volatility_; }
77 std::vector<std::string>& optionExpiries() { return optionExpiries_; }
78 std::vector<std::string>& optionTerms() { return optionTerms_; }
79 std::vector<std::string>& optionStrikes() { return optionStrikes_; }
80 bool& relaxedFeller() { return relaxedFeller_; }
81 Real& fellerFactor() { return fellerFactor_; }
82 Real& tolerance() { return tolerance_; }
83 //@}
84
85 //! \name Operators
86 //@{
87 bool operator==(const CrCirData& rhs);
88 bool operator!=(const CrCirData& rhs);
89 //@}
90
91private:
92 std::string name_;
93 std::string currency_;
100 std::vector<std::string> optionExpiries_;
101 std::vector<std::string> optionTerms_;
102 std::vector<std::string> optionStrikes_;
103};
104
106std::ostream& operator<<(std::ostream& oss, const CrCirData::CalibrationStrategy& s);
107
108} // namespace data
109} // namespace ore
CalibrationType & calibrationType()
Definition: crcirdata.hpp:71
Real & reversionValue()
Definition: crcirdata.hpp:74
std::string currency_
Definition: crcirdata.hpp:93
std::vector< std::string > & optionStrikes()
Definition: crcirdata.hpp:79
CalibrationType calibrationType_
Definition: crcirdata.hpp:94
CalibrationStrategy calibrationStrategy_
Definition: crcirdata.hpp:95
std::string name_
Definition: crcirdata.hpp:92
std::vector< std::string > optionTerms_
Definition: crcirdata.hpp:101
Real & longTermValue()
Definition: crcirdata.hpp:75
std::string & currency()
Definition: crcirdata.hpp:70
std::vector< std::string > optionExpiries_
Definition: crcirdata.hpp:100
void fromXML(XMLNode *node) override
Definition: crcirdata.cpp:62
CalibrationStrategy & calibrationStrategy()
Definition: crcirdata.hpp:72
std::string & name()
Definition: crcirdata.hpp:69
XMLNode * toXML(XMLDocument &doc) const override
Definition: crcirdata.cpp:125
std::vector< std::string > & optionTerms()
Definition: crcirdata.hpp:78
bool & relaxedFeller()
Definition: crcirdata.hpp:80
bool operator==(const CrCirData &rhs)
Definition: crcirdata.cpp:25
CrCirData()
Default constructor.
Definition: crcirdata.hpp:45
std::vector< std::string > & optionExpiries()
Definition: crcirdata.hpp:77
bool operator!=(const CrCirData &rhs)
Definition: crcirdata.cpp:40
CrCirData(std::string name, std::string currency, CalibrationType calibrationType, CalibrationStrategy calibrationStrategy, Real startValue, Real reversionValue, Real longTermValue, Real volatility, bool relaxedFeller, Real fellerFactor, Real tolerance, std::vector< std::string > optionExpiries=std::vector< std::string >(), std::vector< std::string > optionTerms=std::vector< std::string >(), std::vector< std::string > optionStrikes=std::vector< std::string >())
Detailed constructor.
Definition: crcirdata.hpp:48
std::vector< std::string > optionStrikes_
Definition: crcirdata.hpp:102
Small XML Document wrapper class.
Definition: xmlutils.hpp:65
Base class for all serializable classes.
Definition: xmlutils.hpp:101
Currency and instrument specific conventions/defaults.
Linear Gauss Markov model data.
@ data
Definition: log.hpp:77
Base Market class.
std::ostream & operator<<(std::ostream &out, EquityReturnType t)
CalibrationType
Supported calibration types.
Definition: irmodeldata.hpp:46
CrCirData::CalibrationStrategy parseCirCalibrationStrategy(const string &s)
Definition: crcirdata.cpp:42
Serializable Credit Default Swap.
Definition: namespaces.docs:23
XML utility functions.