You are on page 1of 14

See discussions, stats, and author profiles for this publication at: https://www.researchgate.

net/publication/353479642

Pricing Exotic Options with Flow-based Generative Networks

Preprint · July 2021


DOI: 10.13140/RG.2.2.14294.57923

CITATIONS READS

0 262

4 authors, including:

Hyun Gyoon Kim Jeong-Hoon Kim


Ajou University Yonsei University
13 PUBLICATIONS 11 CITATIONS 106 PUBLICATIONS 1,112 CITATIONS

SEE PROFILE SEE PROFILE

Jeonggyu Huh
Chonnam National University
20 PUBLICATIONS 46 CITATIONS

SEE PROFILE

All content following this page was uploaded by Jeonggyu Huh on 27 July 2021.

The user has requested enhancement of the downloaded file.


Pricing Exotic Options with Flow-based Generative Networks

Hyun-Gyoon Kima , Se-Jin Kwonb , Jeong-Hoon Kima , Jeonggyu Huhc,∗

a School of Mathematics & Computing, Yonsei University, Seoul 03722, South Korea
b Korea Asset Pricing, Seoul 03131, South Korea
c Department of Mathematics & Statistics, Chonnam National University, Gwangju 61186, South Korea

Abstract

In this study, we aim to significantly reduce the computational time for pricing exotic options using a flow-based
generative model. Flow-based generative networks learn large-scale simulated two-dimensional random states based
on two stochastic volatility (SV) models. Through these networks, we can simulate option prices for a given set of
parameters and achieve a fair option price as the discounted mean of the simulated prices for the SV models. In
addition, the networks provide explicit probability density functions for these SV models, which is possible due to
the flow-based generative model’s unique benefits. Finally, we compare the network-based prices with those of the
Monte-Carlo simulation in terms of accuracy and time cost to demonstrate the superior performance of the proposed
method.
Keywords: exotic options; flow-based generative model; stochastic volatility model; deep learning; density
estimation

1. Introduction

Exotic options refer to financial derivatives with more complex structures than commonly traded vanilla options
in terms of its payment structure, expiration date, and strike price [1]. Since most exotic options are traded in the
relatively unregulated over-the-counter (OTC) markets, these options have considerable trading volume and diversity.
Thus, to rapidly find fair prices and Greeks for enormous options, traders need efficient pricing tools for the exotic
options. Regrettably, analytic pricing formulas are rarely induced from most stochastic volatility (SV) models, such
as the Heston [2] and exponential Ornstein-Uhlenbeck (ExpOU) [3, 4] models. Even in a constant volatility model,
that is, the Black-Scholes (BS) model [5], only a few analytic forms are found. Numerical methods, such as the finite
difference method (FDM) and the Monte-Carlo simulation, can be used to find the relevant quantities; however, such
methods are too slow to be applied to large OTC markets.
Alternatively, instead of finding the analytic formulas directly, we attempt to find the joint probability densities
p (x1 , x2 ) on 2D random states (x1 , x2 ) for SV models. In this study, the type of the random state x is restricted in the
following manner: the log-return XT and hidden state YT at the expiration T and the maximum MT and average AT of
the discretely sampled log-returns Xt |t≤T before T . The prices of various exotic options can then be easily calculated
via numerical integrations. To the best of our knowledge, this approach can be applied to a wide range of exotic
options, including barrier, floating-strike lookback, and floating-strike Asian options with geometric averaging. For
example, we should obtain the joint density of (XT , MT ) and (XT , AT ) to price the barrier and Asian options, respec-
tively, with numerical integrations. Furthermore, the random states (x1 , x2 ) can be simulated based on the obtained
densities (even if the densities are given, the simulation is not usually trivial; however, this can be easily achieved by
our networks because they are generative models). This implies that if the payoff of an option is denoted by h , the

∗ corresponding author.

E-mail address: huhjeonggyu@jnu.ac.kr

July 27, 2021


