Logo
Fully annotated reference manual - version 1.8.12
Loading...
Searching...
No Matches
irhwmodeldata.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/irhwmodeldata.hpp
20 \brief Hull White 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
32
36
37namespace ore {
38namespace data {
39using namespace QuantLib;
40
41//! Hull White Model Parameters
42/*!
43 This class contains the description of a Hull White interest rate model
44 and instructions for how to calibrate it.
45
46 \ingroup models
47 */
48class HwModelData : public IrModelData {
49public:
50 //! Default constructor
54
55 //! Detailed constructor
57 std::vector<Time> kappaTimes, std::vector<QuantLib::Array> kappaValues, bool calibrateSigma,
58 ParamType sigmaType, std::vector<Time> sigmaTimes, std::vector<QuantLib::Matrix> sigmaValues,
59 std::vector<std::string> optionExpiries = std::vector<std::string>(),
60 std::vector<std::string> optionTerms = std::vector<std::string>(),
61 std::vector<std::string> optionStrikes = std::vector<std::string>())
66
67 //! Clear list of calibration instruments
68 void clear() override;
69
70 //! Reset member variables to defaults
71 void reset() override;
72
73 //! \name Serialisation
74 //@{
75 virtual void fromXML(XMLNode* node) override;
76 virtual XMLNode* toXML(XMLDocument& doc) const override;
77 //@}
78
79 //! \name Setters/Getters
80 //@{
81 bool& calibrateKappa() { return calibrateKappa_; }
83 std::vector<Time>& kappaTimes() { return kappaTimes_; }
84 std::vector<Array>& kappaValues() { return kappaValues_; }
85 bool& calibrateSigma() { return calibrateSigma_; }
87 std::vector<Time>& sigmaTimes() { return sigmaTimes_; }
88 std::vector<QuantLib::Matrix>& sigmaValues() { return sigmaValues_; }
89 std::vector<std::string>& optionExpiries() { return optionExpiries_; }
90 std::vector<std::string>& optionTerms() { return optionTerms_; }
91 std::vector<std::string>& optionStrikes() { return optionStrikes_; }
92 //@}
93
94 //! \name Operators
95 //@{
96 bool operator==(const HwModelData& rhs);
97 bool operator!=(const HwModelData& rhs);
98 //@}
99
100private:
103 std::vector<Time> kappaTimes_;
104 std::vector<QuantLib::Array> kappaValues_;
105
108 std::vector<Time> sigmaTimes_;
109 std::vector<QuantLib::Matrix> sigmaValues_;
110 std::vector<std::string> optionExpiries_;
111 std::vector<std::string> optionTerms_;
112 std::vector<std::string> optionStrikes_;
113};
114
115
116} // namespace data
117} // namespace ore
Hull White Model Parameters.
std::vector< QuantLib::Matrix > & sigmaValues()
std::vector< QuantLib::Array > kappaValues_
HwModelData(std::string qualifier, CalibrationType calibrationType, bool calibrateKappa, ParamType kappaType, std::vector< Time > kappaTimes, std::vector< QuantLib::Array > kappaValues, bool calibrateSigma, ParamType sigmaType, std::vector< Time > sigmaTimes, std::vector< QuantLib::Matrix > sigmaValues, 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.
std::vector< std::string > & optionStrikes()
std::vector< Array > & kappaValues()
std::vector< std::string > optionTerms_
bool operator==(const HwModelData &rhs)
std::vector< std::string > optionExpiries_
std::vector< QuantLib::Matrix > sigmaValues_
HwModelData()
Default constructor.
virtual void fromXML(XMLNode *node) override
virtual XMLNode * toXML(XMLDocument &doc) const override
std::vector< Time > kappaTimes_
std::vector< std::string > & optionTerms()
std::vector< Time > sigmaTimes_
std::vector< std::string > & optionExpiries()
std::vector< Time > & sigmaTimes()
bool operator!=(const HwModelData &rhs)
void reset() override
Reset member variables to defaults.
void clear() override
Clear list of calibration instruments.
std::vector< std::string > optionStrikes_
std::vector< Time > & kappaTimes()
Linear Gauss Markov Model Parameters.
Definition: irmodeldata.hpp:88
CalibrationType & calibrationType()
std::string & qualifier()
Small XML Document wrapper class.
Definition: xmlutils.hpp:65
Currency and instrument specific conventions/defaults.
Generic interest rate model data.
@ data
Definition: log.hpp:77
Base Market class.
CalibrationType
Supported calibration types.
Definition: irmodeldata.hpp:46
ParamType
Supported calibration parameter type.
Definition: irmodeldata.hpp:35
Serializable Credit Default Swap.
Definition: namespaces.docs:23
XML utility functions.