Logo
Fully annotated reference manual - version 1.8.12
Loading...
Searching...
No Matches
Classes | Public Types | Public Member Functions | Protected Member Functions | Protected Attributes | Private Attributes | List of all members
Model Class Referenceabstract

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

+ Inheritance diagram for Model:
+ Collaboration diagram for Model:

Classes

struct  McParams
 

Public Types

enum class  Type { MC , FD }
 

Public Member Functions

 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
 

Protected Member Functions

void performCalculations () const override
 

Protected Attributes

std::map< std::string, boost::any > additionalResults_
 

Private Attributes

const Size n_
 

Detailed Description

Definition at line 45 of file model.hpp.

Member Enumeration Documentation

◆ Type

enum class Type
strong
Enumerator
MC 
FD 

Definition at line 47 of file model.hpp.

Constructor & Destructor Documentation

◆ Model()

Model ( const Size  n)
explicit

Definition at line 64 of file model.hpp.

64: n_(n) {}
const Size n_
Definition: model.hpp:157

◆ ~Model()

virtual ~Model ( )
virtual

Definition at line 65 of file model.hpp.

65{}

Member Function Documentation

◆ type()

virtual Type type ( ) const
pure virtual

◆ size()

virtual Size size ( ) const
virtual

Reimplemented in BlackScholesBase, and GaussianCam.

Definition at line 71 of file model.hpp.

71{ return n_; }
+ Here is the caller graph for this function:

◆ trainingSamples()

virtual Size trainingSamples ( ) const
virtual

Reimplemented in BlackScholesBase, and GaussianCam.

Definition at line 74 of file model.hpp.

74{ return Null<Size>(); }

◆ toggleTrainingPaths()

virtual void toggleTrainingPaths ( ) const
virtual

Reimplemented in BlackScholesBase, and GaussianCam.

Definition at line 78 of file model.hpp.

78{}

◆ referenceDate()

virtual const Date & referenceDate ( ) const
pure virtual

Implemented in BlackScholesBase, DummyModel, FdBlackScholesBase, FdGaussianCam, and GaussianCam.

+ Here is the caller graph for this function:

◆ baseCcy()

virtual const std::string & baseCcy ( ) const
pure virtual

Implemented in DummyModel, FdBlackScholesBase, and ModelImpl.

◆ dt()

virtual Real dt ( const Date &  d1,
const Date &  d2 
) const
virtual

Reimplemented in ModelImpl.

Definition at line 87 of file model.hpp.

87 {
88 return ActualActual(ActualActual::ISDA).yearFraction(d1, d2);
89 }
+ Here is the caller graph for this function:

◆ timeFromReference()

Real timeFromReference ( const Date &  d) const

Definition at line 92 of file model.hpp.

92{ return dt(referenceDate(), d); }
virtual Real dt(const Date &d1, const Date &d2) const
Definition: model.hpp:87
virtual const Date & referenceDate() const =0
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ pay()

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

◆ discount()

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

Implemented in DummyModel, and ModelImpl.

◆ npv()

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

◆ eval()

virtual RandomVariable eval ( const std::string &  index,
const Date &  obsdate,
const Date &  fwddate,
const bool  returnMissingFixingAsNull = false,
const bool  ignoreTodaysFixing = false 
) const
pure virtual

Implemented in DummyModel, and ModelImpl.

◆ 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
pure virtual

◆ barrierProbability()

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

Implemented in DummyModel, and ModelImpl.

◆ fxSpotT0()

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

Implemented in DummyModel, and ModelImpl.

◆ extractT0Result()

virtual Real extractT0Result ( const RandomVariable value) const
pure virtual

◆ releaseMemory()

virtual void releaseMemory ( )
virtual

Reimplemented in BlackScholesBase, FdBlackScholesBase, FdGaussianCam, and GaussianCam.

Definition at line 140 of file model.hpp.

140{}

◆ resetNPVMem()

virtual void resetNPVMem ( )
virtual

Reimplemented in BlackScholesBase, and GaussianCam.

Definition at line 143 of file model.hpp.

143{}

◆ additionalResults()

const std::map< std::string, boost::any > & additionalResults ( ) const

Definition at line 146 of file model.hpp.

146{ return additionalResults_; }
std::map< std::string, boost::any > additionalResults_
Definition: model.hpp:153

◆ performCalculations()

void performCalculations ( ) const
overrideprotected

Definition at line 150 of file model.hpp.

150{}

Member Data Documentation

◆ additionalResults_

std::map<std::string, boost::any> additionalResults_
mutableprotected

Definition at line 153 of file model.hpp.

◆ n_

const Size n_
private

Definition at line 157 of file model.hpp.