24#ifndef quantext_piecewiseconstant_irlgm1f_hwadaptor_hpp
25#define quantext_piecewiseconstant_irlgm1f_hwadaptor_hpp
27#include <ql/math/comparison.hpp>
42 const Currency&
currency,
const Handle<TS>&
termStructure,
const Array& sigmaTimes,
const Array& sigma,
43 const Array& kappaTimes,
const Array&
kappa,
const std::string&
name = std::string(),
44 const QuantLib::ext::shared_ptr<QuantLib::Constraint>& sigmaConstraint = QuantLib::ext::make_shared<QuantLib::NoConstraint>(),
45 const QuantLib::ext::shared_ptr<QuantLib::Constraint>& kappaConstraint = QuantLib::ext::make_shared<QuantLib::NoConstraint>());
48 const Array& sigma,
const std::vector<Date>& kappaDates,
const Array&
kappa,
49 const std::string&
name = std::string(),
50 const QuantLib::ext::shared_ptr<QuantLib::Constraint>& sigmaConstraint = QuantLib::ext::make_shared<QuantLib::NoConstraint>(),
51 const QuantLib::ext::shared_ptr<QuantLib::Constraint>& kappaConstraint = QuantLib::ext::make_shared<QuantLib::NoConstraint>());
52 Real
zeta(
const Time
t)
const override;
53 Real
H(
const Time
t)
const override;
54 Real
alpha(
const Time
t)
const override;
55 Real
kappa(
const Time
t)
const override;
56 Real
Hprime(
const Time
t)
const override;
57 Real
Hprime2(
const Time
t)
const override;
60 const QuantLib::ext::shared_ptr<Parameter>
parameter(
const Size)
const override;
61 void update()
const override;
64 Real
direct(
const Size i,
const Real x)
const override;
65 Real
inverse(
const Size j,
const Real
y)
const override;
75 const Currency& currency,
const Handle<TS>& termStructure,
const Array& sigmaTimes,
const Array& sigma,
76 const Array& kappaTimes,
const Array& kappa,
const std::string& name,
77 const QuantLib::ext::shared_ptr<QuantLib::Constraint>& sigmaConstraint,
78 const QuantLib::ext::shared_ptr<QuantLib::Constraint>& kappaConstraint)
87 const Currency& currency,
const Handle<TS>& termStructure,
const std::vector<Date>& sigmaDates,
const Array& sigma,
88 const std::vector<Date>& kappaDates,
const Array& kappa,
const std::string& name,
89 const QuantLib::ext::shared_ptr<QuantLib::Constraint>& sigmaConstraint,
90 const QuantLib::ext::shared_ptr<QuantLib::Constraint>& kappaConstraint)
100 "sigma size (" << sigma.size() <<
") inconsistent to times size ("
103 "kappa size (" << kappa.size() <<
") inconsistent to times size ("
131 return hullWhiteSigma(t) / Hprime(t) / this->scaling_;
161 QL_REQUIRE(i < 2,
"parameter " << i <<
" does not exist, only have 0..1");
170 QL_REQUIRE(i < 2,
"parameter " << i <<
" does not exist, only have 0..1");
void update() const override
const Handle< TS > termStructure() const
LGM 1f Piecewise Constant Hull White Adaptor.
Real zeta(const Time t) const override
Real kappa(const Time t) const override
Lgm1fPiecewiseConstantHullWhiteAdaptor(const Currency ¤cy, const Handle< TS > &termStructure, const Array &sigmaTimes, const Array &sigma, const Array &kappaTimes, const Array &kappa, const std::string &name=std::string(), const QuantLib::ext::shared_ptr< QuantLib::Constraint > &sigmaConstraint=QuantLib::ext::make_shared< QuantLib::NoConstraint >(), const QuantLib::ext::shared_ptr< QuantLib::Constraint > &kappaConstraint=QuantLib::ext::make_shared< QuantLib::NoConstraint >())
void initialize(const Array &sigma, const Array &kappa)
Real Hprime(const Time t) const override
void update() const override
Real hullWhiteSigma(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
Real inverse(const Size j, const Real y) const override
const Array & parameterTimes(const Size) const override
const QuantLib::ext::shared_ptr< Parameter > parameter(const Size) const override
Real Hprime2(const Time t) const override
const std::string & name() const
virtual const Currency & currency() const
Piecewise Constant Helper2.
Real y(const Time t) const
Real inverse(const Real y) const
Real exp_m_int_y(const Time t) const
exp(int_0^t -y(s)) ds
Real int_exp_m_int_y(const Time t) const
int_0^t exp(int_0^s -y(u) du) ds
const QuantLib::ext::shared_ptr< PseudoParameter > y_
Real direct(const Real x) const
Piecewise Constant Helper 3.
const QuantLib::ext::shared_ptr< PseudoParameter > y1_
Real y1(const Time t) const
Real int_y1_sqr_exp_2_int_y2(const Time t) const
int_0^t y1^2(s) exp(2*int_0^s y2(u) du) ds
Real direct1(const Real x) const
const QuantLib::ext::shared_ptr< PseudoParameter > y2_
Real inverse1(const Real y) const
Interest Rate Linear Gaussian Markov 1 factor parametrization.
QuantLib::SparseMatrix inverse(QuantLib::SparseMatrix m)
Lgm1fPiecewiseConstantHullWhiteAdaptor< YieldTermStructure > IrLgm1fPiecewiseConstantHullWhiteAdaptor
helper classes for piecewise constant parametrizations