Logo
Fully annotated reference manual - version 1.8.12
Loading...
Searching...
No Matches
dummymodel.hpp
Go to the documentation of this file.
1/*
2 Copyright (C) 2019 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/scripting/models/dummymodel.hpp
20 \brief dummy model implementation
21 \ingroup utilities
22*/
23
24#pragma once
25
27
28namespace ore {
29namespace data {
30
31class DummyModel : public Model {
32public:
33 DummyModel(const Size n) : Model(n) {
35 dummyResult_.set(0, 1.0); // make the result stochastic
36 }
37 Type type() const override { return Type::MC; }
38 RandomVariable pay(const RandomVariable& amount, const Date& obsdate, const Date& paydate,
39 const std::string& currency) const override {
40 return dummyResult_;
41 }
42 RandomVariable discount(const Date& obsdate, const Date& paydate, const std::string& currency) const override {
43 return dummyResult_;
44 }
45 RandomVariable npv(const RandomVariable& amount, const Date& obsdate, const Filter& filter,
46 const boost::optional<long>& memSlot, const RandomVariable& addRegressor1,
47 const RandomVariable& addRegressor2) const override {
48 return dummyResult_;
49 }
50 RandomVariable eval(const std::string& index, const Date& obsdate, const Date& fwdDate,
51 const bool returnMissingFixingAsNull, const bool ignoreTodaysFixing) const override {
52 return dummyResult_;
53 }
54 virtual RandomVariable fwdCompAvg(const bool isAvg, const std::string& index, const Date& obsdate,
55 const Date& start, const Date& end, const Real spread, const Real gearing,
56 const Integer lookback, const Natural rateCutoff, const Natural fixingDays,
57 const bool includeSpread, const Real cap, const Real floor,
58 const bool nakedOption, const bool localCapFloor) const override {
59 return dummyResult_;
60 }
61 RandomVariable barrierProbability(const std::string& index, const Date& obsdate1, const Date& obsdate2,
62 const RandomVariable& barrier, const bool above) const override {
63 return dummyResult_;
64 }
65 Real fxSpotT0(const std::string& forCcy, const std::string& domCcy) const override { return 1.0; }
66 Real extractT0Result(const RandomVariable& result) const override { return 0.0; }
67 const Date& referenceDate() const override {
68 static const Date d;
69 return d;
70 }
71 const std::string& baseCcy() const override {
72 static const std::string b = "EUR";
73 return b;
74 }
75
76private:
78};
79
80} // namespace data
81} // namespace ore
DummyModel(const Size n)
Definition: dummymodel.hpp:33
virtual RandomVariable fwdCompAvg(const bool isAvg, const std::string &index, const Date &obsdate, const Date &start, const Date &end, const Real spread, const Real gearing, const Integer lookback, const Natural rateCutoff, const Natural fixingDays, const bool includeSpread, const Real cap, const Real floor, const bool nakedOption, const bool localCapFloor) const override
Definition: dummymodel.hpp:54
RandomVariable npv(const RandomVariable &amount, const Date &obsdate, const Filter &filter, const boost::optional< long > &memSlot, const RandomVariable &addRegressor1, const RandomVariable &addRegressor2) const override
Definition: dummymodel.hpp:45
Real fxSpotT0(const std::string &forCcy, const std::string &domCcy) const override
Definition: dummymodel.hpp:65
RandomVariable barrierProbability(const std::string &index, const Date &obsdate1, const Date &obsdate2, const RandomVariable &barrier, const bool above) const override
Definition: dummymodel.hpp:61
const Date & referenceDate() const override
Definition: dummymodel.hpp:67
RandomVariable discount(const Date &obsdate, const Date &paydate, const std::string &currency) const override
Definition: dummymodel.hpp:42
RandomVariable eval(const std::string &index, const Date &obsdate, const Date &fwdDate, const bool returnMissingFixingAsNull, const bool ignoreTodaysFixing) const override
Definition: dummymodel.hpp:50
const std::string & baseCcy() const override
Definition: dummymodel.hpp:71
Real extractT0Result(const RandomVariable &result) const override
Definition: dummymodel.hpp:66
Type type() const override
Definition: dummymodel.hpp:37
RandomVariable pay(const RandomVariable &amount, const Date &obsdate, const Date &paydate, const std::string &currency) const override
Definition: dummymodel.hpp:38
RandomVariable dummyResult_
Definition: dummymodel.hpp:77
SafeStack< Filter > filter
@ data
Definition: log.hpp:77
interface for model against which a script can be run
Serializable Credit Default Swap.
Definition: namespaces.docs:23
void set(const Size i, const Real v)