option prices h (x1 , x2 ) can be simulated for a fixed set of parameters. Eventually, the fair price of an option can be
obtained as the discounted mean of the simulated prices, instead of relying on numerical integrations, by employing
a flow-based generative model, the conditional real-valued non-volume preserving transformation (RealNVP) [6], as
the base model for our approach. Notably, this approach is computationally cheaper than the Monte-Carlo simulation
as the random states (x1 , x2 ) are simulated at once, rather than full sample paths Xt |t≤T . Importantly, our model does
not need to generate many random variables sequentially, like the Monte-Carlo simulation.
Traditional approaches for inducing the joint densities include solving the stochastic differential equation (SDE)
or the corresponding Fokker-Plank partial differential equations (PDE) for a given option pricing model (refer to
Øksendal [7] for more information). For example, by solving the SDE for the BS model, it can be shown that
XT follows a normal distribution under the model [8]. Unfortunately, the differential equations can be analytically
solved in only a few models. Notably, the Fokker-Planck equation could be approximated by using deep-learning
techniques as in [9, 10, 11]. These studies used deep learning to solve the Fokker-Planck PDE for a fixed set of
parameters, whereas we train neural networks to learn the densities for a wide range of parameters in this paper.
Furthermore, solving the SDE or PDE is only applicable when the joint density of (XT , YT ) is found. Even with
well-known mathematical skills, it is extremely difficult to derive the required joint densities of MT or AT based on
discrete samples of the log-return process Xt |t≤T . For example, joint densities of MT or AT are intractable even in the
celebrated Heston model.
In this study, we propose a flow-based generative networks to infer the 2D joint density p (x1 , x2 ). Network-based
generative models are classified as generative adversarial network (GAN) [12], variational autoencoder (VAE) [13]
and flow-based generative models. All the three types of generative models take the common view that (x1 , x2 ) is
a complex transformation of a hidden random variable Z = (Z1 , · · · , ZD ). A GAN aims to learn the mechanism to
generate (x1 , x2 ) from Z without using density. Conversely, a VAE attempts to learn the posterior density p ( Z| x1 , x2 )
(precisely speaking, a variational distribution q ( Z| x1 , x2 ) of the posterior) and the likelihood p ( x1 , x2 | Z), thereby
generating new samples with the likelihood. Attractively, flow-based generative networks can focus on learning the
likelihood p ( x1 , x2 | Z) without requiring the introduction of the posterior. Moreover, these networks can provide an
explicit probability density function for the SV models because such networks have interesting structures in which
both the inverses and Jacobians of the weight matrices are explicitly calculated. Therefore, to take advantage of its
attractive property, we select the flow-based generative model as our base model. Large-scale data of (x1 , x2 ) are
prepared by the Monte-Carlo simulation. The flow-based models are then trained using these data. Consequently, the
test results will confirm that pricing exotic options can be significantly accelerated.
To summarize, pricing exotic options is usually considered as a daunting task because of the requirement of
efficient density estimation for an option pricing model. Nevertheless, in this study, the computational time can be
significantly reduced by developing flow-based generative networks that infer the densities. Additionally, to the best
of our knowledge, this study is the first work to find the joint densities on the random states derived from Xt |t≤T , such
as MT or AT .
The remainder of the paper is organized as follows. The next section briefly describes one of the flow-based
networks, conditional RealNVP. In Section 3, we examine the extent to which these networks learn several joint
densities for two SV models. In Section 4, various exotic options are priced using these well-trained networks, and
the results are compared with those obtained from the Monte-Carlo simulation. Finally, Section 5 concludes the paper.

2. Conditional RealNVP

Let I denote an index set {1, 2, · · · , D}. We decompose I into two disjoint sets, I1:d with the size of d and Id+1:D
with the size of (D − d). In addition, indices of each set are selected based on a certain policy. Let x be partitioned
conformably into x1:d and xd+1:D where x1:d indicates a d-dimensional vector whose component indices correspond to
I1:d . For example, if d = 2, D = 4, I1:2 = {1, 3} and x = (x1 , x2 , x3 , x4 ), then x1:2 = (x1 , x3 ). The i-th coupling layer
f (i) : RD → RD is given by y = f (i) (x) such that y1:d and yd+1:D are defined by
 
y1:d = x1:d , yd+1:D = xd+1:D exp s(i) (x1:d ) + t(i) (x1:d ), (2.1)

2
Figure 1: Structure of the i-th coupling layer of conditional RealNVP

where scale function s(i) and translation function t(i) are both functions from Rd to RD−d , and is an elementwise
product. We designate I1:d at the i-th coupling layer by the parity of i to alternate I1:d at each coupling layer. Here,
scale functions s and translation functions t are replaced by deep neural networks. The normalizing flow f composed
of f = f (c) ◦ f (c−1) ◦ · · · ◦ f (1) is called RealNV P. There are additional strategies to reduce the computational cost
and improve performance, such as multi-scale architecture or masked convolution in RealNVP. However, because
the design of the original structure is specialized for image data and data used for our experiments are relatively
low-dimensional, the structure described in Section 2 is used for our research. For the full structure of the original
RealNVP, refer to Dinh et al. [6].
The affine structure of RealNVP shows two noteworthy properties. First, the determinant of Jacobian matrix of
the transformation is computable. Consequently, we can obtain the exact density function p X of input data for a given
prior density p Z of output through the change of variables formula. Indeed, the relationship of density functions of
the input x and the output z = f (x) is given by
c
∂ f (x)
! Y   
p X (x) = p Z ( f (x)) det = p Z ( f (x)) det f (i) x(i)
∂x T
i=1
c
D−d  (2.2)
Y X   
= p Z ( f (x)) exp  
 s x1:d ,
(i) (i) 

j
i=1 j=1
 
where x(i) B f (i−1) ◦ · · · ◦ f (1) (x). The second property that arises from the affine structure is invertibility. For a
given output y of the i-th coupling layer f (i) , the output x of the inverse transformation of f (i) is derived by
   
x1:d = y1:d , xd+1:D = yd+1:D − t(i) (x1:d ) exp −s(i) (x1:d ) . (2.3)

We choose the standard Gaussian distribution for the prior distribution p Z for simplicity. We can then generate samples
of the target distribution with only one standard Gaussian variable of the same dimension through (2.3).
Let η be a set of stochastic volatility model parameters determining the target distribution. In this study, we insert
η into the input of the functions s and t. Specifically, let s̃ and t˜ be functions from Rd × R|η| to RD−d whose input
variable is composed of x1:d and η, and f˜(i) (x|η) be a function from RD to RD defined similarly to (2.1) as
 
