Quantum Coding and Modeling for various Actuarial applications

Quantum Coding and Modeling for various Actuarial applications

Overview

In this Part 3 and final part of our series on quantum computing, we do coding using QisKit on an actuarial application as well as detail several case studies of applying quantum coding to finance applications such as reserving, pricing, reinsurance optimization, catastrophe modeling, options pricing and credit risk modeling.

In Part 1 “Hello World Moment for the Quantum Actuary” we discussed quantum computing fundamentals and their applications in various areas of finance and insurance. Part 2 looked at Methodologies for quantitative modeling using quantum algorithms and how this can supplement the conventional modeling work that we do as actuaries and data scientists. Part 2 covered different methodologies in detail and Part 3 here covers quantum coding exercise sample and various case studies to further supplement our working.

IFRS17 is an accounting standard that requires insurance companies to provide more detailed information about their insurance contracts and recognize the profit or loss on those contracts over the period they are in force. The Best Estimate Liability represents the expected present value of future cash flows that are associated with the insurance contract. The Risk Adjustment is the additional amount that is added to the Best Estimate Liability to compensate for the uncertainty associated with the Best Estimate Liability.

Quantum computing can potentially be used to optimize the calculation of the Risk Adjustment by efficiently solving complex optimization problems. For example, one could use quantum optimization algorithms to optimize the calculation of the Risk Adjustment.

We can first define the number of time steps and paths for the simulated market data, and the expected cash flows for the insurance contract. We can then generate the random market data using and calculate the expected discounted cash flows and apply risk metrics on them by using Quantum Amplitude Estimation (QAE) to estimate risk measures with a quadratic speed-up over classical Monte Carlo simulation. So, we use quantum simulation here instead of Monte Carlo simulation. Then RA will be difference between reserves at let’s say VaR 75% and VaR 50%.

Another key modeling exercise by actuaries is calculating solvency levels and probability of ruin insolvency. This is a key item required under Risk Based Capital (RBC) regimes and capital required under solvency regimes are set such that probability of ruin is 0.05% at very low levels over a given timeframe. RBC regimes are common worldwide and is also being introduced in more countries over the years rapidly.

As an alternative to classical methods, we can utilize Dirac Notation and Feynman’s Path calculation to determine the ruin probability for an insurance company. By representing the financial state of the insurance company as a quantum mechanical system, we can use the path integral formula to calculate the probability of ruin and inform risk management decisions:

1.???????????????Define the quantum mechanical system: The quantum mechanical system can be defined as the financial state of the insurance company, where the state of the system is determined by the amount of reserves available to cover claims.

2.???????????????Define the initial and final states: The initial state of the system can be defined as the financial state of the insurance company at the beginning of a given period, and the final state can be defined as the financial state of the insurance company at the end of that period.

3.???????????????Define the Hamiltonian operator: The Hamiltonian operator represents the total energy of the system, which includes both the kinetic and potential energy. In the case of an insurance company, the Hamiltonian operator can be defined as the sum of the premium income, the investment income, and the claims paid out during the period.

4.???????????????Use Feynman's path integral formula: The path integral formula allows us to compute the amplitude of the system by summing over all possible paths that the system can take between the initial and final states. Each path is assigned a weight based on the action of the system along that path, which is given by the integral of the Hamiltonian operator over that path.

5.???????????????Define the ruin event: The ruin event occurs when the reserves of the insurance company fall below zero. This can be represented in the quantum mechanical system as the collapse of the wave function to a state with zero amplitude.

6.???????????????Calculate the ruin probability: The ruin probability can be calculated as the square of the modulus of the amplitude of the system that corresponds to the ruin event.

7.???????????????Interpret the result: The ruin probability represents the likelihood that the insurance company will become insolvent over the given period. This information can be used to inform risk management decisions, such as setting the solvency capital required to be held by the insurer under the RBC regime.

?

Case Study Quantum Capital Modeling

The paper by Muhsin Tamturk is taken as a case study here. This trail-blazing paper is the first academic paper about insurance modelling in quantum computer. “In this paper, the main aim is to show how to develop quantum algorithms, and use quantum computers in actuarial computations, which is also our primary novel contribution to the field”. I was able to independently recalculate the results using the code given on Github profile (along with some help on resolving bugs from the author Muhsin) using IBM Qiskit as well. Details of that are mentioned ahead.

The abstract is given as follows:

“Abstract: This paper proposes a quantum computing approach for insurance capital modelling. Using an open-source software development kit, Qiskit, an algorithm for working on a superconducting type IBM quantum computer is developed and implemented to predict the capital of insurance companies in the classical surplus process. With the fundamental properties of quantum mechanics, Dirac notation and Feynman’s path calculation are shown. Furthermore, custom quantum insurance premium and claim gates are investigated in order to build a quantum circuit with respect to initial reserve, premium and claim amounts. Some numerical results are presented and discussed at the end of the paper”.

