Class ExtendedCoxIngersollRoss
The extended Cox-Ingersoll-Ross model: r(t) = φ(t) + y(t), y a standard Cox-Ingersoll-Ross process, dy(t) = k(θ − y(t))dt + σ√y(t) dW(t), and φ the deterministic parameter fitting the curve.
public sealed class ExtendedCoxIngersollRoss : CoxIngersollRoss, ICalibratedModel, IAffineModel, ITermStructureConsistentModel
- Inheritance
-
ExtendedCoxIngersollRoss
- Implements
- Inherited Members
- Extension Methods
Remarks
φ is analytical in Dynamics(), φ(t) = f(t) − 2kθ(e^(th) − 1)/(2h + (k + h)(e^(th) − 1)) − 4x₀h²e^(th)/(2h + (k + h)(e^(th) − 1))², f the curve's instantaneous forward and h = √(k² + 2σ²), and numerical in Tree(TimeGrid), whose tree fits it to the curve at each step as it is built. QuantLib's header warns that the class "was not tested enough to guarantee its functionality".
As CoxIngersollRoss's, its Feller constraint reads each parameter vector's own k and θ, and its tree is on the square root of the process, y = √(r − φ(t)), the short rate y² + φ(t).
Constructors
ExtendedCoxIngersollRoss(YieldTermStructure, double, double, double, double, bool)
Initializes a new instance of the ExtendedCoxIngersollRoss class.
public ExtendedCoxIngersollRoss(YieldTermStructure termStructure, double theta = 0.1, double k = 0.1, double sigma = 0.1, double x0 = 0.05, bool withFellerConstraint = true)
Parameters
termStructureYieldTermStructureThe curve the model fits.
thetadoubleThe level θ, positive.
kdoubleThe speed k, positive.
sigmadoubleThe volatility σ, positive, and with the Feller constraint below √(2kθ).
x0doubleThe process's initial value, positive.
withFellerConstraintboolWhether the parameters satisfy the Feller condition σ² < 2kθ.
Exceptions
- ArgumentException
A parameter is outside its constraint.
- ArgumentNullException
termStructureis null.
Properties
TermStructure
Gets the curve the model fits.
public YieldTermStructure TermStructure { get; }
Property Value
Methods
A(double, double)
The affine discount bond's A(t, T), fitted to the curve.
protected override double A(double t, double T)
Parameters
Returns
- double
A(t, T).
DiscountBondOption(OptionType, double, double, double)
The price of an option on a discount bond, by the non-central χ² distribution on the curve.
public override double DiscountBondOption(OptionType type, double strike, double maturity, double bondMaturity)
Parameters
typeOptionTypeThe option's type.
strikedoubleThe strike, positive.
maturitydoubleThe option's maturity.
bondMaturitydoubleThe bond's maturity.
Returns
- double
The price.
Exceptions
- ArgumentException
strikeisn't positive.- ArgumentOutOfRangeException
typeisn't a member of its type.
Dynamics()
The model's short-rate dynamics, with the analytical fitting parameter: r = y + φ(t).
public override OneFactorModelShortRateDynamics Dynamics()
Returns
- OneFactorModelShortRateDynamics
A new dynamics object.
GenerateArguments()
The analytical fitting parameter, from the curve and the parameters.
[MemberNotNull("phi")]
protected override void GenerateArguments()
Tree(TimeGrid)
Builds the model's trinomial tree on a time grid, fitted to the curve at each step as it is built.
public override Lattice Tree(TimeGrid grid)
Parameters
gridTimeGridThe time grid.
Returns
- Lattice
The fitted OneFactorModelShortRateTree, immutable once returned.
Exceptions
- ArgumentNullException
gridis null.- NanoQLException
A step's fitting value can't be solved.