y1:d = x1:d , yd+1:D = xd+1:D exp s̃(i) (x1:d ; η) + t˜(i) (x1:d ; η).

The ˜
 structure of the i-th  coupling layer is shown in Figure 1. We call the stack of modified coupling layers f (x|η) B
˜f (c) ◦ · · · ◦ f˜(2) ◦ f˜(1) (x|η) the conditional RealNVP (CRealNVP) and use it to find density functions for stochastic
volatility models. For the remainder of this study, we denote the CRealNVP by f instead of f˜.
3
3. Experiments

3.1. Data and procedures


Two stochastic volatility models are used for experiments: the Heston model [2] and the exponential Ornstein-
Uhlenbeck model [14]. The Heston model is one of the most popular stochastic volatility models whose stochastic
differential equations are given by !
1
dXt = r − Yt dt + Yt dWtx ,
p
2 (3.1)
dYt = κ (θ − Yt ) dt + ξ Yt dWty ,
p

where Xt is log return of underlying asset and Yt is its variance process. W x and W y are correlated Brownian motions
with the correlation coefficient ρ, and r, κ, θ and ξ are constants. The Heston model reflects the mean reverting property
of volatility in stock markets and captures the volatility smile when volatility surfaces are constructed. Furthermore,
the semi-closed formulas of the density function for the return process XT and vanilla option prices are obtained by
means of the Fourier transform. The Milstein discretization scheme [15] is used for generating sample paths with the
condition 4κθ > ξ2 to prevent the variance process from intruding negative values. The Milstein method is preferred
over the Euler scheme with the Feller condition since the Feller condition is not typically satisfied in practice and the
computational cost of the Milstein method is no more expensive than the Euler discretization. See [16, 2] for more
concrete descriptions of the Heston model. On the other hand, the exponential Ornstein-Uhlenbeck model dynamics
is given by !
1 2 2Yt
dXt = r − m e dt + meYt dWtx ,
2 (3.2)
dYt =α (γ − Yt ) dt + kWty ,
where r, m, α, γ and k are constants. The ExpOU model reflects the market feature in that log volatilities of stock
market returns are normally distributed [17], in addition to the mean reverting property of volatility. The Euler
discretization method is used to generate samples paths for the ExpOU model. For both SV models, we store four
kinds of processes: the return process XT , the volatility-driving process YT , the maximum process MT , and the average
process AT . Specifically, MT is the discretely monitored maximum process of X, and AT is the arithmetic average of
X defined by
N
1 X
MT = max Xti , AT = Xt , (3.3)
1≤i≤N N i=1 i

N
respectively, where {ti }i=0 is the set of equally spaced time instants over [0, T ]. 1/250 is chosen for the interval size,
ti+1 − ti , because payoff of most financial derivatives is determined by daily closing price and there are approximately
250 trading days per year.
The set of stochastic volatility model parameters mentioned in Section 2 is set by η = (r, κ, θ, ξ, ρ, Y0 , T ) for the
Heston model and η = (r, m, α, γ, k, ρ, Y0 , T ) for the ExpOU model. The training datasets are generated through the
following procedure:
1. Generate a SV model parameter set η0 through the distributions listed in Table 1.
2. Generate 210 sample paths of (XT , YT , MT , AT ) with time intervals dt B (ti+1 − ti )/4 = 0.001.
3. Compute the mean and the variance of the annualized log returns: XT /T .
4. If the magnitude of the mean is less than 0.3 and the variance is less than 1, store (XT , YT , MT , AT ). Else go to
step 1.

We generate 100 × 216 sets of SV model parameters and allocate 97.5% of data for training and the rest for validation.
Thus, 6.5 billions of samples of SV model are fed to neural networks for training per epoch. SV model parameters
are normalized by the minmax normalization for beta and uniform distributions and standardization for normal distri-
butions. Implausible combinations of SV model parameters, which are rarely observed in stock indices, are filtered

4
Heston r κ θ ξ ρ Y0 T
Distribution U(0, 0.1) Beta(2, 18) × 20 Beta(1, 19) U(0.1, 1) U(−1, 0) Beta(1, 19) U(0.1, 3)

ExpOU r m α γ k ρ Y0 T
2 2
Distribution U(0, 0.1) Beta(4, 16) U(0, 100) N(0, 0.3 ) U(0, 1) U(−1, 0) N(0, 0.3 ) U(0.1, 3)

Table 1: The distributions of stochastic volatility model parameters for generating training datasets are listed. U(a, b) stands for a uniform
distribution on the interval [a, b], Beta(α, β) for a beta distribution with shape parameters α and β and N(m, σ2 ) for a normal distribution with mean
m and variance σ2 .

in step 4, and approximately 0.15% of datasets are regenerated. In our experiments, the dimension of input variables
D is 2 and input pairs of neural networks are chosen to (XT , YT ), (XT , MT ), and (XT , AT ) for each SV model. After
training, we exploit bivariate joint density functions to compute option prices. Two dimensional histograms of input
variables are presented in Figure 2.

(a) Heston model

(b) ExpOU model

Figure 2: Two dimensional histograms of (XT , YT ), (XT , MT ), and (XT , AT ) are presented from the left. Figure 2(a) and Figure 2(b) are of the
Heston model and the ExpOU model, respectively

