Logo
Fully annotated reference manual - version 1.8.12
Loading...
Searching...
No Matches
Public Member Functions | Protected Member Functions | Private Attributes | List of all members
CirppConstantParametrization< TS > Class Template Reference

CIR++ Constant Parametrization. More...

#include <qle/models/cirppconstantparametrization.hpp>

+ Inheritance diagram for CirppConstantParametrization< TS >:
+ Collaboration diagram for CirppConstantParametrization< TS >:

Public Member Functions

 CirppConstantParametrization (const Currency &currency, const Handle< TS > &termStructure, const Real kappa, const Real theta, const Real sigma, const Real y0, const bool shifted, const std::string &name=std::string())
 
Real kappa (const Time t) const
 
Real theta (const Time t) const
 
Real sigma (const Time t) const
 
Real y0 (const Time t) const
 
const QuantLib::ext::shared_ptr< Parameter > parameter (const Size) const
 
- Public Member Functions inherited from CirppParametrization< TS >
 CirppParametrization (const Currency &currency, const Handle< TS > &termStructure, bool shifted, const std::string &name=std::string())
 
virtual Real kappa (const Time t) const =0
 
virtual Real theta (const Time t) const =0
 
virtual Real sigma (const Time t) const =0
 
virtual Real y0 (const Time t) const =0
 
const Handle< TS > termStructure () const
 
const bool shifted () const
 
Size numberOfParameters () const override
 
- Public Member Functions inherited from Parametrization
 Parametrization (const Currency &currency, const std::string &name="")
 
virtual ~Parametrization ()
 
virtual const Currency & currency () const
 
virtual const Array & parameterTimes (const Size) const
 
virtual Size numberOfParameters () const
 
virtual Array parameterValues (const Size) const
 
virtual const QuantLib::ext::shared_ptr< Parameter > parameter (const Size) const
 
virtual void update () const
 
const std::string & name () const
 
virtual Real direct (const Size, const Real x) const
 
virtual Real inverse (const Size, const Real y) const
 

Protected Member Functions

Real direct (const Size i, const Real x) const
 
Real inverse (const Size j, const Real y) const
 
- Protected Member Functions inherited from Parametrization
Time tr (const Time t) const
 
Time tl (const Time t) const
 
Time tr2 (const Time t) const
 
Time tm2 (const Time t) const
 
Time tl2 (const Time t) const
 

Private Attributes

const QuantLib::ext::shared_ptr< PseudoParameterkappa_
 
const QuantLib::ext::shared_ptr< PseudoParametertheta_
 
const QuantLib::ext::shared_ptr< PseudoParametersigma_
 
const QuantLib::ext::shared_ptr< PseudoParametery0_
 

Additional Inherited Members

- Protected Attributes inherited from Parametrization
const Real h_
 
const Real h2_
 

Detailed Description

template<class TS>
class QuantExt::CirppConstantParametrization< TS >

CIR++ Constant Parametrization.

Definition at line 36 of file cirppconstantparametrization.hpp.

Constructor & Destructor Documentation

◆ CirppConstantParametrization()

CirppConstantParametrization ( const Currency &  currency,
const Handle< TS > &  termStructure,
const Real  kappa,
const Real  theta,
const Real  sigma,
const Real  y0,
const bool  shifted,
const std::string &  name = std::string() 
)

Definition at line 60 of file cirppconstantparametrization.hpp.

66 : CirppParametrization<TS>(currency, termStructure, shifted, name),
67 kappa_(QuantLib::ext::make_shared<PseudoParameter>(1)),
68 theta_(QuantLib::ext::make_shared<PseudoParameter>(1)), sigma_(QuantLib::ext::make_shared<PseudoParameter>(1)),
69 y0_(QuantLib::ext::make_shared<PseudoParameter>(1)) {
70 kappa_->setParam(0, inverse(0, kappa));
71 theta_->setParam(0, inverse(1, theta));
72 sigma_->setParam(0, inverse(2, sigma));
73 y0_->setParam(0, inverse(3, y0));
74}
const QuantLib::ext::shared_ptr< PseudoParameter > theta_
const QuantLib::ext::shared_ptr< PseudoParameter > sigma_
const QuantLib::ext::shared_ptr< PseudoParameter > y0_
Real inverse(const Size j, const Real y) const
const QuantLib::ext::shared_ptr< PseudoParameter > kappa_
const Handle< TS > termStructure() const
const std::string & name() const
virtual const Currency & currency() const
+ Here is the call graph for this function:

Member Function Documentation

◆ kappa()

Real kappa ( const Time  t) const
virtual

Implements CirppParametrization< TS >.

Definition at line 86 of file cirppconstantparametrization.hpp.

86 {
87 return direct(0, kappa_->params()[0]);
88}
Real direct(const Size i, const Real x) const
+ Here is the caller graph for this function:

◆ theta()

Real theta ( const Time  t) const
virtual

Implements CirppParametrization< TS >.

Definition at line 90 of file cirppconstantparametrization.hpp.

90 {
91 return direct(1, theta_->params()[0]);
92}
+ Here is the caller graph for this function:

◆ sigma()

Real sigma ( const Time  t) const
virtual

Implements CirppParametrization< TS >.

Definition at line 94 of file cirppconstantparametrization.hpp.

94 {
95 return direct(2, sigma_->params()[0]);
96}
+ Here is the caller graph for this function:

◆ y0()

Real y0 ( const Time  t) const
virtual

Implements CirppParametrization< TS >.

Definition at line 98 of file cirppconstantparametrization.hpp.

98 {
99 return direct(3, y0_->params()[0]);
100}
+ Here is the caller graph for this function:

◆ parameter()

const QuantLib::ext::shared_ptr< Parameter > parameter ( const Size  Size) const
virtual

the parameter storing the raw parameter values

Reimplemented from Parametrization.

Definition at line 103 of file cirppconstantparametrization.hpp.

103 {
104 QL_REQUIRE(i < 4, "parameter " << i << " does not exist, only have 0..3");
105 if (i == 0)
106 return kappa_;
107 else if (i == 1)
108 return theta_;
109 else if (i == 2)
110 return sigma_;
111 else
112 return y0_;
113}

◆ direct()

Real direct ( const Size  Size,
const Real  x 
) const
protectedvirtual

transformations between raw and actual parameters

Reimplemented from Parametrization.

Definition at line 76 of file cirppconstantparametrization.hpp.

76 {
77 constexpr Real eps = 1E-10;
78 return x * x + eps;
79}

◆ inverse()

Real inverse ( const Size  j,
const Real  y 
) const
protectedvirtual

Reimplemented from Parametrization.

Definition at line 81 of file cirppconstantparametrization.hpp.

81 {
82 constexpr Real eps = 1E-10;
83 return std::sqrt(y - eps);
84}
+ Here is the caller graph for this function:

Member Data Documentation

◆ kappa_

const QuantLib::ext::shared_ptr<PseudoParameter> kappa_
private

Definition at line 54 of file cirppconstantparametrization.hpp.

◆ theta_

const QuantLib::ext::shared_ptr<PseudoParameter> theta_
private

Definition at line 54 of file cirppconstantparametrization.hpp.

◆ sigma_

const QuantLib::ext::shared_ptr<PseudoParameter> sigma_
private

Definition at line 54 of file cirppconstantparametrization.hpp.

◆ y0_

const QuantLib::ext::shared_ptr<PseudoParameter> y0_
private

Definition at line 54 of file cirppconstantparametrization.hpp.