Calibration process aims to calculate the coefficients that are used in the pricing process.
The detailed calculation process is as follows:
- 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\).
- Refer to Equation (3), \(a\), \(b\), \(c\), \(d\) are the unknown coefficients that should be calculated. Denote these coefficients as \(x\), so
The expressions derived from path data \(S_t\), \(S_t^2\) and \(E_t\) can be obtained for each time step \(t\). Here denote them as \(A\).
Equation (3) can be re-written as:
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, calculate the value of four elements in vector \(A_t\) for each time step \(t\). Which is to say, four 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:
Corresponding to the two steps described above, the hardware architecture is shown in Figure 62.
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.
- Once you get the matrix \(B\), the singular matrix \(\Sigma\) of \(B\) could be obtained by SVD (Singular Value Decomposition).
- Thereafter, use Least-Squares to calculated the coefficients by modifying Equation (4) to:
Until now, matrix \(B\) and vector \(y\) are known, coefficients \(x\) could be calculated.
The implementation of step 3 and steps 4 is shown in Figure 63. 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 might change by customers’ demands. However, the size must be a multiple of 1024.