QuantLib: a free/open-source library for quantitative finance
fully annotated source code - version 1.34
|
Two-additive-factor gaussian model class. More...
#include <g2.hpp>
Classes | |
class | Dynamics |
class | FittingParameter |
Analytical term-structure fitting parameter \( \varphi(t) \). More... | |
Public Member Functions | |
G2 (const Handle< YieldTermStructure > &termStructure, Real a=0.1, Real sigma=0.01, Real b=0.1, Real eta=0.01, Real rho=-0.75) | |
ext::shared_ptr< ShortRateDynamics > | dynamics () const override |
Returns the short-rate dynamics. More... | |
Real | discountBond (Time now, Time maturity, Array factors) const override |
Real | discountBond (Time, Time, Rate, Rate) const |
Real | discountBondOption (Option::Type type, Real strike, Time maturity, Time bondMaturity) const override |
Real | swaption (const Swaption::arguments &arguments, Rate fixedRate, Real range, Size intervals) const |
DiscountFactor | discount (Time t) const override |
Implied discount curve. More... | |
Real | a () const |
Real | sigma () const |
Real | b () const |
Real | eta () const |
Real | rho () const |
Public Member Functions inherited from TwoFactorModel | |
TwoFactorModel (Size nParams) | |
virtual ext::shared_ptr< ShortRateDynamics > | dynamics () const =0 |
Returns the short-rate dynamics. More... | |
ext::shared_ptr< Lattice > | tree (const TimeGrid &grid) const override |
Returns a two-dimensional trinomial tree. More... | |
Public Member Functions inherited from ShortRateModel | |
ShortRateModel (Size nArguments) | |
virtual ext::shared_ptr< Lattice > | tree (const TimeGrid &) const =0 |
Public Member Functions inherited from CalibratedModel | |
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 |
Public Member Functions inherited from Observer | |
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 () |
Public Member Functions inherited from Observable | |
Observable () | |
Observable (const Observable &) | |
Observable & | operator= (const Observable &) |
Observable (Observable &&)=delete | |
Observable & | operator= (Observable &&)=delete |
virtual | ~Observable ()=default |
void | notifyObservers () |
Public Member Functions inherited from AffineModel | |
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 |
Public Member Functions inherited from TermStructureConsistentModel | |
TermStructureConsistentModel (Handle< YieldTermStructure > termStructure) | |
const Handle< YieldTermStructure > & | termStructure () const |
Protected Member Functions | |
void | generateArguments () override |
Real | A (Time t, Time T) const |
Real | B (Real x, Time t) const |
virtual void | generateArguments () |
Private Member Functions | |
Real | sigmaP (Time t, Time s) const |
Real | V (Time t) const |
Private Attributes | |
Parameter & | a_ |
Parameter & | sigma_ |
Parameter & | b_ |
Parameter & | eta_ |
Parameter & | rho_ |
Parameter | phi_ |
Additional Inherited Members | |
Public Types inherited from Observer | |
typedef set_type::iterator | iterator |
Protected Attributes inherited from CalibratedModel | |
std::vector< Parameter > | arguments_ |
ext::shared_ptr< Constraint > | constraint_ |
EndCriteria::Type | shortRateEndCriteria_ = EndCriteria::None |
Array | problemValues_ |
Integer | functionEvaluation_ |
Two-additive-factor gaussian model class.
This class implements a two-additive-factor model defined by
\[ dr_t = \varphi(t) + x_t + y_t \]
where \( x_t \) and \( y_t \) are defined by
\[ dx_t = -a x_t dt + \sigma dW^1_t, x_0 = 0 \]
\[ dy_t = -b y_t dt + \sigma dW^2_t, y_0 = 0 \]
and \( dW^1_t dW^2_t = \rho dt \).
|
overridevirtual |
Returns the short-rate dynamics.
Implements TwoFactorModel.
Definition at line 48 of file g2.cpp.
Implements AffineModel.
Definition at line 67 of file g2.hpp.
|
overridevirtual |
Implements AffineModel.
Definition at line 79 of file g2.cpp.
Real swaption | ( | const Swaption::arguments & | arguments, |
Rate | fixedRate, | ||
Real | range, | ||
Size | intervals | ||
) | const |
|
overridevirtual |
Implied discount curve.
Implements AffineModel.
Definition at line 85 of file g2.hpp.
Real sigma | ( | ) | const |
Real eta | ( | ) | const |
Real rho | ( | ) | const |
|
overrideprotectedvirtual |
Reimplemented from CalibratedModel.
Definition at line 53 of file g2.cpp.