We use the same neural network architectures for both stochastic volatility models, except for one factor. Hyper-
bolic tangent hidden units multiplied by 3 for s and leaky rectified hidden units for t are used in both SV models.
Leaky slope for t is chosen to be 0.5 for the Heston model and 0.3 for the ExpOU model, which is the only difference
in the architecture. The CRealNVP consists of six coupling layers and four hidden layers with 100 hidden nodes at
5
each coupling layer for both s and t. Based on the exact likelihood formula (2.2), the weights and biases of neural
networks are adjusted to minimize the negative log likelihood with the Adam optimizer [18]. We train neural net-
works for two epochs with learning rate 10−5 and one epoch with 10−6 for all pairs, except (XT , MT ) of the Heston
model, in which two additional epochs with learning rate 10−6 are added. Seven hours are taken for training each pair
with a graphics processing unit (GPU) NVIDIA GeForce RTX 2080 Super. Because the size of training the dataset
is adequately large, training for three or five epochs will be sufficient to replicate the SV model random variables.
Although we anticipate that more abundant epochs might improve the accuracy, the numbers of epochs are restricted
due to the lack of computing power of our GPU.

3.2. Pretraining via batch normalization


Batch normalization [19] (BN) is used to reduce internal covariate shifts in common. We use the batch normaliza-
tion for each hidden layer but in a different way. Since we train the CRealNVP with hundreds of SV model parameter
sets at one mini-batch and different SV model parameters generate different scales of samples, the general usage of
BN disrupts the whole training process. Moreover, a precipitous part of the distributions of SV models observed in
the first and second figures of Figure 2(a) and the second figure of Figure 2(b) interrupts the training. Because the
normal distribution has no such a structure, the border line of the precipice in SV models gives rise to difficulty when
training the transformation into a normal distribution. Without BN, the density values near the border line remain large
even after passing through the transformation, and it leads to poorly trained neural networks as shown in Figure 3(a).
Figure 3(a) describes two dimensional histograms of (z1 , z2 ) = f (XT , YT ) for the Heston model in the progression of
training without BN. Note that (z1 , z2 ) is expected to be normally distributed. The left three columns describe the
output (z1 , z2 ) when 5%, 10% and 20% of the training dataset are used, and the rightmost column describes the output
(z1 , z2 ) of the completely trained transformation.

(a) Without BN

(b) With BN pretraining

Figure 3: Two dimensional histograms of (z1 , z2 ) = f (XT , YT ) for the Heston model in the progression of training without and with BN pretraining
are given in Figure 3(a) and Figure 3(b), respectively. The left three columns describe the output (z1 , z2 ) when 5%, 10% and 20% of the training
dataset are used. The rightmost column describes the output (z1 , z2 ) of the completely trained transformation.

To cope with these problems, we add BN layers to neural networks and temporarily train network parameters
and BN parameters at the scratch of training to crumple the border line. And we stop adjusting the BN parameters
6
and use them as trained so far. The border line is then curved and the border curve fades out as seen in Figure 3(b).
Figure 3(b) shows histograms of (z1 , z2 ) = f (XT , YT ) for the Heston model in the progression of training with BN
pretraining. Progression at each column of Figure 3(b) corresponds to that of Figure 3(a). In our experiments, we
train BN parameters at the commencement of training for 5% of the total dataset in the first epoch and exploit the
pretrained BN parameters for the rest.

3.3. Results
For the convenience of description, we recall that f is a CRealNVP with f (x) = z, where x is an input variable
indicating a D-dimensional SV model variable, and z is an output which we expect to be normally distributed in
D-dimension. Let z̃ denote an actual normal random variable and x̃ B f −1 (z̃) derived from (2.3). If f is well-trained
as a generative model, output of the inverse transformation of normal random variable, x̃, is analogously distributed
to SV model variable x. Moreover, if f is well-trained as a density estimator, the density function derived in (2.2) is
similar to the distribution of the SV model random variable x. For x = (XT , YT ) of the Heston model, two dimensional
histograms of x and x̃ and the derived density function of x̃ are illustrated in Figure 4. The visually indistinguishable
figures demonstrate that the CRealNVP is well-trained as both of a generator and a density estimator.

(a) Histogram of x (b) Histogram of x̃ (c) Density function of x̃

Figure 4: For x = (XT , YT ) of the Heston model with the SV model parameters used in Figure 2, the histogram of x is depicted in Figure 4(a), the
histogram of x̃ in Figure 4(b) and the density function of x̃ in Figure 4(c).

3.3.1. Statistical analysis


A diagnostics for determining whether the distribution of x̃ fits to the target distribution includes observing the dis-
tribution of z [20]. Since we have few instruments for assessing the goodness-of-fit in the unknown target distribution,
we conduct statistical tests in the well-known normal distribution. The Henze-Zirkler (HZ) test [21], which possesses
good power for testing multivariate normality [22], is used to determine whether z is normally distributed. Precisely,
a thousand samples are generated per SV model parameter set η, and 1,000 SV model parameter sets are randomly
chosen by Table 1 to derive 1,000 p-values of the HZ test. The empirical proportions of rejected null hypotheses at a
5% significance level are listed in Table 2 for comparison with the type I error given in Farrell et al. [22]. We regard

Heston ExpOU
Process
(XT , YT ) (XT , AT ) (XT , MT ) (XT , YT ) (XT , AT ) (XT , MT )
Proportion of rejection 0.063 0.068 0.352 0.069 0.059 0.242