It is useful to understand the notations of quantum mechanics and brief fundamentals of it as given in the paper:

No alt text provided for this image


It’s also interesting to see entangelement being represented/visualized in the Qiskit software:

No alt text provided for this image

?

As we have been continuously talking about qubits and gates, it’s also good to see them being represented here visually:

No alt text provided for this image

“Physically, gates are transistors in a circuit, which are used to convert the inputs into outputs in the form of electrical pulses. Mathematically, quantum logic gates are represented by unitary matrices in quantum computing, so they are reversible, unlike most of the classical logic gates. Quantum gates are used to manipulate qubits”.

“After the creation of qubits to represent the initial reserve, the next step is to apply premium and claim gates for all qubits”.

The premium and claim gates are shown as follows:

No alt text provided for this image

As a final step, a simulation of the quantum circuit is run to get random results. If the quantum circuit does not include any superposition, then the simulation produces the same results.

To take changes in insurance risk behaviours, as a result of climate change, war, pandemics, and so on, into account, random noise approach using Hadamard gates can be considered.

The quantum circuit is then made as follows Given the initial capital u = 200, premium c = 20, claim mean m = 15 variance = 4 and time t = 8.:

No alt text provided for this image

Output states and the quantum circuit, key output of potential capital at time 8 is shown below:

No alt text provided for this image

The Conclusion of this article says that “Even though it is not easy to answer the question of what the future holds for quantum computing, advances in this field continue to increase with government and private sector investments. A lack of experts in quantum mechanics and quantum computing in actuarial mathematics is one of the barriers to manufacturing more academic and industrial works. Using the principles of quantum mechanics in insurance researches is quite new. With this paper, actuarial researchers will become familiar with quantum computing. Quantum machine learning should be adapted to insurance risk and capital computations in further research, and quantum cryptography-based products should be considered in the exposure of cyber insurance risk and pricing. Simulation of systemic risks is complex due to number of the parameters in the dependent risk models, so, in some cases, it is difficult to handle this in any feasible amount of time by classical computers. Implications of some systemic risks on insurance pricing encourage us to focus on new forecasting approaches and innovative technologies. Simulation of the systemic risks like the climate change, pandemics, and global financial crises for insurance industry via quantum computers is a potential future subject of study”.

There are various other case studies exploring modeling relevant for actuarial practitioners:

1.???????????????Credit risk analysis running QAE as improvement over monte carlo simulation for TVaR and VaR. Available here.?

2.???????????????Mean variance portfolio optimization based on stocks time series dataset. Available here and here.

3.???????????????Quantum neural networks. The motivation behind quantum machine learning (QML) is to integrate notions from quantum computing and classical machine learning to open the way for new and improved learning schemes. QNNs apply this generic principle by combining classical neural networks and parametrized quantum circuits. Because they lie at an intersection between two fields, QNNs can be viewed from two perspectives.

a.?????From a machine learning perspective, QNNs are, once again, algorithmic models that can be trained to find hidden patterns in data in a similar manner to their classical counterparts. These models can load classical data (inputs) into a quantum state, and later process it with quantum gates parametrized by trainable weights.

b.?????From a quantum computing perspective, QNNs are quantum algorithms based on parametrized quantum circuits that can be trained in a variational manner using classical optimizers. These circuits contain a feature map (with input parameters) and an ansatz (with trainable weights). Available here.

4.???????????????Quantum Neural Network Classifier and Regressor. Available here.

5.???????????????Training a quantum model on real dataset of Iris flower dataset. Available here.

No alt text provided for this image

Training and testing dataset are made. Data is classical so it is first encoded to be qubit. Once the data is loaded, we must immediately apply a parameterized quantum circuit. This circuit is a direct analog to the layers in classical neural networks. It has a set of tunable parameters or weights. The weights are optimized such that they minimize an objective function. This objective function characterizes the distance between the predictions and known labeled data. A parameterized quantum circuit is also called a parameterized trial state, variational form, or ansatz. The choice of hyperparameters plays the same critical role in quantum ML as in classical ML.

6.??????????A Quantum-Type Approach to Non-Life Insurance Risk Modelling. Available here.

a.???????????A quantum mechanics approach is proposed to model non-life insurance risks and to compute the future reserve amounts and the ruin probabilities. The claim data, historical or simulated, are treated as coming from quantum observables and analyzed with traditional machine learning tools. They can then be used to forecast the evolution of the reserves of an insurance company. The following methodology relies on the Dirac matrix formalism and the Feynman path-integral method. This paper proposes a quantum-type approach for the representation and analysis of non-life insurance data. Quantum mechanics methods are successfully applied in various disciplines, including finance for option pricing and econophysics for risk management. the existence of Maxwell-Boltzmann and Bose-Einstein statistics is explicitly indicated, and the associated likelihood functions are derived.

