Logo
Fully annotated reference manual - version 1.8.12
Loading...
Searching...
No Matches
Public Member Functions | Private Attributes | List of all members
DummyModel Class Reference

#include <ored/scripting/models/dummymodel.hpp>

+ Inheritance diagram for DummyModel:
+ Collaboration diagram for DummyModel:

Public Member Functions

 DummyModel (const Size n)
 
Type type () const override
 
RandomVariable pay (const RandomVariable &amount, const Date &obsdate, const Date &paydate, const std::string &currency) const override
 
RandomVariable discount (const Date &obsdate, const Date &paydate, const std::string &currency) const override
 
RandomVariable npv (const RandomVariable &amount, const Date &obsdate, const Filter &filter, const boost::optional< long > &memSlot, const RandomVariable &addRegressor1, const RandomVariable &addRegressor2) const override
 
RandomVariable eval (const std::string &index, const Date &obsdate, const Date &fwdDate, const bool returnMissingFixingAsNull, const bool ignoreTodaysFixing) const override
 
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
 
RandomVariable barrierProbability (const std::string &index, const Date &obsdate1, const Date &obsdate2, const RandomVariable &barrier, const bool above) const override
 
Real fxSpotT0 (const std::string &forCcy, const std::string &domCcy) const override
 
Real extractT0Result (const RandomVariable &result) const override
 
const Date & referenceDate () const override
 
const std::string & baseCcy () const override
 
- Public Member Functions inherited from Model
 Model (const Size n)
 
virtual ~Model ()
 
virtual Type type () const =0
 
virtual Size size () const
 
virtual Size trainingSamples () const
 
virtual void toggleTrainingPaths () const
 
virtual const Date & referenceDate () const =0
 
virtual const std::string & baseCcy () const =0
 
virtual Real dt (const Date &d1, const Date &d2) const
 
Real timeFromReference (const Date &d) const
 
virtual RandomVariable pay (const RandomVariable &amount, const Date &obsdate, const Date &paydate, const std::string &currency) const =0
 
virtual RandomVariable discount (const Date &obsdate, const Date &paydate, const std::string &currency) const =0
 
virtual RandomVariable npv (const RandomVariable &amount, const Date &obsdate, const Filter &filter, const boost::optional< long > &memSlot, const RandomVariable &addRegressor1, const RandomVariable &addRegressor2) const =0
 
virtual RandomVariable eval (const std::string &index, const Date &obsdate, const Date &fwddate, const bool returnMissingFixingAsNull=false, const bool ignoreTodaysFixing=false) const =0
 
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 =0
 
virtual RandomVariable barrierProbability (const std::string &index, const Date &obsdate1, const Date &obsdate2, const RandomVariable &barrier, const bool above) const =0
 
virtual Real fxSpotT0 (const std::string &forCcy, const std::string &domCcy) const =0
 
virtual Real extractT0Result (const RandomVariable &value) const =0
 
virtual void releaseMemory ()
 
virtual void resetNPVMem ()
 
const std::map< std::string, boost::any > & additionalResults () const
 

Private Attributes

RandomVariable dummyResult_
 

Additional Inherited Members

- Public Types inherited from Model
enum class  Type { MC , FD }
 
- Protected Member Functions inherited from Model
void performCalculations () const override
 
- Protected Attributes inherited from Model
std::map< std::string, boost::any > additionalResults_
 

Detailed Description

Definition at line 31 of file dummymodel.hpp.

Constructor & Destructor Documentation

◆ DummyModel()

DummyModel ( const Size  n)

Definition at line 33 of file dummymodel.hpp.

33 : Model(n) {
34 dummyResult_ = RandomVariable(n, 0.0);
35 dummyResult_.set(0, 1.0); // make the result stochastic
36 }
RandomVariable dummyResult_
Definition: dummymodel.hpp:77
Model(const Size n)
Definition: model.hpp:64
void set(const Size i, const Real v)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Member Function Documentation

◆ type()

Type type ( ) const
overridevirtual

Implements Model.

Definition at line 37 of file dummymodel.hpp.

◆ pay()

RandomVariable pay ( const RandomVariable amount,
const Date &  obsdate,
const Date &  paydate,
const std::string &  currency 
) const
overridevirtual

Implements Model.

Definition at line 38 of file dummymodel.hpp.

39 {
40 return dummyResult_;
41 }

◆ discount()

RandomVariable discount ( const Date &  obsdate,
const Date &  paydate,
const std::string &  currency 
) const
overridevirtual

Implements Model.

Definition at line 42 of file dummymodel.hpp.

42 {
43 return dummyResult_;
44 }

◆ npv()

RandomVariable npv ( const RandomVariable amount,
const Date &  obsdate,
const Filter filter,
const boost::optional< long > &  memSlot,
const RandomVariable addRegressor1,
const RandomVariable addRegressor2 
) const
overridevirtual

Implements Model.

Definition at line 45 of file dummymodel.hpp.

47 {
48 return dummyResult_;
49 }

◆ eval()

RandomVariable eval ( const std::string &  index,
const Date &  obsdate,
const Date &  fwdDate,
const bool  returnMissingFixingAsNull,
const bool  ignoreTodaysFixing 
) const
overridevirtual

Implements Model.

Definition at line 50 of file dummymodel.hpp.

51 {
52 return dummyResult_;
53 }

◆ fwdCompAvg()

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
overridevirtual

Implements Model.

Definition at line 54 of file dummymodel.hpp.

58 {
59 return dummyResult_;
60 }

◆ barrierProbability()

RandomVariable barrierProbability ( const std::string &  index,
const Date &  obsdate1,
const Date &  obsdate2,
const RandomVariable barrier,
const bool  above 
) const
overridevirtual

Implements Model.

Definition at line 61 of file dummymodel.hpp.

62 {
63 return dummyResult_;
64 }

◆ fxSpotT0()

Real fxSpotT0 ( const std::string &  forCcy,
const std::string &  domCcy 
) const
overridevirtual

Implements Model.

Definition at line 65 of file dummymodel.hpp.

65{ return 1.0; }

◆ extractT0Result()

Real extractT0Result ( const RandomVariable result) const
overridevirtual

Implements Model.

Definition at line 66 of file dummymodel.hpp.

66{ return 0.0; }

◆ referenceDate()

const Date & referenceDate ( ) const
overridevirtual

Implements Model.

Definition at line 67 of file dummymodel.hpp.

67 {
68 static const Date d;
69 return d;
70 }
+ Here is the caller graph for this function:

◆ baseCcy()

const std::string & baseCcy ( ) const
overridevirtual

Implements Model.

Definition at line 71 of file dummymodel.hpp.

71 {
72 static const std::string b = "EUR";
73 return b;
74 }

Member Data Documentation

◆ dummyResult_

RandomVariable dummyResult_
private

Definition at line 77 of file dummymodel.hpp.