Logo
Fully annotated reference manual - version 1.8.12
Loading...
Searching...
No Matches
calibrationbasket.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/calibrationbasket.hpp
20 \brief class for holding details of the calibration instruments for a model
21 \ingroup models
22*/
23
24#pragma once
25
26#include <ql/types.hpp>
28#include <vector>
29
30namespace ore {
31namespace data {
32
33/*! Abstract base class for holding details of a model calibration instrument.
34 \ingroup models
35*/
37public:
38 //! Constructor
39 CalibrationInstrument(const std::string& instrumentType);
40
41 //! Destructor
43
44 //! \name Inspectors
45 //@{
46 const std::string& instrumentType() const;
47 //@}
48
49protected:
50 std::string instrumentType_;
51};
52
53/*! Class for holding calibration instruments of the same type for a model.
54
55 If you need to calibrate a model to instruments of different types, use multiple calibration baskets.
56
57 \ingroup models
58*/
60public:
61 //! Default constructor, empty calibration basket.
63
64 //! Detailed constructor
65 CalibrationBasket(const std::vector<QuantLib::ext::shared_ptr<CalibrationInstrument>>& instruments);
66
67 //! \name Inspectors
68 //@{
69 const std::string& instrumentType() const;
70 const std::vector<QuantLib::ext::shared_ptr<CalibrationInstrument>>& instruments() const;
71 const std::string& parameter() const;
72 //@}
73
74 //! \name Serialisation
75 //@{
76 void fromXML(XMLNode* node) override;
77 XMLNode* toXML(XMLDocument& doc) const override;
78 //@}
79
80 //! Returns \c true if the calibration basket is empty.
81 bool empty() const;
82
83private:
84 std::vector<QuantLib::ext::shared_ptr<CalibrationInstrument>> instruments_;
85 std::string instrumentType_;
86 //! The parameter tag may be given so that builders know how to use the calibration basket.
87 std::string parameter_;
88
89};
90
91
92}
93}
CalibrationBasket()
Default constructor, empty calibration basket.
std::string parameter_
The parameter tag may be given so that builders know how to use the calibration basket.
std::vector< QuantLib::ext::shared_ptr< CalibrationInstrument > > instruments_
const std::string & parameter() const
bool empty() const
Returns true if the calibration basket is empty.
void fromXML(XMLNode *node) override
XMLNode * toXML(XMLDocument &doc) const override
const std::string & instrumentType() const
const std::vector< QuantLib::ext::shared_ptr< CalibrationInstrument > > & instruments() const
const std::string & instrumentType() const
virtual ~CalibrationInstrument()
Destructor.
Small XML Document wrapper class.
Definition: xmlutils.hpp:65
Base class for all serializable classes.
Definition: xmlutils.hpp:101
@ data
Definition: log.hpp:77
Serializable Credit Default Swap.
Definition: namespaces.docs:23
XML utility functions.