Solution of Ruin Probability for Continuous Time Model Based on Block Trigonometric Exponential Neural Network

: The ruin probability is used to determine the overall operating risk of an insurance company. Modeling risks through the characteristics of the historical data of an insurance business, such as premium income, dividends and reinvestments, can usually produce an integral di ﬀ erential equation that is satisﬁed by the ruin probability. However, the distribution function of the claim inter-arrival times is more complicated, which makes it di ﬃ cult to ﬁnd an analytical solution of the ruin probability. Therefore, based on the principles of artiﬁcial intelligence and machine learning, we propose a novel numerical method for solving the ruin probability equation. The initial asset u is used as the input vector and the ruin probability as the only output. A trigonometric exponential function is proposed as the projection mapping in the hidden layer, then a block trigonometric exponential neural network (BTENN) model with a symmetrical structure is established. Trial solution is set to meet the initial value condition, simultaneously, connection weights are optimized by solving a linear system using the extreme learning machine (ELM) algorithm. Three numerical experiments were carried out by Python. The results show that the BTENN model can obtain the approximate solution of the ruin probability under the classical risk model and the Erlang(2) risk model at any time point. Comparing with existing methods such as Legendre neural networks (LNN) and trigonometric neural networks (TNN), the proposed BTENN model has a higher stability and lower deviation, which proves that it is feasible and superior to use a BTENN model to estimate the ruin probability.


Introduction
In order to help policyholders avoid risks, insurance companies bear all losses for risky buyers [1], which makes insurance companies accumulate a lot of risks themselves [2]. Insurance companies will face austere challenges and tribulations when large claims or a large number of small claims occur in a short period of time [3]. In fact, policyholders focus on the solvency of insurance companies [4]. The ruin probability refers to the probability that insurance business income will be lost at a certain moment, and it is an important indicator to measure the operating status of an insurance company [5]. Therefore, the study of the ruin probability has always been the most active subject in the study of risk theory, especially in ruin theory. Accurate calculations of the ruin probability can help insurance 13-inch, Late 2013). Comparing the numerical solutions obtained by the proposed BTENN method with LNN and TNN methods, BTENN method has the advantages of high-precision and stability.
The rest of this study is structured as follows: Section 2 briefly reviews the ELM algorithm. The block trigonometric exponential neural network (BTENN) is proposed in Section 3. Section 4 discusses the methods and details of using the BTENN model to obtain the numerical solution of the ruin probability equation in the case of the classical risk model and the Erlang(2) risk model. Three numerical experiments are conducted in Section 5, which proves the accuracy and reliability of the BTENN model. Finally, conclusions and prospects are given in Section 6.

Extreme Learning Machine Algorithm
As shown in Figure 1. The ELM is an algorithm that is used to optimize the parameters in a single hidden layer feedforward neural network (SLFN). Since it does not require repeated iterations in the calculation process, only the Moore-Penrose generalized inverse of the coefficient matrix is needed to obtain the global optimal solution. Thus, it has the advantages of a fast calculation speed and does not easily overfit. For a given data set with M samples (x i , y i ) M i=1 ∈ R M×(N+1) , where N is the number of features, The output of this single hidden layer network with m hidden neurons can be mathematical represented as follows: where h(x) = [G(a 1 , b 1 , x), G(a 2 , b 2 , x), · · · , G(a m , b m , x)] is the group of activation function which projects the network input x into the m-dimensional feature space. In addition, β = [β 1 , β 2 , · · · , β m ] T is the connection weight between hidden layer and output layer. When the network approximates the given data set without error by ELM algorithm, this means Equation (1) satisfies each data in the given dataset, which can be rewritten as: β i G a i , b i , x j = h x j β = y j j = 1, 2, · · · M, (2) high-precision and stability. The rest of this study is structured as follows: Section 2 briefly reviews the ELM algorithm. The block trigonometric exponential neural network (BTENN) is proposed in Section 3. Section 4 discusses the methods and details of using the BTENN model to obtain the numerical solution of the ruin probability equation in the case of the classical risk model and the Erlang(2) risk model. Three numerical experiments are conducted in Section 5, which proves the accuracy and reliability of the BTENN model. Finally, conclusions and prospects are given in Section 6.

