Logo
Fully annotated reference manual - version 1.8.12
Loading...
Searching...
No Matches
lgmscenariogenerator.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/lgmscenariogenerator.hpp
20 \brief Scenario generation using LGM paths
21 \ingroup scenario
22*/
23
24#pragma once
25
31#include <qle/models/lgm.hpp>
32
33namespace ore {
34namespace analytics {
35using namespace QuantLib;
36
37//! Scenario Generator using LGM model paths
38/*!
39 The generator expects
40 - a calibrated model,
41 - an associated multi path generator (i.e. providing paths for all factors
42 of the model ordered as described in the model),
43 - a scenario factory that provides building scenario class instances,
44 - the configuration of market curves to be simulated
45 - a simulation date grid that starts in the future, i.e. does not include today's date
46 - the associated time grid including t=0
47
48 \ingroup scenario
49 */
51public:
52 //! Constructor
53 LgmScenarioGenerator(QuantLib::ext::shared_ptr<QuantExt::LGM> model,
54 QuantLib::ext::shared_ptr<QuantExt::MultiPathGeneratorBase> multiPathGenerator,
55 QuantLib::ext::shared_ptr<ScenarioFactory> scenarioFactory,
56 QuantLib::ext::shared_ptr<ScenarioSimMarketParameters> simMarketConfig, Date today, DateGrid grid);
57 //! Destructor
59 std::vector<QuantLib::ext::shared_ptr<Scenario>> nextPath() override;
60 void reset() override { pathGenerator_->reset(); }
61
62private:
63 QuantLib::ext::shared_ptr<QuantExt::LGM> model_;
64 QuantLib::ext::shared_ptr<QuantExt::MultiPathGeneratorBase> pathGenerator_;
65 QuantLib::ext::shared_ptr<ScenarioFactory> scenarioFactory_;
66 QuantLib::ext::shared_ptr<ScenarioSimMarketParameters> simMarketConfig_;
67};
68} // namespace analytics
69} // namespace ore
Scenario Generator using LGM model paths.
std::vector< QuantLib::ext::shared_ptr< Scenario > > nextPath() override
QuantLib::ext::shared_ptr< ScenarioSimMarketParameters > simMarketConfig_
QuantLib::ext::shared_ptr< QuantExt::MultiPathGeneratorBase > pathGenerator_
QuantLib::ext::shared_ptr< ScenarioFactory > scenarioFactory_
QuantLib::ext::shared_ptr< QuantExt::LGM > model_
void reset() override
Reset the generator so calls to next() return the first scenario.
Scenario generator that generates an entire path.
factory classes for scenarios
Scenario generator base classes.
A Market class that can be updated by Scenarios.