Calibration Process - 2023.2 English

Vitis Libraries

Release Date
2023-12-20
Version
2023.2 English

Calibration process aims to calculate the coefficients that will be used in the pricing process.

The detailed calculation process is as follows:

  1. Generate uniform random numbers with Mersenne Twister UNiform MT19937 Random Number Generator (RNG) followed by Inverse Cumulative Normal (ICN) uniform random numbers. Thereafter, generate independent stock paths with the uniform random numbers and Black-Sholes path generator. The default paths (samples) number used in the calibration process is 4096. Thus, 4096 random numbers are generated for each time step \(t\).
  2. Refer to Equation (3), \(a\), \(b\), \(c\), \(d\) are the unknown coefficients that should be calculated. We denote these coefficients as \(x\), so
\[\begin{split}x = \begin{bmatrix} a \\ b \\ c \\ d \end{bmatrix}\end{split}\]

The expressions derived from path data \(S_t\), \(S_t^2\) and \(E_t\) can be obtained for each time step \(t\). Here we denote them as \(A\).

\[A = \begin{bmatrix} 1 \ S_t \ S_t^2 \ E_t(S_t) \end{bmatrix}\]

Equation (3) can be re-written as:

(4)\[y = A x\]

where \(y\) is the conditional expectation \(E_t(Y_t|S_t)\) in Equation (3). To simplify the expression in deduction, it is denoted as \(y\) in this section. By backward process, this conditional expectation \(y\) for each time step can be obtained. Which is to say, \(y\) is actually the optimal exercise price in the period of \(t\) to \(T\). Therefore, the problem of computing coefficients is changes to find the solution for Equation (4).

In practical, in this step, we calculate the value of 4 elements in vector \(A_t\) for each time step \(t\). Which is to say, 4 outputs of this stage are \(1\), \(S_t\), \(S_t^2\) and \(E_t\). The default size of :\(A_t\) for each time step is 4096 * 4.

To simplify the process of solving Equation (4), matrix data \(A\) is multiplied with its transform \(A^T\). A new 4*4 matrix \(B\) can be derived:

\[A^T A = B.\]

Corresponding to the two steps described above, the hardware architecture is shown in Figure 61.

The McAmericanEngine structure

We denote the process from RNG to generate matrix data \(B\) and exercise price for each timestep \(t\) as a Monte-Carlo-Model (MCM) in American Option Calibration Process. Each MCM process 1024 data. With a template parameter UN_PATH, more pieces of MCM can be instanced when hardware resources available.

To connect multiple MCM data, two merger blocks are created: one for merge price data, one for merge matrix \(B\). Meanwhile, to guarantee all calibration path data can be executed in a loop when there is not enough MCM available, a soft-layer Merger that accumulates all elements of \(B\) data is employed. Since these intermediate data need to be accumulated multiple times, a BRAM is used to save and load them.

  1. Once we get the matrix \(B\), the singular matrix \(\Sigma\) of \(B\) could be obtained by SVD (Singular Value Decomposition).
\[B = U \Sigma V.\]
  1. Thereafter, use Least-Squares to calculated the coefficients by modifying Equation (4) to:
\[\begin{split}y &= A x \\ A^T y &= A^TA x \\ A^T y &= Bx\end{split}\]

Until now, matrix \(B\) and vector \(y\) are known, coefficients \(x\) could be calculated.

The McAmericanEngine structure

The implementation of step 3 and steps 4 is shown in Figure 62. Because step 2 generates matrix \(B\) and price data \(y\) from timesteps \(0\) to \(T\). Step 3 processes these data in the backward direction, from timesteps \(T\) to \(0\). Considering the amount of data, 4096*timesteps*8*sizeof(DT) and 9*timesteps*8*sizeof(DT), it is impossible to store all the data on FPGA. In the implementation, DDR/HBM memory is used to save these data. Correspondingly, DDR data read/write modules are added to the design.

Besides, notice that since SVD is purely computing dependent, which is pretty slow in the design. Therefore, a template parameter UN_STEP is added to speed up the SVD calculation process.

Note

It is worth mentioning that 4096 is only the default calibrate sample/path size. This number may change by customers’ demands. However, the size must be a multiple of 1024.