Extreme Learning Machine Algorithm
As shown in Figure 1. The ELM is an algorithm that is used to optimize the parameters in a single hidden layer feedforward neural network (SLFN). Since it does not require repeated iterations in the calculation process, only the Moore-Penrose generalized inverse of the coefficient matrix is needed to obtain the global optimal solution. Thus, it has the advantages of a fast calculation speed and does not easily overfit. For a given data set with M samples ( , ) ∈ ℝ ×( ) , where is the number of features, The output of this single hidden layer network with hidden neurons can be mathematical represented as follows: where ℎ( ) = [ ( , , ), ( , , ), ⋯ , ( , , )] is the group of activation function which projects the network input into the -dimensional feature space. In addition, = [ , , ⋯ , ] is the connection weight between hidden layer and output layer. When the network approximates the given data set without error by ELM algorithm, this means Equation (1) satisfies each data in the given dataset, which can be rewritten as: Equation (2) can be expressed in matrix form, i.e., where,  Equation (2) can be expressed in matrix form, i.e., where, Then the problem of finding the optimal connection weight is transformed into the following optimization problem: Generally, the number of training points M will much bigger than the number of features. Based on the Karush-Kuhn-Tucker (KKT) condition, For any input weight a i and biases b i , ELM algorithm can get the minimum square error of the output through the least square method and it can be represented as where, H T is the Moore-Penrose generalized inverse of matrix H. The steps of the ELM algorithm are composed of three parts: Step 1. Randomly initialized parameters in the hidden layer; Step 2. Calculate the output matrix of the hidden layer; Step 3. Obtain the output weight β by least square method.

Block Trigonometric Exponential Neural Network
In this study, a single hidden layer feedforward neural network (SLFN) model is established. The block trigonometric exponential function neural network (BTENN) is a special case of SLFN, which has an input node x and one output layer. We propose a novel trigonometric exponential expansion to replace the activation function of the hidden layer (generally a Gaussian function or the Legendre polynomials). The unique hidden layer consists of two parts. The first part uses the cosine exponential function as the basis function, and the other part implements the superposition of the sine exponential function. The input vector x is projected into a high-dimensional feature space using the proposed trigonometric exponential basis function, where cosine exponential basis functions and sine exponential basis functions are denoted as G c (x) and G s (x), respectively. Two sets of basis functions are symmetrical to each other. These nonlinear basis functions ensure that the BTENN has the ability to fit complex ruin probabilities. The general form of the trigonometric exponential basis function can be written as follows: Consider an input vector x = (x 1 , x 2 , · · · , x m ), of whose dimension is m. The coordinates projected by trigonometric exponential functions in a hidden layer can be calculated as: Symmetry 2020, 12, 876 5 of 20 where N is the number of hidden neurons. In the BTENN, N is always an even number. A schematic diagram of a block trigonometric exponential function neural network is given in Figure 2. Linearly combined with appropriate coefficients α i , the output of the BTENN can be calculated as: Symmetry 2020, 12, 876 5 of 19 Figure 2. Structure of a block trigonometric exponential neural network.

Remark 1. Convergence theorem
We claim that the output of the block trigonometric exponential neural network can converge to any continuous function ψ(x).
Proof. let L 2 (R) be a Hilbert space and G n,c (x) = (1 − cos x) 2 e − kx n , G n,s (x) = (1 − sin x) 2 e − kx n . where, G n,c (x) and G n,s (x) form a pair basis in L 2 (R).
Let U(x) = N i=1 α i , G i (x) be the output of block trigonometric exponential neural networks, where ·, · represents the inner product, and That is, Here, we denote the sequence of partial sums of Hence, S m and S n represent the arbitrary partial sums with m ≥ n > 0, we need to prove that S i is a Cauchy sequence. Considering that S n = n i α i , G i (x) and S m = m i α i , G i (x) , in this case, we can get: where As m, n → ∞ in Equation (13), we have S m − S n 2 → 0 . This means S i is a Cauchy sequence in Hilbert space L 2 (R) and it converges to: Thus, the BTENN can approximate an unknown continuous function with arbitrary precision, as the number of hidden layer neurons N approaches to infinity.