Table 2: The proportions of the HZ test p-values less than 0.05 are listed for each pair of the processes.

7
the CRealNVP as well-trained to approximate the target density for the pairs (XT , YT ) and (XT , AT ) in both SV models
given that (a) the empirical type I error of tests for normality at significance level 5% is approximately 0.05 [22] and
(b) the proportions of p-values less than 0.05 are nearly 0.05.
In the case of the pair (XT , MT ) for both SV models, it might seem that the proportions of rejected null hypotheses
are too large to be considered as well-trained. This is because the multicollinear input data seen in the figures at
the middle of Figure 2 and the independent Gaussian output of the same dimension cause a problem when building
an invertible transformation. Thus, in the case of (XT , MT ), we assess the goodness-of-fit in the target distribution.
Here, we use the multidimensional Kolmogorov-Smirnov (KS) test [23]. Notably, the type I error rate of the KS
test at a significance level α varies according to the shape of distributions or the sample size. For example, the type
I error at a significance level of 5% is approximately 0.05 in the case of a normal distribution with a small sample
size, whereas it exceeds 0.99 in the case of the exponential distribution with a large sample size [24]. Thus, since we
cannot surmise the plausible proportions of rejected null hypotheses, we compare the rejection proportions of the KS
test for (XT , MT ) with those for (XT , YT ) and (XT , AT ). The proportions of p-values for the KS test less than 0.05 are
presented in Table 3. In addition, the figures of histograms and densities for (XT , MT ) of both SV models are provided
in Figure 5 for visual aid. Specifically, for x = (XT , MT ), the histogram of x is described in the left column of Figure 5,
the histogram of x̃ in the middle column and the density of x̃ in the right column. Figure 5(a) and Figure 5(b) are
of the Heston model and the ExpOU model, respectively. We conclude that the distribution of samples of (XT , MT )
generated by the CRealNVP is similar to the target distribution because the empirical results of (XT , MT ) are similar
or better in comparison to the results of (XT , YT ) or (XT , AT ).

Heston ExpOU
Process
(XT , YT ) (XT , AT ) (XT , MT ) (XT , YT ) (XT , AT ) (XT , MT )
Proportion of rejection 0.087 0.076 0.085 0.12 0.089 0.087

Table 3: The proportions of the KS test p-values less than 0.05 are listed for each pair of the processes.

3.3.2. Computation time


We compare the time taken for generating stochastic volatility model samples with the CRealNVP and a dis-
cretization scheme. The experiment is performed by measuring the time taken for generating one million samples of
the Heston model with various maturities, and the result is described in Table 4. As shown, the CRealNVP generates
samples within a constant time regardless of the maturity whereas the time taken for generating samples using the
discretization scheme increase in proportion to T . This is because only one D dimensional Gaussian random variable
is needed to generate a sample of stochastic volatility models for the CRealNVP. In addition, the generating speed
of the CRealNVP is incomparably faster than the discretization method as the generating time of the CRealNVP is
approximately 1/450 of that of the discretization method for T = 3. The experiment demonstrates that the CRealNVP
serves also as an efficient generator.

T(year) 0.25 0.5 1 1.5 2 3


Discretization 15.823 31.480 62.686 94.355 124.720 186.553
CRealNVP 0.432 0.436 0.430 0.433 0.447 0.431

Table 4: The time (given in seconds) taken for generating one million samples of the Heston model with the Milstein discretization and the
CRealNVP are listed.

4. Option pricing

Option price can be expressed as the expectation of a given payoff function h given by
V(X) = e−rT E X [h(X)],
8
(a) Heston (XT , MT )

(b) ExpOU (XT , MT )

Figure 5: For x = (XT , MT ), the histograms of x, the histograms of x̃ and the density of x̃ are depicted from the left for each SV model with the SV
model parameters used in Figure 2. Figure 5(a) and Figure 5(b) are of the Heston model and the ExpOU model, respectively.

where r is the risk-neutral interest rate, T is the maturity, and X depends on the type of option. We present two
methods for computing expectations: integration with density function and Monte-Carlo simulation. The expectation
of a function of random variable can be written in terms of integral by
Z
E X [h(X)] = h(x)p X (x)dx. (4.1)

This can also be viewed as the law of the unconscious statistician (LOTUS). We compute the integral with a well-
known prior distribution using the inverse transformation of the CRealNVP as given below:
h  i h i Z
E X [h(X)] = E Z h f −1 (Z) = E Z h̃(Z) = h̃(z)p Z (z)d z (4.2)

where h̃ B h◦ f −1 and pZ is the standard normal distribution. Notably, the LOTUS is applied again and the CRealNVP
is exploited as a density estimator. The option price can also be computed using (4.1), but it is difficult to find an
appropriate integral range and a numerical integration method since the shape of p X (x) varies with the SV model
parameter. Conversely, there are advanced quadrature methods for integration with normal distribution which lead to
stable integration results. Thus, we compute the integral using (4.2).
Monte-Carlo simulation is an estimation method for calculating the expectation by averaging function values of
independent and identically distributed random samples. That is, we estimate an option price with the arithmetic mean

9
of payoff function values of SV model samples as given below:
N
1 X
E X [h(X)] = h (xi ) , (4.3)
N i=1

