24#ifndef quantext_constant_irlgm1f_parametrizations_hpp
25#define quantext_constant_irlgm1f_parametrizations_hpp
37 const Real
kappa,
const std::string&
name = std::string());
38 Real
zeta(
const Time t)
const override;
39 Real
H(
const Time t)
const override;
40 Real
alpha(
const Time t)
const override;
41 Real
kappa(
const Time t)
const override;
42 Real
Hprime(
const Time t)
const override;
43 Real
Hprime2(
const Time t)
const override;
44 const QuantLib::ext::shared_ptr<Parameter>
parameter(
const Size)
const override;
47 Real
direct(
const Size i,
const Real x)
const override;
48 Real
inverse(
const Size j,
const Real y)
const override;
59 const Handle<TS>& termStructure,
const Real alpha,
60 const Real kappa,
const std::string& name)
70 return i == 0 ? x * x : x;
74 return i == 0 ? std::sqrt(y) : y;
78 return direct(0, alpha_->params()[0]) * direct(0, alpha_->params()[0]) * t / (this->scaling_ * this->scaling_);
82 if (std::fabs(kappa_->params()[0]) < zeroKappaCutoff_) {
83 return this->scaling_ * t + this->shift_;
85 return this->scaling_ * (1.0 - std::exp(-kappa_->params()[0] * t)) / kappa_->params()[0] + this->shift_;
90 return direct(0, alpha_->params()[0]) / this->scaling_;
94 return kappa_->params()[0];
98 return this->scaling_ * std::exp(-kappa_->params()[0] * t);
102 return -this->scaling_ * kappa_->params()[0] * std::exp(-kappa_->params()[0] * t);
107 QL_REQUIRE(i < 2,
"parameter " << i <<
" does not exist, only have 0..1");
LGM 1F Constant Parametrization.
const Real zeroKappaCutoff_
Real zeta(const Time t) const override
Real kappa(const Time t) const override
Real Hprime(const Time t) const override
Real alpha(const Time t) const override
Real H(const Time t) const override
Real direct(const Size i, const Real x) const override
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 QuantLib::ext::shared_ptr< Parameter > parameter(const Size) const override
Lgm1fConstantParametrization(const Currency ¤cy, const Handle< TS > &termStructure, const Real alpha, const Real kappa, const std::string &name=std::string())
Real Hprime2(const Time t) const override
const Handle< TS > termStructure() const
const std::string & name() const
virtual const Currency & currency() const
Parameter that accesses CalibratedModel.
Interest Rate Linear Gaussian Markov 1 factor parametrization.
Lgm1fConstantParametrization< YieldTermStructure > IrLgm1fConstantParametrization