The BTENN Model for the Ruin Probability Equation
In this section, we will introduce the details of solving the ruin probability equation by the block trigonometric exponential neural network under the assumption of the classical risk model or the Erlang(2) risk model.

Classical Risk Model
The utility function U(t) represents the surplus assets of the insurance company at time t, in the compound risk model, this process can be expressed as, It has following structures: The sequence of random variables {N t , t = 0, 1, 2, · · ·} represents the number of occurrences of the claim during time (0 , t], which is considered to form a Poisson process with parameter λ. Suppose that the number of claims {N t , t = 0, 1, 2, · · ·} and the amount of claims {X i , i = 0, 1, · · · , N t } are independent of each other. In addition, the amount of the i-th claim X i is based on a non-negative random sequence with independent identical distribution, whose distribution function is F(x) and mean value is µ, respectively. The initial surplus of an insurance company is u ≥ 0 and c is the insurance premium charged in a unit time. In order to ensure that the insurance company can operate safely, the premium income should not be less than the expected value of the compensation amount, i.e.,: This means the security loading θ = c−λµ λµ > 0. The time of ruin T is defined as: where, as T = +∞ means that the insurance company will never goes bankrupt. The ultimate ruin probability is expressed as: In other words, the ultimate survival probability φ(u) is equal to 1 − ψ(u).
If the surplus process of an insurance company can be described by Formula (15), the ultimate ruin probability satisfies the following integral differential equation and initial value condition:

BTENN for Classical Risk Model
According to the BTENN model proposed above, the trial solution can be constructed as follows: In fact, the trial solution satisfies the initial conditions (20). Replace ψ(u) by the trial solution ϕ(u) in Equation (19), Expanding expression (22), we have: where, and Merging the similar items, Equation (22) can be rewritten as, Take a series of training points Ω = 0 = u 1 < u 2 . . . < u m = b, one clear fact is that Equation (28) holds at these training points, that is, Finally, the linear system in (29) has a matrix form, where, and, Note that, in generally, the original function of the definite integrals (32) and (33) cannot be represented by elementary functions. We usually use its numerical integration by Simpson's formula [58]: The optimal coefficient vector α by ELM method is, where, A † is the least square solution to the linear system (30).

Erlang(2) Risk Model
By generalizing the claim inter-arrival time of classical risk model from the exponential distribution to an Erlang (n) distribution, we can get an Erlang (n) renewal risk model, which may better describe the risks encountered by insurance companies in practical problems. In particular, this study focuses on the Erlang(2) risk model: its surplus process can be expressed as where u represents the initial reserve of the insurance company, n denotes the number of claims, c is the insurance premium charged per unit time and T i is the time interval between the i − th and (i − 1) − th payments. As in the classical risk model, we assume that T i is independent of the claim amount X i . Moreover, suppose that the time interval T i is a non-negative sequence with independent and identical distribution. In the Erlang(2) model, the probability density function of the claim interval is f (t) = η 2 te −ηt . When the surplus is negative, the insurance company is considered bankrupt. The ruin probability is denoted by ψ(u), whose definition is The ruin probability of insurance company ψ(u) satisfies the following equation [16]: where F(x) is the distribution function of claim size X i and s 0 is the solution of the following equation:

BTENN for Erlang(2) Risk Model
Similar to the classical risk model above, we claim that the trial solution that satisfies with the given initial value condition is as follows: Substituting model (38) into Equation (36), we have That is, where, Sorting out Formulas (44)- (48), When Equation (49) holds on the selected training point set Ω = 0 = u 1 < u 2 · · · < um = b, the above equation can be represented as follows: In matrix form of Equation (50) becomes where, A = (AC, AS) M×N , AC = (AC 1 , AC 2 , · · · AC M ) T , AS = (AS 1 , AS 2 , · · · AS M ) T and Training such a block trigonometric exponential neural network is equivalent to finding the least square solution to a linear system (50). The optimal parameter of the connection weight of the BTENN model can be obtained by the Moore-Penrose generalized inverse of matrix A as Meanwhile, α * = min α Aα − B exists and is unique.

