Logo
Fully annotated reference manual - version 1.8.12
Loading...
Searching...
No Matches
scenariogeneratordata.hpp
Go to the documentation of this file.
1/*
2 Copyright (C) 2016 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 scenario/scenariogeneratordata.hpp
20 \brief Scenario generator configuration
21 \ingroup scenario
22*/
23
24#pragma once
25
26#include <vector>
27
28#include <ql/types.hpp>
29
31
35
36namespace ore {
37namespace analytics {
38using namespace QuantLib;
39using namespace QuantExt;
40
41//! Scenario Generator description
42/*! ScenarioGeneratorData wraps the specification of how to build a scenario generator
43 from a given cross asset model and covers the choice and configuration of
44 - state process
45 - simulation date grid
46 - multipath generator
47 - scenario factory
48 - fixing method
49
50 \ingroup scenario
51 */
53public:
55 : grid_(QuantLib::ext::make_shared<DateGrid>()), sequenceType_(SobolBrownianBridge), seed_(0), samples_(0),
56 ordering_(SobolBrownianGenerator::Steps), directionIntegers_(SobolRsg::JoeKuoD7), withCloseOutLag_(false),
57 withMporStickyDate_(false) {}
58
59 //! Constructor
60 ScenarioGeneratorData(QuantLib::ext::shared_ptr<DateGrid> dateGrid, SequenceType sequenceType, long seed, Size samples,
61 SobolBrownianGenerator::Ordering ordering = SobolBrownianGenerator::Steps,
62 SobolRsg::DirectionIntegers directionIntegers = SobolRsg::JoeKuoD7,
63 bool withCloseOutLag = false, bool withMporStickyDate = false)
66 setGrid(dateGrid);
67 }
68
69 void clear();
70
71 //! Load members from XML
72 virtual void fromXML(XMLNode* node) override;
73
74 //! Write members to XML
75 virtual XMLNode* toXML(XMLDocument& doc) const override;
76
77 //! \name Inspectors
78 //@{
79 QuantLib::ext::shared_ptr<DateGrid> getGrid() const { return grid_; }
81 long seed() const { return seed_; }
82 Size samples() const { return samples_; }
83 SobolBrownianGenerator::Ordering ordering() const { return ordering_; }
84 SobolRsg::DirectionIntegers directionIntegers() const { return directionIntegers_; }
85 QuantLib::ext::shared_ptr<DateGrid> closeOutDateGrid() const { return closeOutDateGrid_; }
86 bool withCloseOutLag() const { return withCloseOutLag_; }
87 bool withMporStickyDate() const { return withMporStickyDate_; }
88 Period closeOutLag() const { return closeOutLag_; }
89 //@}
90
91 //! \name Setters
92 //@{
93 void setGrid(QuantLib::ext::shared_ptr<DateGrid> grid);
95 long& seed() { return seed_; }
96 Size& samples() { return samples_; }
97 SobolBrownianGenerator::Ordering& ordering() { return ordering_; }
98 SobolRsg::DirectionIntegers& directionIntegers() { return directionIntegers_; }
101 Period& closeOutLag() { return closeOutLag_; }
102 //@}
103private:
104 QuantLib::ext::shared_ptr<DateGrid> grid_;
106 long seed_;
108 SobolBrownianGenerator::Ordering ordering_;
109 SobolRsg::DirectionIntegers directionIntegers_;
110 QuantLib::ext::shared_ptr<DateGrid> closeOutDateGrid_;
116};
117
118} // namespace analytics
119} // namespace ore
SobolBrownianGenerator::Ordering & ordering()
QuantLib::ext::shared_ptr< DateGrid > closeOutDateGrid_
QuantLib::ext::shared_ptr< DateGrid > getGrid() const
SobolBrownianGenerator::Ordering ordering_
SobolRsg::DirectionIntegers & directionIntegers()
SobolRsg::DirectionIntegers directionIntegers_
QuantLib::ext::shared_ptr< DateGrid > closeOutDateGrid() const
ScenarioGeneratorData(QuantLib::ext::shared_ptr< DateGrid > dateGrid, SequenceType sequenceType, long seed, Size samples, SobolBrownianGenerator::Ordering ordering=SobolBrownianGenerator::Steps, SobolRsg::DirectionIntegers directionIntegers=SobolRsg::JoeKuoD7, bool withCloseOutLag=false, bool withMporStickyDate=false)
Constructor.
QuantLib::ext::shared_ptr< DateGrid > grid_
virtual void fromXML(XMLNode *node) override
Load members from XML.
virtual XMLNode * toXML(XMLDocument &doc) const override
Write members to XML.
SobolRsg::DirectionIntegers directionIntegers() const
SobolBrownianGenerator::Ordering ordering() const
void setGrid(QuantLib::ext::shared_ptr< DateGrid > grid)
Scenario generation using cross asset model paths.
A class to hold Scenario parameters for scenarioSimMarket.