QuantLib: a free/open-source library for quantitative finance
fully annotated source code - version 1.34
|
Generalized Hull-White model class. More...
#include <generalizedhullwhite.hpp>
Classes | |
class | Dynamics |
Short-rate dynamics in the generalized Hull-White model. More... | |
class | FittingParameter |
Analytical term-structure fitting parameter \varphi(t) . More... | |
Public Member Functions | |
GeneralizedHullWhite (const Handle< YieldTermStructure > &yieldtermStructure, const std::vector< Date > &speedstructure, const std::vector< Date > &volstructure, const std::vector< Real > &speed, const std::vector< Real > &vol, const ext::function< Real(Real)> &f={}, const ext::function< Real(Real)> &fInverse={}) | |
template<class SpeedInterpolationTraits , class VolInterpolationTraits > | |
GeneralizedHullWhite (const Handle< YieldTermStructure > &yieldtermStructure, const std::vector< Date > &speedstructure, const std::vector< Date > &volstructure, const std::vector< Real > &speed, const std::vector< Real > &vol, const SpeedInterpolationTraits &speedtraits, const VolInterpolationTraits &voltraits, const ext::function< Real(Real)> &f={}, const ext::function< Real(Real)> &fInverse={}) | |
ext::shared_ptr< ShortRateDynamics > | dynamics () const override |
returns the short-rate dynamics More... | |
ext::shared_ptr< Lattice > | tree (const TimeGrid &grid) const override |
GeneralizedHullWhite (const Handle< YieldTermStructure > &yieldtermStructure, Real a=0.1, Real sigma=0.01) | |
ext::shared_ptr< ShortRateDynamics > | HWdynamics () const |
Real | discountBondOption (Option::Type type, Real strike, Time maturity, Time bondMaturity) const override |
Only valid under Hull-White model. More... | |
std::vector< bool > | fixedReversion () const |
vector to pass to 'calibrate' to fit only volatility More... | |
![]() | |
OneFactorAffineModel (Size nArguments) | |
Real | discountBond (Time now, Time maturity, Array factors) const override |
Real | discountBond (Time now, Time maturity, Rate rate) const |
DiscountFactor | discount (Time t) const override |
Implied discount curve. More... | |
![]() | |
OneFactorModel (Size nArguments) | |
~OneFactorModel () override=default | |
virtual ext::shared_ptr< ShortRateDynamics > | dynamics () const =0 |
returns the short-rate dynamics More... | |
ext::shared_ptr< Lattice > | tree (const TimeGrid &grid) const override |
Return by default a trinomial recombining tree. More... | |
![]() | |
ShortRateModel (Size nArguments) | |
virtual ext::shared_ptr< Lattice > | tree (const TimeGrid &) const =0 |
![]() | |
CalibratedModel (Size nArguments) | |
void | update () override |
virtual void | calibrate (const std::vector< ext::shared_ptr< CalibrationHelper > > &, OptimizationMethod &method, const EndCriteria &endCriteria, const Constraint &constraint=Constraint(), const std::vector< Real > &weights=std::vector< Real >(), const std::vector< bool > &fixParameters=std::vector< bool >()) |
Calibrate to a set of market instruments (usually caps/swaptions) More... | |
Real | value (const Array ¶ms, const std::vector< ext::shared_ptr< CalibrationHelper > > &) |
const ext::shared_ptr< Constraint > & | constraint () const |
EndCriteria::Type | endCriteria () const |
Returns end criteria result. More... | |
const Array & | problemValues () const |
Returns the problem values. More... | |
Array | params () const |
Returns array of arguments on which calibration is done. More... | |
virtual void | setParams (const Array ¶ms) |
Integer | functionEvaluation () const |
![]() | |
Observer ()=default | |
Observer (const Observer &) | |
Observer & | operator= (const Observer &) |
virtual | ~Observer () |
std::pair< iterator, bool > | registerWith (const ext::shared_ptr< Observable > &) |
void | registerWithObservables (const ext::shared_ptr< Observer > &) |
Size | unregisterWith (const ext::shared_ptr< Observable > &) |
void | unregisterWithAll () |
virtual void | update ()=0 |
virtual void | deepUpdate () |
![]() | |
Observable () | |
Observable (const Observable &) | |
Observable & | operator= (const Observable &) |
Observable (Observable &&)=delete | |
Observable & | operator= (Observable &&)=delete |
virtual | ~Observable ()=default |
void | notifyObservers () |
![]() | |
virtual DiscountFactor | discount (Time t) const =0 |
Implied discount curve. More... | |
virtual Real | discountBond (Time now, Time maturity, Array factors) const =0 |
virtual Real | discountBondOption (Option::Type type, Real strike, Time maturity, Time bondMaturity) const =0 |
virtual Real | discountBondOption (Option::Type type, Real strike, Time maturity, Time bondStart, Time bondMaturity) const |
![]() | |
TermStructureConsistentModel (Handle< YieldTermStructure > termStructure) | |
const Handle< YieldTermStructure > & | termStructure () const |
Protected Member Functions | |
Real | a () const |
Real | sigma () const |
void | generateArguments () override |
Real | A (Time t, Time T) const override |
Real | B (Time t, Time T) const override |
Real | V (Time t, Time T) const |
virtual Real | A (Time t, Time T) const =0 |
virtual Real | B (Time t, Time T) const =0 |
virtual void | generateArguments () |
Private Member Functions | |
ext::function< Real(Time)> | speed () const |
ext::function< Real(Time)> | vol () const |
template<class SpeedInterpolationTraits , class VolInterpolationTraits > | |
void | initialize (const Handle< YieldTermStructure > &yieldtermStructure, const std::vector< Date > &speedstructure, const std::vector< Date > &volstructure, const std::vector< Real > &speed, const std::vector< Real > &vol, const SpeedInterpolationTraits &speedtraits, const VolInterpolationTraits &voltraits, const ext::function< Real(Real)> &f, const ext::function< Real(Real)> &fInverse) |
Static Private Member Functions | |
static Real | identity (Real x) |
Private Attributes | |
std::vector< Date > | speedstructure_ |
std::vector< Date > | volstructure_ |
std::vector< Time > | speedperiods_ |
std::vector< Time > | volperiods_ |
Interpolation | speed_ |
Interpolation | vol_ |
Parameter & | a_ |
Parameter & | sigma_ |
Parameter | phi_ |
ext::function< Real(Real)> | f_ |
ext::function< Real(Real)> | fInverse_ |
Additional Inherited Members | |
![]() | |
typedef set_type::iterator | iterator |
![]() | |
std::vector< Parameter > | arguments_ |
ext::shared_ptr< Constraint > | constraint_ |
EndCriteria::Type | shortRateEndCriteria_ = EndCriteria::None |
Array | problemValues_ |
Integer | functionEvaluation_ |
Generalized Hull-White model class.
This class implements the standard Black-Karasinski model defined by
d f(r_t) = (\theta(t) - \alpha f(r_t))dt + \sigma dW_t,
where alpha and sigma are piecewise linear functions.
Definition at line 72 of file generalizedhullwhite.hpp.
GeneralizedHullWhite | ( | const Handle< YieldTermStructure > & | yieldtermStructure, |
const std::vector< Date > & | speedstructure, | ||
const std::vector< Date > & | volstructure, | ||
const std::vector< Real > & | speed, | ||
const std::vector< Real > & | vol, | ||
const ext::function< Real(Real)> & | f = {} , |
||
const ext::function< Real(Real)> & | fInverse = {} |
||
) |
GeneralizedHullWhite | ( | const Handle< YieldTermStructure > & | yieldtermStructure, |
const std::vector< Date > & | speedstructure, | ||
const std::vector< Date > & | volstructure, | ||
const std::vector< Real > & | speed, | ||
const std::vector< Real > & | vol, | ||
const SpeedInterpolationTraits & | speedtraits, | ||
const VolInterpolationTraits & | voltraits, | ||
const ext::function< Real(Real)> & | f = {} , |
||
const ext::function< Real(Real)> & | fInverse = {} |
||
) |
Definition at line 86 of file generalizedhullwhite.hpp.
GeneralizedHullWhite | ( | const Handle< YieldTermStructure > & | yieldtermStructure, |
Real | a = 0.1 , |
||
Real | sigma = 0.01 |
||
) |
|
overridevirtual |
returns the short-rate dynamics
Implements OneFactorModel.
Definition at line 105 of file generalizedhullwhite.hpp.
Implements ShortRateModel.
Definition at line 211 of file generalizedhullwhite.cpp.
ext::shared_ptr< OneFactorModel::ShortRateDynamics > HWdynamics | ( | ) | const |
|
overridevirtual |
Only valid under Hull-White model.
Implements AffineModel.
Definition at line 181 of file generalizedhullwhite.cpp.
std::vector< bool > fixedReversion | ( | ) | const |
vector to pass to 'calibrate' to fit only volatility
Definition at line 253 of file generalizedhullwhite.cpp.
|
protected |
Definition at line 132 of file generalizedhullwhite.hpp.
|
protected |
Definition at line 133 of file generalizedhullwhite.hpp.
|
overrideprotectedvirtual |
Reimplemented from CalibratedModel.
Definition at line 122 of file generalizedhullwhite.cpp.
Implements OneFactorAffineModel.
Definition at line 199 of file generalizedhullwhite.cpp.
Implements OneFactorAffineModel.
Definition at line 128 of file generalizedhullwhite.cpp.
Definition at line 152 of file generalizedhullwhite.cpp.
Definition at line 244 of file generalizedhullwhite.cpp.
Definition at line 248 of file generalizedhullwhite.cpp.
Definition at line 162 of file generalizedhullwhite.hpp.
|
private |
Definition at line 167 of file generalizedhullwhite.hpp.
|
private |
Definition at line 145 of file generalizedhullwhite.hpp.
|
private |
Definition at line 146 of file generalizedhullwhite.hpp.
|
private |
Definition at line 147 of file generalizedhullwhite.hpp.
|
private |
Definition at line 148 of file generalizedhullwhite.hpp.
|
private |
Definition at line 149 of file generalizedhullwhite.hpp.
|
private |
Definition at line 150 of file generalizedhullwhite.hpp.
|
private |
Definition at line 155 of file generalizedhullwhite.hpp.
|
private |
Definition at line 156 of file generalizedhullwhite.hpp.
|
private |
Definition at line 157 of file generalizedhullwhite.hpp.
Definition at line 159 of file generalizedhullwhite.hpp.
Definition at line 160 of file generalizedhullwhite.hpp.