where {xi }i=1,2,··· ,N is a set of independent and identically distributed samples of X. Similar to the integration with
density function, we modify (4.3) with the CRealNVP inverse transformation as given below:

h  i 1 XN   1 X N   1 X N
E X [h(X)] = E Z h f −1 (Z) = h f −1 (zi ) ' h f −1 ( z̃i ) = h( x̃i ). (4.4)
N i=1 N i=1 N i=1

Recall that zi = f (xi ) and z̃i is a random variable sampled from the standard normal distribution. The last term of (4.4)
PN
can substitute the naive Monte-Carlo method and we compute option price with N1 i=1 h( x̃i ). Note that the CRealNVP
is used as a generator. While the naive Monte-Carlo method needs a full path of process over [0, T ] per sample, the
Monte-Carlo method with CRealNVP requires only one same dimensional Gaussian random variable. Consequently,
computational time is reduced when using the Monte-Carlo with CRealNVP.
We briefly review four kinds of options: call, barrier, lookback and Asian options. All these options depend on the
terminal log return XT and the last three options are path-dependent exotic options. A vanilla call option is a financial
instrument that grants certain rights to the buyer. If an underlying asset price exceeds a certain strike value at maturity,
the buyer receives the right to buy the underlying asset at the strike. The profit from reselling the asset immediately
after the exercise is called the payoff and the payoff function of the call option is given by
 +  
h (X) = h (XT ) B S 0 eXT − K = max S 0 eXT − K, 0 ,

where S 0 is the initial underlying asset price and K is the strike. A barrier option is one whose payoff is determined
by whether the maximum or minimum of the underlying asset over a certain period hits the barrier level B. There are
several types of barrier options: up-and-in, down-and-in, up-and-out and down-and-out. Up or down barrier options
are distinguished according to whether the barrier level is higher or lower than the initial underlying asset price.
Terminal payoff of knock-out option is the same as the vanilla option payoff if the underlying asset has never hit the
barrier level until its maturity. Contrarily, knock-in option payoff becomes vanilla option payoff when the underlying
asset touches the barrier level. For example, the terminal payoff of an up-and-in barrier call option is equal to a call
option payoff if the underlying asset has touched the barrier level at least once, and zero otherwise. We select an
up-and-in barrier call option for the experiment and its payoff function is given by
 +
h(X) = h(XT , MT ) = S 0 eXT − K 1{S 0 eMT >B} .

A lookback option is another exotic option affected by the maximum or minimum of the underlying asset. It is
classified based on whether the strike is fixed or floating. A payoff of fixed-strike option is the difference between the
maximum or minimum value of the underlying asset and fixed strike. For the floating-strike option, the maximum or
minimum value of the underlying asset replaces the strike in vanilla put or call option. For example, a floating-strike
lookback put option payoff is the difference between the maximum and the terminal value of the underlying asset
price. A floating-strike lookback put option is chosen for experiment and its payoff function is given by
 +
h(X) = h(XT , MT ) = S 0 e MT − eXT .

An Asian option depends on the average value of the underlying asset over a given period. For two typical averaging
methods—geometric average and arithmetic average, we only consider Asian options with a geometric average. A
payoff formula of an Asian option is analogous to that of a lookback option, except that the maximum or minimum
value is replaced with an average value. For instance, a floating-strike Asian call option payoff is given by
 +
h(X) = h(XT , AT ) = S 0 eXT − eAT .

We use these four types of exotic options for our experiment.


10
4.1. Accuracy and efficiency
We compare option prices derived by the CRealNVP with naive Monte-Carlo simulations. To estimate the integral
(4.2), we use the Gauss-Hermite quadrature [25] which is a widely-used Gaussian quadrature for the integral of the
form Z  
g(x) exp −x2 dx.

Grid points for the quadrature are zeros of the m-th order Hermite polynomial and we choose m = 15. However,
the Gauss-Hermite quadrature uses grid points near ±8 for the standard normal distribution. Since the CRealNVP
is not sufficiently trained on rarely sampled points, the outliers may cause problems in computing the integral using
quadrature. To prevent the blow-up, implausible values such as an infinity are replaced with zero.
Experiments are performed with η = (r, κ, θ, ξ, ρ, Y0 , T ) = (0.03, 2, 0.05, 0.5, −0.7, 0.05, 1.5) for the Heston model
and η = (r, m, α, γ, k, ρ, Y0 , T ) = (0.03, 0.2, 50, 0, 0.5, −0.7, 0.05, 1.5) for the ExpOU model. Up-and-in call barrier
options, floating-strike put lookback options, and floating-strike call Asian options are used with the following set-up:
S 0 = 1 for all options, barrier = 1.1 for barrier options and strike = 1 for call and barrier options. Call option prices
can be derived by the CRealNVP trained with any pair of the process and we choose (XT , YT ). Price of barrier options
and lookback options are obtained by (XT , MT ) and price of Asian options is obtained by (XT , AT ). We estimate 10
times for each option price with the numbers of simulations, ranging from 1,000 to 100,000 and compute their mean
and standard deviation. The results are described in Table 5. Both Monte-Carlo methods are affected by the number
of samples, and option prices oscillate. The standard deviations of CRealNVP Monte-Carlo are similar to those of
the naive Monte-Carlo for each number of simulations. And decaying rates of standard deviation with respect to the
number of simulations for naive Monte-Carlo and CRealNVP Monte-Carlo are similar. Most of the relative differences

