Table of Contents

Class BlackKarasinski

Namespace
NanoQL.Models
Assembly
NanoQL.dll

The standard Black-Karasinski model: d ln rₜ = (θ(t) − α ln rₜ)dt + σ dWₜ, with constant α and σ, fitted to a yield curve.

public sealed class BlackKarasinski : OneFactorModel, ICalibratedModel, ITermStructureConsistentModel
Inheritance
BlackKarasinski
Implements
Inherited Members
Extension Methods

Remarks

Its short rate is rₜ = e^(φ(t) + xₜ), xₜ an Ornstein-Uhlenbeck process and φ the deterministic fitting parameter, which can't be determined analytically: a tree fits it to the curve at each step as it is built, by Brent (1,000 evaluations, accuracy 1e-7, in [−50, 50] from the previous step's value), and Dynamics() reads the fitting of a 50-step tree over the curve's maximum time, as QuantLib's does.

Each tree owns its fitting: a divergence, QuantLib's writing the model's one fitting parameter, so a second tree on another grid rewrites the first's, which then refuses "fitting parameter not set!" at its own times (Divergences/BlackKarasinskiTreeFittingTests.cs), as the Hull-White tree already does.

Constructors

BlackKarasinski(YieldTermStructure, double, double)

Initializes a new instance of the BlackKarasinski class.

public BlackKarasinski(YieldTermStructure termStructure, double a = 0.1, double sigma = 0.1)

Parameters

termStructure YieldTermStructure

The curve the model fits.

a double

The mean reversion α, positive.

sigma double

The volatility σ, positive.

Exceptions

ArgumentNullException

termStructure is null.

ArgumentException

a or sigma isn't positive.

Properties

TermStructure

Gets the curve the model fits.

public YieldTermStructure TermStructure { get; }

Property Value

YieldTermStructure

Methods

Dynamics()

The model's short-rate dynamics, on the fitting of a 50-step tree over the curve's maximum time.

public override OneFactorModelShortRateDynamics Dynamics()

Returns

OneFactorModelShortRateDynamics

A new dynamics object, whose fitting parameter is set at that tree's times only.

Exceptions

NanoQLException

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

Tree(TimeGrid)

Builds the model's trinomial tree on a time grid, its own fitting parameter fitted to the curve.

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.