b.???????????the different possible claim amounts 0, d, u, d + u, 2d, 2u are considered as energy levels of particles and they are treated as the eigenvalues of an operator H which has to be modelled. This requires a special choice to make with care. The future reserves of an insurance can be computed by applying path integral methods.

7.???????????????Quantum option pricing and data analysis. Available here.

a.?????Option pricing models using quantum techniques discussed, for example, in Baaquie (2004, 2014); Bouchaud and Potters (2003); Haven (2002) are often based on the Schrodinger wave function with Hamiltonian operator H and are mainly oriented to continuous-time markets. For discrete-time markets as considered here, following Chen (2001, 2004), we choose the discrete-time formalism and analyze the quantum version of the Cox-Ross-Rubinstein binomial model. Then, we establish the limit of the spectral measures providing the convergence to the geometric Brownian motion model. We also identify the limit of the N-step non-self-adjoint bond market as a planar Brownian motion. Quantum actuarial type model is developed as well as quantum trinomial model. convergence to continuous-time markets, namely the Black-Scholes model and the planar Brownian motion is carried out. Quantum bond market is also evaluated.

b.?????Discrete and continuous-time markets must be treated separately because of different stochastic behaviors. To simplify the presentation, we assume that the interest rate is 0 and that the risky processes for share prices are martingales. Several quantum type financial models are constructed that benefit from the physical interpretation of the unpredictable stock market behavior and associated dependences. The models provide a general physical type framework for pricing of derivatives and a possibility to construct quantum trading strategies. Moreover, it is revealed that certain quantum type models are applied both in actuarial and financial sciences.

8.???????????????Optimal Reinsurance via Dirac-Feynman Approach. Available here.

a.?????Abstract “In this paper, the Dirac-Feynman path calculation approach is applied to analyze finite time ruin probability of a surplus process exposed to reinsurance by capital injections. Several reinsurance optimization problems on optimum insurance and reinsurance premium with respect to retention level are investigated and numerically illustrated. The retention level is chosen to decrease the finite time ruin probability and to guarantee that reinsurance premium covers an average of overall capital injections. All computations are based on Dirac-Feynman path calculation approach applied to the convolution type operators perturbed by Injection operator (shift type operator). In addition, the effect of the Injection operator on ruin probability is analysed.

9.???????????????Examining the Effects of Gradual Catastrophes on Capital Modelling and the Solvency of Insurers: The Case of COVID-19. Available here.

?Snapshots of Independent calculation based on Github Code

No alt text provided for this image
No alt text provided for this image
No alt text provided for this image
No alt text provided for this image
No alt text provided for this image
No alt text provided for this image
No alt text provided for this image

Which is close to classical result of 240. It is 238 now and in previous simulation it was 236. Result will be different per each simulation.

?

Conclusion

Quantum algorithms have the potential to significantly speed up certain computations, but they are not yet widely used for insurance pricing or risk assessment. Currently, classical machine learning algorithms are the primary tools used for these tasks in the insurance industry. That being said, it is possible that quantum algorithms could be used in the future to enhance certain aspects of insurance pricing. For example, they may be able to improve the accuracy of simulations used to model the behavior of large groups of policyholders, or to optimize complex risk management strategies.

?While quantum computing has the potential to enhance the accuracy and speed of actuarial calculations, it's still a relatively new technology, and there are not many quantum computing algorithms developed specifically for the insurance industry. This is where actuaries can start working and adding value on. For example, it is through industry practices that we know that gamma is a good fit to severity data, that Tweedie is good fit usually to burning cost data and Poisson is for frequency. Similar industry practices can tell us which quantum algorithms are more suitable than others, practices of making gates and hyper-parameter tuning as well as what tweaks are there to be made to the quantum algorithms to improve their performance specially to meet the demands of insurance datasets.

There is no reason to wait for quantum computers to be invented and wait for their ‘Hello World’ moment. We need to start training as actuaries now to enter the quantum realm so that we can take advantage of it when it comes available. When it comes and if we haven’t done our homework at that time, catching up then might prove to be very difficult. Within few years we might have to modify this iconic statement of Frank Redington “An actuary who is only an actuary is not an actuary at all” to “An actuary who does not recognize the quantum realm in his practitioner’s toolkit is not an actuary at all”.

Liberty Shambare

Student at University of Zimbabwe

5 个月

Hi Syed Danish Ali, CSPA I have been following your insightful posts on quantum computing and insurance, from part 1 to the latest part 3. Your expertise has sparked my interest in exploring this field further. I am now considering "Quantum Computing in Insurance" as the topic for my dissertation. Would you be willing to share your part 3 paper or relevant resources? Your discretion is appreciated. Additionally, I would love to consult with you during my writing process if permissible. Your guidance would be invaluable. Looking forward to hearing from you. Best regards, Liberty Shambare

要查看或添加评论,请登录

Syed Danish Ali, CSPA的更多文章

社区洞察

其他会员也浏览了