Logo
Fully annotated reference manual - version 1.8.12
Loading...
Searching...
No Matches
parametricsmileconfiguration.hpp
Go to the documentation of this file.
1/*
2 Copyright (C) 2024 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/configuration/parametricsmileconfiguration.hpp
20 \brief Class for holding parametric smile configurations
21 \ingroup configuration
22*/
23
24#pragma once
25
27#include <ql/utilities/null.hpp>
28
29namespace ore {
30namespace data {
31
32/*! Serializable parametric smile configuration
33 \ingroup configuration
34*/
36public:
37 class Parameter : public XMLSerializable {
38 public:
39 void fromXML(ore::data::XMLNode* node) override;
41
42 std::string name;
43 std::vector<double> initialValue = {0.0};
44 bool isFixed = false;
45 };
46
48 public:
49 void fromXML(ore::data::XMLNode* node) override;
51
52 std::size_t maxCalibrationAttempts = 10;
53 double exitEarlyErrorThreshold = 0.0050;
54 double maxAcceptableError = 0.05;
55 };
56
58 ParametricSmileConfiguration(std::vector<Parameter> parameters, Calibration calibration);
59
60 //! \name XMLSerializable interface
61 //@{
62 void fromXML(ore::data::XMLNode* node) override;
64 //@}
65
66 //! \name Inspectors
67 //@{
68 const Parameter& parameter(const std::string& name) const;
69 const Calibration& calibration() const;
70 //@}
71
72private:
73 std::vector<Parameter> parameters_;
75};
76
77} // namespace data
78} // namespace ore
ore::data::XMLNode * toXML(ore::data::XMLDocument &doc) const override
ore::data::XMLNode * toXML(ore::data::XMLDocument &doc) const override
void fromXML(ore::data::XMLNode *node) override
const Parameter & parameter(const std::string &name) const
ore::data::XMLNode * toXML(ore::data::XMLDocument &doc) const override
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
string name
XML utility functions.