Option Heston ExpOU


Type 1,000 10,000 100,000 1,000 10,000 100,000
0.131952 0.130979 0.130211 0.123893 0.124318 0.124841
NMC
(0.003619) (0.001373) (0.000282) (0.005836) (0.001134) (0.000487)
Call
0.130986 0.129967 0.129945 0.122766 0.124699 0.125253
CMC
(0.004889) (0.001410) (0.000377) (0.006350) (0.001080) (0.000566)
CIN 0.129718 0.125849
0.127838 0.129198 0.128474 0.121447 0.123624 0.123624
NMC
(0.006608) (0.001087) (0.000432) (0.005950) (0.002115) (0.000504)
Barrier
0.128465 0.128475 0.129064 0.126522 0.124372 0.123901
CMC
(0.005026) (0.000797) (0.000533) (0.004983) (0.000993) (0.000342)
CIN 0.127284 0.123238
0.163298 0.161467 0.161475 0.187393 0.183987 0.184218
NMC
(0.004608) (0.001324) (0.000376) (0.003703) (0.000998) (0.000343)
Lookback
0.163676 0.160937 0.162218 0.185449 0.185244 0.184577
CMC
(0.005927) (0.001357) (0.000450) (0.004475) (0.001833) (0.000475)
CIN 0.162990 0.184092
0.045538 0.045292 0.045156 0.044365 0.045108 0.045134
NMC
(0.002627) (0.000908) (0.000234) (0.002189) (0.000317) (0.000221)
Asian
0.043975 0.044815 0.044981 0.043917 0.044819 0.044948
CMC
(0.002649) (0.000800) (0.000205) (0.001656) (0.000764) (0.000158)
CIN 0.044672 0.044883

Table 5: Various option prices are listed with respect to the option type, method, model and the number of simulations. NMC, CMC and CIN
stand for the naive Monte-Carlo, the CRealNVP Monte-Carlo and the CRealNVP integral, respectively. For the Monte-Carlo simulations, mean
and standard deviation (std) of 10 samples of option prices are written in the form of mean(std).

11
of naive Monte-Carlo and CRealNVP Monte-Carlo are less than 1% for the number of samples larger than or equal
to 10,000. For CRealNVP integral, compared to naive Monte-Carlo with 100,000 simulations, the relative differences
are less than 1%, which is within the quadrature error.
Comparisons of the computation time are illustrated in Table 6. The CRealNVP Monte-Carlo and integral compute
option prices faster than the naive Monte-Carlo as shown. When compared in 100,000 simulations, the CRealNVP
Monte-Carlo and CRealNVP integral are 30 times and 200 times faster than the naive Monte-Carlo, respectively.
In addition, the computation time of CRealNVP Monte-Carlo with 10,000 remains similar to that with 1,000 and
jumps at 100,000 whereas the computation time for the naive Monte-Carlo increases in proportion to the number of
simulations. This is a consequence of GPU parallel computing used to price option values with the CRealNVP. The
computation times of the CRealNVP integral with 152 grid points and the CRealNVP Monte-Carlo with the sample
sizes 1,000 and 10,000 are similar since option prices are computed in parallel at once, up to a certain size. The
CRealNVP Monte-Carlo with the sample size 100,000 exceeds the size which the GPU used in the experiment can
handle at once, and takes more time.

Option Heston ExpOU


Type 1,000 10,000 100,000 1,000 10,000 100,000
NMC 0.01495 0.09935 0.94379 0.01706 0.12460 1.19810
Call CMC 0.00563 0.00626 0.04068 0.00566 0.00636 0.04083
CIN 0.00574 0.00575
NMC 0.01490 0.09946 0.94380 0.01667 0.12231 1.17663
Barrier CMC 0.00570 0.00635 0.04051 0.00569 0.00663 0.04147
CIN 0.00575 0.00577
NMC 0.01494 0.09947 0.94300 0.01673 0.12237 1.19825
Lookback CMC 0.00564 0.00629 0.04098 0.00568 0.00636 0.04094
CIN 0.00576 0.00572
NMC 0.01493 0.09947 0.94306 0.01705 0.12470 1.19789
Asian CMC 0.00563 0.00629 0.04049 0.00570 0.00638 0.04100
CIN 0.00574 0.00583

Table 6: The computation time (given in seconds) for various option prices are listed with respect to the option type, method, model and the number
of simulations. NMC, CMC and CIN stand for the naive Monte-Carlo, the CRealNVP Monte-Carlo and the CRealNVP integral, respectively.

5. Conclusion

In this study, we take full advantage of a flow-based generative model to significantly reduce the computational
time for pricing exotic options. The flow-based networks are used to learn large-scale simulated random states based
on two SV models: the Heston and ExpOU models. Thus, the network implicitly learns multiple joint densities over
different sets of parameters. Some widely accepted statistical tests prove the goodness-of-fit for the output of the
networks. This shows that the networks are well-trained to accurately approximate the joint density functions of the
SV models. We can simulate option prices for a given set of parameters owing to the networks and get a fair option
value as the discounted mean of the simulated prices for the SV models. We compare the option prices derived by the
flow-based networks with those obtained by the naive Monte-Carlo simulation in terms of the accuracy and time cost
to demonstrate the superior performance of our methods. Furthermore, these networks provide explicit probability
density functions for the SV models due to the unique advantage of the flow-based model.
Our methods can be widely applied to a variety of exotic options, including barrier, lookback and Asian options
as demonstrated in this paper. However, the methods may be inappropriate for very complex derivatives such as an
equity-linked-securities (ELS), since they require too many random states to be priced. For the evaluation of these

