Implementation - 2023.2 English

Vitis Libraries

Release Date
2023-12-20
Version
2023.2 English

This section mainly introduces the implementation process of short-rate and discount, which is core part of option pricing, and applied in Tree Engine and FD (finite-difference method) Engine.

As an important part of the Tree/ FD Engines, the class \(HWModel\) implements the single-factor Hull-White model to calculate short-rate and discount by using continuous compounding, including 4 functions (treeShortRate, fdShortRate, discount, discountBond). The implementation process is introduced as follows:

  1. Function treeShortRate:
    1. The short-rates is calculated at time point \(t\) with the duration \(dt\) from 0 to N point-by-point. As in the calculation process, the variable \(value\) needs to be calculated first. To improve the initiation interval (II), an array \(values16\) is implemented to store the intermediate results from each iteration. Then, an addition tree is performed subsequently to achieve an II = 1 for the whole process. Finally, the short rate is calculated using variable \(value\).
    2. For implementing the generic Tree framework, the \(state\_price\) calculating process is moved from Tree Lattice to this Model.
  2. Function fdShortRate: The short-rate is calculated at time point \(t\).
  3. Function discount: The discount is calculated at time point \(t\) with the duration \(dt\) based on the short-rate.
  4. Function discountBond: The discount bond is calculated at time point \(t\) with the duration \(dt=T-t\) based on the short-rate.