24#ifndef quantext_com_schwartz_parametrization_hpp
25#define quantext_com_schwartz_parametrization_hpp
27#include <ql/handle.hpp>
69 const Handle<QuantExt::PriceTermStructure>&
priceCurve,
70 const Handle<Quote>& fxSpotToday,
const Real
sigma,
const Real kappa,
77 Real
sigma(
const Time t)
const;
83 const QuantLib::ext::shared_ptr<Parameter>
parameter(
const Size)
const override;
87 Real
VtT(Real t, Real T);
92 Real
direct(
const Size i,
const Real x)
const override;
93 Real
inverse(
const Size i,
const Real y)
const override;
100 const QuantLib::ext::shared_ptr<PseudoParameter>
sigma_;
101 const QuantLib::ext::shared_ptr<PseudoParameter>
kappa_;
114 if (kap < QL_EPSILON)
115 return sig * sig * t;
117 return sig * sig * (std::exp(2.0 * kap * t) - 1.0) / (2.0 * kap);
119 return sig * sig * (1.0 - std::exp(-2.0 * kap * t)) / (2.0 * kap);
126 return sig * std::exp(kap * u);
140 QL_REQUIRE(i < 2,
"parameter " << i <<
" does not exist, only have 0 and 1");
COM Schwartz parametrization.
Real inverse(const Size i, const Real y) const override
Real VtT(Real t, Real T)
Variance V(t,T) used in the computation of F(t,T)
Real variance(const Time t) const
State variable variance on [0, t].
const Handle< Quote > fxSpotToday_
Handle< QuantExt::PriceTermStructure > priceCurve()
Inspector for today's price curve.
const Handle< QuantExt::PriceTermStructure > priceCurve_
Size numberOfParameters() const override
Real direct(const Size i, const Real x) const override
const QuantLib::ext::shared_ptr< PseudoParameter > sigma_
Real sigmaParameter() const
Inspector for the current value of model parameter sigma (direct)
Real kappaParameter() const
Inspector for the current value of model parameter kappa (direct)
bool driftFreeState() const
const QuantLib::ext::shared_ptr< PseudoParameter > kappa_
const QuantLib::ext::shared_ptr< Parameter > parameter(const Size) const override
Inspector for current value of the model parameter vector (inverse values)
Real sigma(const Time t) const
State variable Y's diffusion at time t: sigma * exp(kappa * t)
const std::string & name() const
virtual const Currency & currency() const
base class for model parametrizations
Term structure of prices.