Table of Contents

Class ExtendedCoxIngersollRoss

Namespace
NanoQL.Models
Assembly
NanoQL.dll

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

termStructure YieldTermStructure

The curve the model fits.

theta double

The level θ, positive.

k double

The speed k, positive.

sigma double

The volatility σ, positive, and with the Feller constraint below √(2kθ).

x0 double

The process's initial value, positive.

withFellerConstraint bool

Whether the parameters satisfy the Feller condition σ² < 2kθ.

Exceptions

ArgumentException

A parameter is outside its constraint.

ArgumentNullException

termStructure is null.

Properties

TermStructure

Gets the curve the model fits.

public YieldTermStructure TermStructure { get; }

Property Value

YieldTermStructure

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

t double

The time.

T double

The bond's maturity.

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

type OptionType

The option's type.

strike double

The strike, positive.

maturity double

The option's maturity.

bondMaturity double

The bond's maturity.

Returns

double

The price.

Exceptions

ArgumentException

strike isn't positive.

ArgumentOutOfRangeException

type isn'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

grid TimeGrid

The time grid.

Returns

Lattice

The fitted OneFactorModelShortRateTree, immutable once returned.

Exceptions

ArgumentNullException

grid is null.

NanoQLException

A step's fitting value can't be solved.