Could machine learning improve CVA and IM calculations?

Banks have built ways to calculate CVA more quickly, but neural networks could offer more accurate method

Credit valuation adjustments (CVA) and initial margin (IM) requirements aren’t the easiest measures to compute, especially for a large portfolio of assets.

Both require users to calculate the future exposure of the portfolio in question, which means the path of each individual asset needs to be simulated. All might have non-linear features such as embedded optionality and exercise rights, making it impossible to use simple partial differential equations (PDEs) – which become very difficult to solve at higher dimensions – to price them accurately.

Over the past decade, numerous researchers have attempted to improve the speed and accuracy of CVA calculations. More recently, banks have also had to calculate initial margin requirements – arguably even more complex than CVA – thanks to the phase-in of non-cleared margin rules from 2016. A new paper from a quant at Societe Generale attempts to reduce the complexity of both calculations, using machine learning techniques.

In this month’s first technical, CVA and IM: welcome to the machine, Pierre Henry-Labordère, a member of the global markets quantitative research team at Societe Generale Corporate & Investment Banking in Paris, proposes a new technique that combines a backward stochastic differential equation (BSDE) – which can capture non-linearity – with the use of machine learning to find a less complex way to calculate CVA and initial margin.

Many large dealers are able to calculate CVA and its Greeks within a reasonable amount of time now. But that is mainly due to heavy investment in technologies such as graphics processing units (GPUs), which can run thousands of calculations in parallel. Others have combined mathematical tricks such as adjoint algorithmic differentiation to speed up the calculation.

The research was driven by the challenges of familiar, less-than-perfect approaches, says Henry-Labordère. Take CVA calculations for starters, where it is not possible to use something such as a partial differential equation (PDE) solver for portfolios approaching any reasonable size.

“By way of example, if we have one option depending on one underlying, for this one you can use a Monte Carlo algorithm or a PDE solver. Now for the CVA, say the number of underlyings is very large – say, 10 assets – it is not possible to use deterministic methods. Therefore we need to rely on a probabilistic algorithm,” he says.

Pierre Henry-Labordère’s solution uses neural networks to find the upper and lower bounds of the CVA and IM one wants to calculate on a portfolio, enabling one to quickly optimise the simulated path of the asset by focusing on that range

Another issue is that CVA is non-linear. This means it is not possible to simply sum the CVA of a given portfolio with one kind of asset and the CVA of a portfolio of a different underlying asset to arrive at the CVA of a portfolio containing both assets, as there will be interactions between the two.

What quants typically then do is run a nested Monte Carlo simulation, or run a non-linear PDE – but both are very computationally intensive. In the case of the former, one needs to calculate not only the expected loss on a given portfolio, but also the individual exposures at each future point in time based on the movement and exercise of underlying assets. Non-linear PDEs, on the other hand, need numerical methods to solve.

“We don’t have perfect tools for solving this non-linearity problem,” adds Henry-Labordère. “You introduce some time steps between zero and the maturity of, let’s say, 10 years, and each time step will represent a probability of default of the counterparty. On each path and at each time step, you need to compute the positive part of the mark-to-market, and you do that for each Monte Carlo path. So, at the end, what you need to do is a Monte Carlo of a Monte Carlo.”

Neural network solution

Henry-Labordère’s solution is to use a machine learning approach called neural networks to eliminate an additional Monte Carlo step in the calculation. Neural networks – which function in a similar way to biological neurons – are typically used as an unsupervised learning method to learn patterns from large datasets and make predictions or decisions.

His solution uses neural networks to find the upper and lower bounds of the CVA and IM one wants to calculate on a portfolio. This gives a tight range within which the values would fall, and enables one to more quickly optimise the simulated path of the asset by focusing on that range.

“If you try to minimise a function that depends on 200 parameters or 1,000 parameters, you will find the minimisation algorithm is not working properly, because you have a huge number of valleys or mountains. So when you are doing the optimisation, sometimes you converge not towards the true minimiser, but a local minimiser,” says Henry-Labordère.

This is analogous to pricing an American option based on an optimal stopping time – a time at which one could exercise the option to maximise gains. The optimal stopping time gives a rule based on the upper and lower bounds of the underlying to determine the optimal course of action given a particular time step. If this function is already available, one does not need a separate Monte Carlo to simulate the path of the payoff or exposure at each time step.

For CVA or IM calculations, this works in a similar way: the neural network algorithm creates a rule to find the upper and lower bounds, which is then fed into the BSDE algorithm. This eliminates the need to run a nested Monte Carlo.

Henry-Labordère says the CVA and IM calculations derived using this technique match those of a single-asset portfolio priced using a PDE, which gives the true price.

Editing by Tom Osborn

Only users who have a paid subscription or are part of a corporate subscription are able to print or copy content.

To access these options, along with all other subscription benefits, please contact or view our subscription options here:

You are currently unable to copy this content. Please contact to find out more.

You need to sign in to use this feature. If you don’t have a account, please register for a trial.

Sign in
You are currently on corporate access.

To use this feature you will need an individual account. If you have one already please sign in.

Sign in.

Alternatively you can request an individual account here