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
Lgm1fConstantParametrization< TS > Class Template Reference

LGM 1F Constant Parametrization. More...

#include <qle/models/irlgm1fconstantparametrization.hpp>

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

Public Member Functions

 Lgm1fConstantParametrization (const Currency &currency, const Handle< TS > &termStructure, const Real alpha, const Real kappa, const std::string &name=std::string())
 
Real zeta (const Time t) const override
 
Real H (const Time t) const override
 
Real alpha (const Time t) const override
 
Real kappa (const Time t) const override
 
Real Hprime (const Time t) const override
 
Real Hprime2 (const Time t) const override
 
const QuantLib::ext::shared_ptr< Parameter > parameter (const Size) const override
 
- Public Member Functions inherited from Lgm1fParametrization< TS >
 Lgm1fParametrization (const Currency &currency, const Handle< TS > &termStructure, const std::string &name=std::string())
 
virtual Real zeta (const Time t) const =0
 
virtual Real H (const Time t) const =0
 
virtual Real alpha (const Time t) const
 
virtual Real kappa (const Time t) const
 
virtual Real Hprime (const Time t) const
 
virtual Real Hprime2 (const Time t) const
 
virtual Real hullWhiteSigma (const Time t) const
 
const Handle< TS > termStructure () const
 
Real zetan (const Size n, const Time t, const QuantLib::ext::shared_ptr< Integrator > &integrator)
 
Real & shift ()
 
Real & scaling ()
 
Size numberOfParameters () const override
 
void update () 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 override
 
Real inverse (const Size j, const Real y) const override
 
- 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< PseudoParameteralpha_
 
const QuantLib::ext::shared_ptr< PseudoParameterkappa_
 
const Real zeroKappaCutoff_
 

Additional Inherited Members

- Protected Attributes inherited from Lgm1fParametrization< TS >
Real shift_
 
Real scaling_
 
- Protected Attributes inherited from Parametrization
const Real h_
 
const Real h2_
 

Detailed Description

template<class TS>
class QuantExt::Lgm1fConstantParametrization< TS >

LGM 1F Constant Parametrization.

Definition at line 34 of file irlgm1fconstantparametrization.hpp.

Constructor & Destructor Documentation

◆ Lgm1fConstantParametrization()

Lgm1fConstantParametrization ( const Currency &  currency,
const Handle< TS > &  termStructure,
const Real  alpha,
const Real  kappa,
const std::string &  name = std::string() 
)

Definition at line 58 of file irlgm1fconstantparametrization.hpp.

61 : Lgm1fParametrization<TS>(currency, termStructure, name), alpha_(QuantLib::ext::make_shared<PseudoParameter>(1)),
62 kappa_(QuantLib::ext::make_shared<PseudoParameter>(1)), zeroKappaCutoff_(1.0E-6) {
63 alpha_->setParam(0, inverse(0, alpha));
64 kappa_->setParam(0, inverse(1, kappa));
65}
const QuantLib::ext::shared_ptr< PseudoParameter > alpha_
Real inverse(const Size j, const Real y) const override
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

◆ zeta()

Real zeta ( const Time  t) const
overridevirtual

zeta must satisfy zeta(0) = 0, zeta'(t) >= 0

Implements Lgm1fParametrization< TS >.

Definition at line 77 of file irlgm1fconstantparametrization.hpp.

77 {
78 return direct(0, alpha_->params()[0]) * direct(0, alpha_->params()[0]) * t / (this->scaling_ * this->scaling_);
79}
Real direct(const Size i, const Real x) const override
+ Here is the caller graph for this function:

◆ H()

Real H ( const Time  t) const
overridevirtual

H must be such that H' does not change its sign

Implements Lgm1fParametrization< TS >.

Definition at line 81 of file irlgm1fconstantparametrization.hpp.

81 {
82 if (std::fabs(kappa_->params()[0]) < zeroKappaCutoff_) {
83 return this->scaling_ * t + this->shift_;
84 } else {
85 return this->scaling_ * (1.0 - std::exp(-kappa_->params()[0] * t)) / kappa_->params()[0] + this->shift_;
86 }
87}
+ Here is the caller graph for this function:

◆ alpha()

Real alpha ( const Time  t) const
overridevirtual

Reimplemented from Lgm1fParametrization< TS >.

Definition at line 89 of file irlgm1fconstantparametrization.hpp.

89 {
90 return direct(0, alpha_->params()[0]) / this->scaling_;
91}
+ Here is the caller graph for this function:

◆ kappa()

Real kappa ( const Time  t) const
overridevirtual

Reimplemented from Lgm1fParametrization< TS >.

Definition at line 93 of file irlgm1fconstantparametrization.hpp.

93 {
94 return kappa_->params()[0];
95}
+ Here is the caller graph for this function:

◆ Hprime()

Real Hprime ( const Time  t) const
overridevirtual

Reimplemented from Lgm1fParametrization< TS >.

Definition at line 97 of file irlgm1fconstantparametrization.hpp.

97 {
98 return this->scaling_ * std::exp(-kappa_->params()[0] * t);
99}
+ Here is the caller graph for this function:

◆ Hprime2()

Real Hprime2 ( const Time  t) const
overridevirtual

Reimplemented from Lgm1fParametrization< TS >.

Definition at line 101 of file irlgm1fconstantparametrization.hpp.

101 {
102 return -this->scaling_ * kappa_->params()[0] * std::exp(-kappa_->params()[0] * t);
103}
+ Here is the caller graph for this function:

◆ parameter()

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

the parameter storing the raw parameter values

Reimplemented from Parametrization.

Definition at line 106 of file irlgm1fconstantparametrization.hpp.

106 {
107 QL_REQUIRE(i < 2, "parameter " << i << " does not exist, only have 0..1");
108 if (i == 0)
109 return alpha_;
110 else
111 return kappa_;
112}

◆ direct()

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

transformations between raw and actual parameters

Reimplemented from Parametrization.

Definition at line 69 of file irlgm1fconstantparametrization.hpp.

69 {
70 return i == 0 ? x * x : x;
71}

◆ inverse()

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

Reimplemented from Parametrization.

Definition at line 73 of file irlgm1fconstantparametrization.hpp.

73 {
74 return i == 0 ? std::sqrt(y) : y;
75}
+ Here is the caller graph for this function:

Member Data Documentation

◆ alpha_

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

Definition at line 51 of file irlgm1fconstantparametrization.hpp.

◆ kappa_

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

Definition at line 51 of file irlgm1fconstantparametrization.hpp.

◆ zeroKappaCutoff_

const Real zeroKappaCutoff_
private

Definition at line 52 of file irlgm1fconstantparametrization.hpp.