Table of Contents

Class RatePseudoRootJacobian

Namespace
NanoQL.Models
Assembly
NanoQL.dll

The derivative of a log-normal Euler step's end rates along given bumps of its pseudo-root, analytically, for the pathwise vegas (Giles and Glasserman's B, a row per bump): the step in the discretely compounding money-market account.

[WorkingType]
public sealed class RatePseudoRootJacobian
Inheritance
RatePseudoRootJacobian
Inherited Members

Remarks

A working type: its scratch is QuantLib's members, so an instance serves one caller at a time. It copies the pseudo-root and the bumps.

The derivative (a documented divergence; Divergences/RatePseudoRootJacobianTests.cs): the drift's sum carries each rate's own accrual period, e_j = Σ_{k<j} τ_k (f_k + d_k) P_k a_k, and the derivative of rate j along rate k's root carries f_j + d_j. QuantLib's sums the terms without τ_k and multiplies by τ_j, right on equal periods only, and carries f_j (ratepseudorootjacobian.cpp:183, :191, :197). On equal periods of a power of two and no displacement, QuantLib's bits.

Constructors

RatePseudoRootJacobian(Matrix, int, int, ReadOnlySpan<double>, IReadOnlyList<Matrix>, ReadOnlySpan<double>)

Initializes a new instance of the RatePseudoRootJacobian class.

public RatePseudoRootJacobian(Matrix pseudoRoot, int aliveIndex, int numeraire, ReadOnlySpan<double> taus, IReadOnlyList<Matrix> pseudoBumps, ReadOnlySpan<double> displacements)

Parameters

pseudoRoot Matrix

The step's pseudo-root, a row per rate; copied.

aliveIndex int

The step's first alive rate.

numeraire int

The step's numeraire: its first alive rate, the money-market account's.

taus ReadOnlySpan<double>

The rates' accrual periods.

pseudoBumps IReadOnlyList<Matrix>

The bumps, each of the pseudo-root's size; copied.

displacements ReadOnlySpan<double>

The rates' displacements.

Exceptions

ArgumentException

The numeraire isn't the first alive rate, or a size isn't the rates' or the factors'.

Methods

GetBumps(ReadOnlySpan<double>, ReadOnlySpan<double>, ReadOnlySpan<double>, ReadOnlySpan<double>, Matrix)

Writes, for each bump, the derivative of each rate at the step's end along the bump.

public void GetBumps(ReadOnlySpan<double> oldRates, ReadOnlySpan<double> discountRatios, ReadOnlySpan<double> newRates, ReadOnlySpan<double> gaussians, Matrix b)

Parameters

oldRates ReadOnlySpan<double>

The rates at the step's start.

discountRatios ReadOnlySpan<double>

The one-step discount factors at the step's start, 1 / (1 + τ_k f_k) at k + 1, 1 + the number of rates entries.

newRates ReadOnlySpan<double>

The rates at the step's end.

gaussians ReadOnlySpan<double>

The step's Gaussians, one per factor.

b Matrix

The derivatives, a row per bump and a column per rate, written.

Exceptions

ArgumentException

b isn't the bumps' by the rates.