Numerical Results and Analysis
In this section, three numerical experiments are conducted to verify the efficiency of the proposed BTENN method. In the first and third experiments, we assume that the number of claims follows a compound Poisson distribution, while the second experiment shows the numerical solution of the ruin probability equation when the inter-claim intervals follow an Erlang(2) renewal process. In the classical ELM model, the global optimal solution can be obtained by randomly assigning the weight ω and its bias b in the hidden layer; ω i = 1 and b i = 0 are set in our experiment for the convenience of calculation.
In order to measure the accuracy and stability of different algorithms, we calculated the mean square error (MSE) of the approximate solutions obtained on the same test set. The MSE can be calculated as follows: In fact, we are not only concerned with mean square error, but also with the maximum absolute error (MAE). In real world problems, MAE determines the stability of the model and whether it can be used in practical applications. MAE is defined as: where N test is the number of test points and x i means the i-th input test point. y(x) is the exact solution of the ruin probability equation and y(x) is the obtained approximate solution.

Numerical Example 1
In this experiment, we supposed that the probability of bankruptcy obeys the classical risk model and the claim amount follows an exponential distribution with mean µ = 1 α , that is, for x > 0, In this case, the analytical solution to Equation (17) is known and for u ≥ 0 can be expressed as: Similar to Lu et al. [57] and Zhou et al. [56], 21 training points are isometrically selected in the definition domain [0, 10]. Parameters in the ruin probability Equation (19) are set as c = 3, λ = 4, α = 2, b = 10. Twelve basis functions are used and 20 equidistant points in [0. 25, 9.75] are chosen as test points set. Figure 3 shows the exact ruin probability and approximate solution obtained by the BTENN with N = 12. It can be seen that the approximate solution and the exact solution are in good agreement. The absolute error obtained by the BTENN and the Legendre neural network (LNN) models are plotted in Figure 4. Compared with the LNN method, the numerical solution obtained by the BTENN model has smaller error fluctuations. Table 1 lists the numerical solutions of the BTENN at the test points and compares the errors of the approximate solutions obtained by different methods. The MSE of the BTENN is 2.2044 × 10 −16 , while MAE is only 2.3783 × 10 −08 , which is much smaller than the others. The accuracy of the BTENN approximate solution has been significantly improved, proving the effectiveness of the proposed method.   Moreover, according to Table 2, when 30 points are used for training, the MAE is 1.0836 × 10 −08 . Further increasing the number of training points to 100 equidistant points, the MAE reduces to 8.1964 × 10 −09 . It can be seen that the accuracy of the numerical solution increases as more training points are selected, but this improvement is not significant. Table 3 shows the mean square error and the maximum absolute error of the approximate solution obtained with different numbers of hidden layer neurons. When more hidden layer neurons are involved, a better approximation effect can be obtained, which is in line with the general approximation theorem in Remark 1.

Numerical Example 2
This experiment illustrates the case when the claim amount follows an exponential distribution with mean µ = 1 α under the Erlang(2) risk model. Same as the previous experiment, we assume exponential claims with: for x > 0. An analytical solution exists for the ruin probability in this case and it can be expressed as: Figure 5 describes the exact and the approximate solutions obtained by the proposed block trigonometric exponential neural network. Eight hidden neurons were used and contains the same parameters as Zhou [56], where c = 3, α = 1, η = 5, b = 10 and 21 equidistant training points are chosen in the interval [0,10]. Table 4 presents the exact solution to the Equation (39) for the Erlang(2) model and the numerical solution obtained by the BTENN method at these test points. The absolute errors of the approximate solutions obtained by the BTENN, the LNN and the TNN are also compared in Table 4. As you can see, the MSE is 8.7029 × 10 −18 , which is about ten-billionth of the error of the TNN model O 10 −08 . The absolute error curve of test points is plotted in Figure 6. The approximate solution error obtained by the proposed BTENN is lower, and the error of each test point is more stable. The absolute error does not become significantly larger as u increases. This shows that the proposed algorithm has good calculation stability. Moreover, it is obvious that among the selected test points, the minimum absolute error obtained by the LNN method is O 10 −08 , which is even greater than the maximum absolute error of the proposed BTENN method O 10 −09 . In addition, Figure 7 shows that even if the solution interval is extended to [0, 100], the numerical solution obtained by the block trigonometric exponential neural network containing only with eight hidden layer neurons is still close to the real solution. Based on the above facts, the BTENN method proposed in this study has the ability to accurately estimate the numerical solution of the ruin probability equation using only a small number of training points in the interval. Numerical experiments show that when insurance companies own more assets, the ruin probability decreases. However, too many assets will no longer significantly reduce its risk of ruin. Estimating the possibility of bankruptcy, allowing operators to use fewer assets and get a controllable risk.  In addition, Figure 7 shows that even if the solution interval is extended to [0, 100], the numerical solution obtained by the block trigonometric exponential neural network containing only with eight hidden layer neurons is still close to the real solution. Based on the above facts, the BTENN method proposed in this study has the ability to accurately estimate the numerical solution of the ruin probability equation using only a small number of training points in the interval. Numerical experiments show that when insurance companies own more assets, the ruin probability decreases. However, too many assets will no longer significantly reduce its risk of ruin. Estimating the possibility of bankruptcy, allowing operators to use fewer assets and get a controllable risk.