12
exotic options, it would be desirable to generate random paths of a SV model rather than random states. This topic
requires in-depth research in future studies.

Acknowledgment

Jeonggyu Huh received financial support from the National Research Foundation of Korea (Grant No. NRF-
2019R1F1A1058352). This study was the result of a study on the “HPC Support” Project, supported by the ‘Ministry
of Science and ICT’ and NIPA of Korea. Jeong-Hoon Kim was supported by the National Research Foundation of
Korea NRF2021R1A2C1004080.

References
[1] P. Wilmott, Paul Wilmott on quantitative finance, John Wiley & Sons, 2013.
[2] S. L. Heston, A closed-form solution for options with stochastic volatility with applications to bond and currency options, The Review of
Financial Studies 6 (1993) 327–343.
[3] D. B. Nelson, Conditional heteroskedasticity in asset returns: A new approach, Econometrica: Journal of the Econometric Society (1991)
347–370.
[4] L. O. Scott, Option pricing when the variance changes randomly: Theory, estimation, and an application, Journal of Financial and Quantitative
analysis 22 (1987) 419–438.
[5] F. Black, M. Scholes, The pricing of options and corporate liabilities, in: World Scientific Reference on Contingent Claims Analysis in
Corporate Finance: Volume 1: Foundations of CCA and Equity Valuation, World Scientific, 2019, pp. 3–21.
[6] L. Dinh, J. Sohl-Dickstein, S. Bengio, Density estimation using RealNVP, arXiv preprint arXiv:1605.08803 (2016).
[7] B. Øksendal, Stochastic differential equations, in: Stochastic differential equations, Springer, 2003, pp. 65–84.
[8] S. E. Shreve, Stochastic calculus for finance II: Continuous-time models, volume 11, Springer Science & Business Media, 2004.
[9] C. Beck, S. Becker, P. Grohs, N. Jaafari, A. Jentzen, Solving stochastic differential equations and Kolmogorov equations by means of deep
learning, arXiv preprint arXiv:1806.00421 (2018).
[10] Y. Xu, H. Zhang, Y. Li, K. Zhou, Q. Liu, J. Kurths, Solving Fokker-Planck equation using deep learning, Chaos: An Interdisciplinary Journal
of Nonlinear Science 30 (2020) 013133.
[11] J. Zhai, M. Dobson, Y. Li, A deep learning method for solving Fokker-Planck equations, arXiv preprint arXiv:2012.10696 (2020).
[12] I. J. Goodfellow, J. Pouget-Abadie, M. Mirza, B. Xu, D. Warde-Farley, S. Ozair, A. Courville, Y. Bengio, Generative adversarial networks,
arXiv preprint arXiv:1406.2661 (2014).
[13] D. P. Kingma, M. Welling, Auto-encoding variational bayes, arXiv preprint arXiv:1312.6114 (2013).
[14] J.-P. Fouque, G. Papanicolaou, K. R. Sircar, Mean-reverting stochastic volatility, International Journal of Theoretical and Applied Finance 3
(2000) 101–142.
[15] G. Mil’shtejn, Approximate integration of stochastic differential equations, Theory of Probability & Its Applications 19 (1975) 557–562.
[16] J. Gatheral, The volatility surface: a practitioner’s guide, volume 357, John Wiley & Sons, 2011.
[17] T. G. Andersen, T. Bollerslev, F. X. Diebold, H. Ebens, The distribution of realized stock return volatility, Journal of Financial Economics
61 (2001) 43–76.
[18] D. P. Kingma, J. Ba, Adam: A method for stochastic optimization, arXiv preprint arXiv:1412.6980 (2014).
[19] S. Ioffe, C. Szegedy, Batch normalization: Accelerating deep network training by reducing internal covariate shift, in: International confer-
ence on machine learning, PMLR, 2015, pp. 448–456.
[20] G. Papamakarios, T. Pavlakou, I. Murray, Masked autoregressive flow for density estimation, arXiv preprint arXiv:1705.07057 (2017).
[21] N. Henze, B. Zirkler, A class of invariant consistent tests for multivariate normality, Communications in Statistics-Theory and Methods 19
(1990) 3595–3617.
[22] P. J. Farrell, M. Salibian-Barrera, K. Naczk, On tests for multivariate normality and associated simulation studies, Journal of Statistical
Computation and Simulation 77 (2007) 1065–1080.
[23] G. Fasano, A. Franceschini, A multidimensional version of the Kolmogorov–Smirnov test, Monthly Notices of the Royal Astronomical
Society 225 (1987) 155–170.
[24] M. Mendes, A. Pala, Type I error rate and power of three normality tests, Pakistan Journal of Information and Technology 2 (2003) 135–139.
[25] Q. Liu, D. A. Pierce, A note on Gauss—Hermite quadrature, Biometrika 81 (1994) 624–629.

13

View publication stats

You might also like