25 const Discretization discretization,
const bool evaluateBankAccount)
26 : parametrization_(parametrization), measure_(measure), discretization_(discretization),
27 evaluateBankAccount_(evaluateBankAccount) {
34 const QuantLib::Handle<QuantLib::YieldTermStructure>& discountCurve)
const {
35 if (QuantLib::close_enough(t, T))
37 QL_REQUIRE(T >= t && t >= 0.0,
"T(" << T <<
") >= t(" << t <<
") >= 0 required in HwModel::discountBond");
41 return (discountCurve.empty()
43 : discountCurve->discount(T) / discountCurve->discount(t)) *
44 std::exp(-QuantLib::DotProduct(gt, x) - 0.5 * QuantLib::DotProduct(gt, yt * gt));
48 const QuantLib::Handle<QuantLib::YieldTermStructure>& discountCurve,
49 const QuantLib::Array& aux)
const {
51 return std::exp(std::accumulate(aux.begin(), aux.end(), 0.0)) /
52 (discountCurve.empty() ?
parametrization_->termStructure()->discount(t) : discountCurve->discount(t));
56 const QuantLib::Handle<QuantLib::YieldTermStructure>& discountCurve)
const {
57 return std::accumulate(x.begin(), x.end(), 0.0) +
58 (discountCurve.empty() ?
parametrization_->termStructure()->forwardRate(t, t, Compounding::Continuous)
59 : discountCurve->forwardRate(t, t, Compounding::Continuous));
Size n_aux() const override
bool evaluateBankAccount_
QuantLib::ext::shared_ptr< StochasticProcess > stateProcess_
HwModel(const QuantLib::ext::shared_ptr< IrHwParametrization > ¶metrization, const Measure measure=Measure::BA, const Discretization discretization=Discretization::Euler, const bool evaluateBankAccount=true)
QuantLib::Real discountBond(const QuantLib::Time t, const QuantLib::Time T, const QuantLib::Array &x, const QuantLib::Handle< QuantLib::YieldTermStructure > &discountCurve=Handle< YieldTermStructure >()) const override
void generateArguments() override
QuantLib::Real shortRate(const QuantLib::Time t, const QuantLib::Array &x, const QuantLib::Handle< QuantLib::YieldTermStructure > &discountCurve=Handle< YieldTermStructure >()) const override
Discretization discretization_
Size m_aux() const override
QuantLib::ext::shared_ptr< IrHwParametrization > parametrization_
QuantLib::Real numeraire(const QuantLib::Time t, const QuantLib::Array &x, const QuantLib::Handle< QuantLib::YieldTermStructure > &discountCurve=Handle< YieldTermStructure >(), const QuantLib::Array &aux=Array()) const override
hull white n Factor model class
ir hw model state process