Numerical Example 3
The assumption that claim amounts follow a Pareto distribution, some studies was developed in some classical risk models for heavy-tail risks, where ~( , ) and ( ) can be written as: No analytical solution to Equation (19) exists in this case. In order to compare the approximate solutions obtained by the algorithm, we choose the same parameters = 600, = 3, = 1, = 0.2, = 10000 as in Lu [57], with 51 equidistant points used as a training set for the BTENN model.

Numerical Example 3
The assumption that claim amounts follow a Pareto distribution, some studies was developed in some classical risk models for heavy-tail risks, where X ∼ Pareto(α, γ) and F(x) can be written as: No analytical solution to Equation (19) exists in this case. In order to compare the approximate solutions obtained by the algorithm, we choose the same parameters c = 600, α = 3, λ = 1, θ = 0.2, b = 10000 as in Lu [57], with 51 equidistant points used as a training set for the BTENN model. Figure 8 plots the numerical solutions obtained by BTENN and LNN in the interval 0-10,000. The 50 test points depicted show that the approximate solutions obtained by the two algorithms almost overlap, which shows that the proposed BTENN model can be accurately calculated the ruin probability. It can be seen from the curve trend in Figure 8 that the ruin probability decreases as u rises, which is consistent with the actual situation. Table 5 contains solutions of these test points obtained by block trigonometric exponential neural network and trigonometric neural network. When the initial asset u is larger, the absolute difference between the two algorithms becomes larger. Considering that in numerical experiments 1 and 2, the error of LNN approximate solution increases when u is larger, which implies that the numerical solution obtained by the BTENN model is closer to the exact value of the ruin probability. The numerical solutions generated from the two algorithms are similar. The mean square difference is 3.2015 × 10 −10 , which means that the proposed BTENN model can estimate the probability of ruin at any time, regardless of whether the ruin probability equation has an exact solution.
increases when is larger, which implies that the numerical solution obtained by the BTENN model is closer to the exact value of the ruin probability. The numerical solutions generated from the two algorithms are similar. The mean square difference is 3.2015 × 10 , which means that the proposed BTENN model can estimate the probability of ruin at any time, regardless of whether the ruin probability equation has an exact solution.

Conclusion and Prospects
In this study, a block trigonometric exponential neural network is established to numerically solving the ruin probability equations. Three numerical experiments show that compared to the existing methods, the mean square error of the numerical solution obtained by the BTENN model is smaller and has a smaller maximum error. This shows that our BTENN model can accurately and in

Conclusion and Prospects
In this study, a block trigonometric exponential neural network is established to numerically solving the ruin probability equations. Three numerical experiments show that compared to the existing methods, the mean square error of the numerical solution obtained by the BTENN model is smaller and has a smaller maximum error. This shows that our BTENN model can accurately and in a stable way to calculate the ruin probability using only a few training points. Experiments also show that increasing the number of hidden neurons gives, approximate solutions with higher accuracy, which is consistent with the convergence theorem. In addition, the BTENN model can also be used in future to solve other types of continued integral equations. Future research can focus on simplified model calculations and promote the application range of the BTENN model.