{'fraction_non_alphanumeric': 0.028038622738606824, 'fraction_numerical': 0.009629158045519656, 'mean_word_length': 4.280711584255498, 'pattern_counts': {'":': 0, '<': 1, '<?xml version=': 0, '>': 0, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 1, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
A novel approach to rating transition modelling via Machine Learning and SDEs on Lie groups

In this paper, we introduce a novel methodology to model rating transitions with a stochastic process. To introduce stochastic processes, whose values are valid rating matrices, we noticed the geometric properties of stochastic matrices and its link to matrix Lie groups. We give a gentle introduction to this topic and demonstrate how It\^o-SDEs in R will generate the desired model for rating transitions. To calibrate the rating model to historical data, we use a Deep-Neural-Network (DNN) called TimeGAN to learn the features of a time series of historical rating matrices. Then, we use this DNN to generate synthetic rating transition matrices. Afterwards, we fit the moments of the generated rating matrices and the rating process at specific time points, which results in a good fit. After calibration, we discuss the quality of the calibrated rating transition process by examining some properties that a time series of rating matrices should satisfy, and we will see that this geometric approach works very well.


Introduction
In this paper, we model rating transition matrices with a stochastic process using historical data published by rating agencies such as S&P, Moody's or Fitch for the calibration. This is done in two steps. First, we show how a Deep-Neural-Network (DNN) known as TimeGAN (cf. [17]) can be utilized to learn the distribution of the historical rating transitions.
In a second step, we match the moments of the model and the synthetic data generated by the DNN. For the stochastic model itself, we will demonstrate how basic matrix Lie group theory can be helpful to define Itô-processes in R to model the rating transitions.
A rating is an indicator of the creditworthiness of an entity. A high rating associates less risk to an entity to not fulfill its financial obligations and a low rating a high risk. Ratings are usually denoted by letters A, B, . . . , D, where A denotes the best rating and D denotes the worst rating. The rating D is special. It means that an entity has defaulted, i.e. it can not fulfill its financial obligation towards a contracting party. In this paper, we use the terms default and bankruptcy of an entity synonymous, implying that a defaulted company cannot recover from this state.
For most applications, it is important to model the rating changes of an individual entity or an entire sector on a continuous time scale. This can be done in two different ways.
On the one hand, one can define a process X t , which tells us at each time and trajectory the current rating of a company. The natural state-space of these processes is therefore discrete and the time axis is continuous. On the other hand, one can model the transition probabilities R t of a sector at each point in time and derive a rating process using these transition probabilities. The state-space of this type of model is then a matrix whose entries are the probability of transitioning from one rating to another starting at an initial time t 0 (usually today) till a future time t. An example of such a t − t 0 rating matrix is given in Table 1. We can see that the individual rows sum up to one, meaning that all rows are valid  probability distributions. These type of matrices are called stochastic for this reason. The last row corresponds to our idealized assumption that a defaulted entity cannot recover, i.e. the default state is absorbing. Rating agencies publish these type of matrices usually once a year for a few time frames. Short-term rating matrices are usually published with time frames of 1, 3, 6, 12 months and long-term rating matrices with time frames of 1, 2, 3, 5, 10 years. We see a lot of uncertainty in the historical data published by the agencies increasing with larger time frames. Therefore, it stands to reason to desire stochastic models for the rating transitions.

Review of the literature and comparison
Thus, we would like to model the evolution of rating transition matrices as seen from today with a stochastic process in continuous time. We will focus in this paper on short-term rating matrices.

Review of the literature and comparison
We recognize two different approaches to rating modelling in the literature which is described in [1, p. 76 Section 4.12.1 Standing Assumptions] in more details. On the one hand, one can model ratings in a HJM-framework, independently proposed by [2] and [15]. On the other hand, there are intensity-based models, introduced by the pioneering work of [7]. As this paper can also be viewed as an intensity approach let us explain this in more details alongside a short illustration in Figure 1.
Rating Transition Matrices In the intensity approach (left-hand side in Figure 1), usually the rating process X t is modelled by a continuous-time Markov chain (CTMC). This seems quite natural, because its state space is discrete. Another feature of this approach is that due to the Markovianity one can describe a CTMC fully by its transition operators U t . In this paper, we want to model the rating transitions with a stochastic process (right-hand side in Figure 1) and noticed that generators of CTMCs are actually elements in a suitable subspace of the Lie algebra of stochastic matrices. This allows us to formulate Itô-SDEs taking values in R ≥0 and apply a basis transformation to the desired Lie algebra leading to a process L t . The exponential map, i.e. the matrix exponential, maps the model in the Lie 2 Generating rating transition matrices algebra to the proper Lie group of stochastic matrices resulting in a stochastic model R t .
For the calibration, we need to study the distribution of the time series of historical rating matrices, for which we use a TimeGAN.
To the best of our knowledge, this is the first paper which is modelling rating transitions starting from an SDE in a appropriate subspace of the Lie algebra of stochastic matrices.
Additionally, the application of a Deep-Neural-Network (DNN) to learn the distribution of historical rating transition matrices seems entirely novel in this community. Also we believe that this is an exciting approach with many possibilities for future research from both a theoretical point of view and modelling point of view.
The paper is structured as follows: In Section 2 we will train a DNN learning a time series of 1, 3, 6, 12 rating matrices. The section is divided into two parts. In Section 2.1 we explain how to compute rating matrices from historical data making certain that all rows sum up to one. This is followed in Section 2.2 by a description how the training data is built and how the TimeGAN DNN works. In Section 3 we give a gentle introduction to matrix Lie groups and notice that the stochastic matrices form a are a subgroup of matrix Lie group.
We show two different ways how to utilize this framework to model rating transition matrices by a stochastic process. Afterwards, we do some numerical experiments in Section 4 and define desirable properties of short-term rating matrices in Section 4.1. The first step is to calibrate the rating process to the distributions learned by the DNN, which is subject of Section 4.2. Then, in Section 4.3 and Section 4.4 we perform one test for each of the two methods proposed in Section 3 and assess their quality. Last but not least, we conclude the paper in Section 5 and discuss possibilities for future research.

Generating rating transition matrices
In this section, we will explain how to generate synthetic rating transition matrices from historical data. The section is structured as follows. First of all, we will discuss in Section 2.1 what rating matrices are, what kind of historical data we have and how to compute them.
Afterwards, we will give a brief introduction to the relevant Deep-Neural-Network (DNN) architectures, which are necessary for the TimeGAN in Section 2.2.

Historical data and Aalen-Johansen estimator
Ratings are an ordered set of indicators for creditworthiness of an entity. The best rating is usually denoted by the letter AAA or simply A. If an entity is insolvent, meaning that it cannot fulfill its financial obligations, we say that this entity has defaulted. In this paper, we will not distinguish between the default and bankruptcy of an entity, which translates to the fact that once an entity has defaulted, it cannot recover from it. In the mindset of ratings, a default can be viewed as the worst possible rating usually denoted by D.
To keep this presentation as simple as possible in this paper, we consider only four different ratings: A, B, C, D ordered from best to worst rating and identify them by integers {1, 2, . . . , K}, whenever it is more convenient. But it is straightforward to use more ratings.

Historical data and Aalen-Johansen estimator
Methodology. Rating agencies, such as S&P, Moody's and Fitch are required by "Rule 17g-7 of the Securities Exchange Act of 1934" 1 to publish the history of rating changes for some entities. This data can be downloaded from their respective websites and consists of rating histories of individual entities in different sectors, e.g. financial institutes and corporate. We will use the data set from S&P with focus on the corporate sector. The data is structured like follows: for each entity it consists of a list of time stamps when a rating was changed or confirmed. Therefore, we can extract the historical ratings for each individual company for each day.
The jump process ∆N ij (T k ) denotes the number of transitions from rating i to rating j at time T k and ∆N i (T k ) counts the total number of transitions away from rating i at time T k .
The jump process Y i (T k ) denotes the number of entities with rating i right before time T k .
The last row is zero, because we assume an absorbing default rating. So each time a rating changes in the underlying data, the estimated generator is updated accordingly.
For a more detailed explanation with examples we refer to [11, pp. 9 ff.].

Advantages and limitations.
To discuss the advantages of using the Aalen-Johansen estimator, we need to briefly discuss a huge problem of the rating data. Entities have the right at any point in time to not being rated anymore for whatever reason. This is a huge issue, because suppose you would want to calculate the rating transition probabilities naively by setting a time frame, denote how many companies are in which rating initially and then look where they end up at the end of the time frame. If a company decides to withdraw from being rated in this time window, one has at the end a rating matrix with rows that do not sum up to one, i.e. an invalid probability distribution. The Aalen-Johansen estimator overcomes this problem naturally, by updating after each rating change. Therefore, this method guarantees that rows sum up to one, which will be important later on.
However, we found that our results differ from the rating matrices which are published by the agencies and confirmed with S&P that they also use unpublished sensitive rating data and remove correlation structures from data, for which additional knowledge of the entities and their relation towards each other is necessary.
Therefore, the results presented in this paper serve as an illustration how this methodology can be applied but the underlying data needs some work for an implementation in practice.

TimeGAN
In this section, we show how one can use a generative adversarial network (GAN) for time series data to obtain fake rating transition matrices from paths of a Brownian motion. In particular, we chose a network called TimeGAN by [17] to learn the rating distributions from the historical data.
The TimeGan is supposed to learn a function mimicking the historical rating matrices R H t k for k = 1, . . . , n, n ∈ N. After the learning phase, we can use a path of the Brownian motion W to generate fake rating matrices at the points in time t k .
Training data. We use the technique described in the previous paragraph to compute rating matrices with time spans of 1, 3, 6, 12 months starting in 2011 till the end of 2019. For the one month rating matrices, we start at each month in a year and compute the transition probabilities with the Aalen-Johansen estimator till the next month. For the three month rating matrices we proceed similar but starting every three months and so on, such that data is not used twice for the rating matrices with respective time spans. After computing all these matrices we end up with 108 matrices for one month, 36 for three months, 18 for six months and nine for one year. After that, we build a set of time series data by considering all the permutations of the rating matrices leading to a data set of roughly 630000 different time sequences of rating matrices.
We are aware that this approach might raise some eyebrows but rating data is scarce and it is not unusual to assume independence of the rating events which justifies this approach.
We will discuss the impact of this choice in Section 4 further, while studying properties of rating matrices. Remark 2.1. One can alternatively use the rating matrices which are published by the rating agencies from e.g. the last 10 years. However, these are usually only available for long term rating matrices, i.e. 1 up to 10 years. Another problem with this data set is that rating agencies use the so-called cohort method to compute the matrices, i.e. they have the imperfections due to entities who do not want to be rated anymore. So one idea could be to repair them with an heuristic method and build up a training data set by again considering the permutations of the time series.
The TimeGAN combines an autoencoder with a generative adversarial network using recurrent neural networks linked by a supervising network. We would like to give a short intuition how these networks work together in our case and refer the reader to [17] for the details. Autoencoder. For a detailed treatment of Variational Autoencoders (VAE) we refer the reader to [10].
The principle network architecture in an application without time series data is illustrated in Figure 2. There are two different networks linked to each other, one called embedder or encoder and the other one called recovery or decoder. The idea is to introduce a bottleneck between these networks. This forces the network to learn principle components of the data and helps with denoising as well as dimensionality reduction. For the training phase, the data is first embedded, recovered and afterwards compared to the original data to minimise the difference of both. After the training phase the recovery network can be used to generate rating matrices from their embedded features. We will see how the generator network of generative adversarial network can be used to generate fake features in the next two paragraphs.

Generative Adversarial Network.
For a detailed treatment of Generative Adversarial Networks (GAN) we refer the reader to [5].
The principle network architecture in an application without time series data is illustrated in Figure 3. There are two different networks linked to each other, one called generator and the other one called discriminator. The idea is to play these networks against each other. The generator network has a few random numbers as input and outputs fake data.
The discriminator network will get the fake data from the generator as an input, as well as the real data. Then it is learning to distinguish between fake and real data by outputting a probability of the data being real. Since we know which of the input data is fake and which is real we can optimize the prediction of the discriminator network. The generator on the other hand is learning how to fool the discriminator, i.e. making it believe that the fake data point was real. After the learning phase and when the discriminator is not very confident anymore in distinguishing between fake and real, the generator network can be used to produce synthetic data.
Supervisor. The supervisor network does not have a special network architecture and it is placed in-between the embedder and recovery network, as well as between the generator and the discriminator network to establish a link between them. This makes it also possible in the training of the entire network to compare the supervised networks to the unsupervised networks. Another implication of this approach is that the generator network of the GAN is not generating the rating matrices directly but the features of the rating matrices. As aforementioned, combining the trained generator with the trained recovery network will enable us to generate synthetic rating matrices.

Recurrent networks.
For a detailed treatment of Recurrent Neural Networks (RNN) and a comparison of Long-Short-Term-Memory (LSTM) to Gated-Recurrent-Units (GRU) we refer the reader to [3].
So far, we have discussed how the supervised VAE and GAN can be used together at a single point in time to generate synthetic rating matrices. RNNs enable us to use time series data and all the aforementioned networks are augmented with GRUs in our implementation to take the time series of rating matrices into account. GRUs consist of two different gates.
One is called the update gate and the other one is called forget gate. The update gate decides how much of the new temporal information is added to the time sequence. The forget gate has the possibility to forget the previous times in the time sequence, making the current point in time independent of the past.
Hyperparameters and network architecture. It is not the purpose of this paper to "overoptimize" the procedure, since it is a first step using these modern techniques for rating transitions. Additionally, for its next use case of rating triggers, an additional source of market data will be available and the current architecture might need some adjustments. We leave it up to the reader to change the hyperparameters and network architectures, because we are satisfied with the performance of the current setting, which is discussed in Section 4.1 in greater detail. We chose the following settings for our experiments.

1.
We used 40 epochs in total and noticed that 10 epochs take roughly 1 hour in the training step.

2.
We found that a batch size of 128 was a good middle-ground between speed and realistic rating matrices.

3.
For the embedder we used three GRU layers. The first and last with 3 units and the second one with 2 units. The output dense layer has 4 units and a sigmoid activation function.

4.
For the recovery we used three GRU layers. The first and last with 3 units and the second one with 2 units. The output dense layer has K 2 = 16 units and a sigmoid activation function.

5.
For the supervisor we used two GRU layers, each with 4 units. The output dense layer has 4 units and a sigmoid activation function.

6.
For the generator we used three GRU layers, each with 4 units. The output dense layer has 4 units and a sigmoid activation function. As an input we take the values of a Brownian path at t = 1, 3, 6, 12 months.

7.
For the discriminator we used three GRU layers, each with 4 units. The output dense layer has a single unit and a sigmoid activation function.
As aforementioned, for the training of the network we refer the reader to [17] and note that we used the standard loss functions indicated in this paper.

SDEs on the Lie Group of stochastic matrices
In this section, we show how an SDE can help to interpolate the generated rating matrices in time. This is a desirable feature for several applications, because it gives access to rating matrices of any time span or can help to forecast transition matrices with larger time spans.
To guarantee that our SDE will produce stochastic matrices, we noticed that this is a special kind of geometry and the proper tools are readily available in the matrix Lie group literature. We will recall all the necessary results first.
matrix Lie group according to [4], i.e. a subgroup of GL(K) which is a differentiable manifold and for which the product is a differentiable mapping G × G → G. The tangent space at the identity of a Lie group is called the Lie algebra and is in this case given by g = T I G = {L ∈ GL(K) : L1 = 0}. The Lie algebra g is a vector space with dim(g) = K(K − 1) since basis matrices for g can be formulated as E ij − E ii for i, j = 1, . . . , K with i = j, where E ij are elementary matrices. This makes the Lie algebra g together with the matrix commutator, . The matrix exponential exp : g → G, exp(L) = ∞ k=0 L k /k!, maps elements from the Lie algebra to the Lie group and is a local diffeomorphism in a neighbourhood of L = 0. The directional derivative of the matrix exponential along an arbitrary matrix H ∈ g is given by for k ≥ 1. For more details on Lie groups and Lie algebras we refer the interested reader to [6].
Consider the following SDE in the Lie algebra g where A, B ∈ g and S t is a one-dimensional general semimartingale. Applying a numerical scheme, e.g. the Euler-Maruyama scheme, to get an approximation L t k+1 of (3.1) after one time step and computing R t k+1 = R t k exp(L t k+1 ) would result in a numerical method for which can be easily verified by applying Itô's lemma to R t = R 0 exp(L t ) ∈ G in the case S t = W t a Brownian motion (as done e.g. in [8]). As this approach preserves the geometry of the Lie group G opposed to applying the Euler-Maruyama scheme directly to (3.2), this method was called the geometric Euler-Maruyama scheme in [13]. Higher order schemes based on this approach can be found in [14].
Since we are interested in stochastic matrices that are elements of G ≥0 := {R ∈ G : R ij ∈ [0, 1], i, j = 1, . . . , K} we now consider a subset of the Lie algebra g, namely g ≥0 := {L ∈ g : Note that additional to the usual properties of generator matrices we choose the last line of matrices L ∈ g ≥0 to be zero because applying the matrix exponential exp to these matrices will generate matrices that have the last unit vector in the last line. This choice is in accordance with our assumption that the default state is absorbing. With this assumption the dimension of g ≥0 is now dim(g ≥0 ) = (K − 1) 2 because as before basis matrices can be denoted by E ij − E ii but for i = 1, . . . , K − 1, j = 1, . . . , K and i = j. Similarly to before, there exists an isomorphism between g ≥0 and R (K−1) 2 , which is illustrated on the left-hand side in Figure 4. We will denote the basis for The fact that for any L ∈ g ≥0 we have exp (L) ∈ G ≥0 is well-known and a proof can be found in [16, pp. 86  .
Direct exponential mapping. For the interpolation of the generated rating matrices we consider the SDE (3.1) again and discuss some conditions for the solution L t to be evolving in g ≥0 such that exp(L t ) ∈ G ≥0 . Therefore, we make the assumption that the equation is decoupled in the following sense: where E i denotes the basis vectors of g ≥0 . If the solution Let However, to ensure that R SDE t ∈ G ≥0 , which is equivalent to ensuring that the approximation for L t is in g ≥0 , we need an additional assumption. For the Euler-Maruyama scheme to have results in g ≥0 it would be necessary that all increments ∆L t k ≥ 0, i.e. L t ≥ 0 must have monotonically increasing paths in time, as well.
A class of processes satisfying this condition easily, would be all jump processes with positive jumps only. Another possibility could involve processes with stochastic coefficients of the form In this case, L t are positive, pathwise-increasing, continuous stochastic processes for any semimartingale S t .

Numerical tests
In this section, we conduct two experiments, one for the direct exponential mapping and one for the geometric Euler approach. We calibrate the resulting rating models R SDE t to R GAN t at t = 1, i.e. 1 year, by matching the first four moments. This is described in Section 4.2 in more details. In Section 4.3, we show one example for the direct method using CIR processes on g ≥0 and in Section 4.4 we show another example for the geometric Euler approach using a constant drift and volatility. In both sections, we will discuss the fit to the TimeGAN rating matrices by looking at their corresponding distributions at 1, 3, 6, 12 months and study some properties rating matrices should satisfy. These properties are introduced next in Section 4.1. We

Rating properties
To estimate the quality of the TimeGAN and the SDEs we observed from the historical data that short term rating matrices up to one year should have the following properties: 1.
It is more likely to stay in the initial rating than changing to another: This means rating matrices are strongly diagonal dominant, i.e. for i = 1, . . . , K

3.
Lower rated entities are more likely to default: This means that the default column is increasing from best starting rating to lowest, i.e.
4. The rating spreads more over time: We measure this by looking for decreasing diagonal elements, i.e. for all s < t and all i = 1, . . . , K These properties are not strict in the sense that they can be violated on some occasions.
Moreover, one might think of other properties for rating matrices. Also for long term rating matrices (more than 1 year) these properties might not hold true anymore. This makes it very hard to define rigorous conditions for rating matrices in general and are subject to future research and economical validation.
In Table 2 we can see a summary of the rating properties (4.1)-(4.4) for the training data set. The numbers represent the percentages of time-sequences satisfying the conditions averaged over all initial ratings. For the rating spreads over time, we consider time steps from 0 to 1 month, 1 to 3, 3 to 6 and 6 to 12 and write down the percentages for t = 1, 3, 6, 12 respectively. We can see that all of the rating matrices in the training data set were strongly diagonal dominant and nearly all had monotone increasing default columns.
The majority of the rating matrices put more emphasis on downgrading for time spans between one month and six months, while for one year all of them satisfied the condition.
For the increasing rating spread we see the biggest violations of the property. This is most likely due to the fact that we consider all permutations of the data. It might be beneficial to filter these sequences out of the training set.     Table 3 we see exactly the same table for TimeGAN using M = 12000 synthetic timesequences. Even though we did not impose any hard constraints, e.g. that rows must sum up to one, the DNN learned the conditions (4.1)-(4.4) very well, as well as that rows must sum to one. The only criterion which was not always satisfied was again (4.4) but less severe than for the training data. Since these properties are almost always satisfied we did not optimize the hyperparameters or network architecture any further.

Calibration of the rating SDE
Before we start to explain, how we calibrate R SDE t to R GAN t let us explain why we do not calibrate directly to the historical data. Suppose that we select one specific time series of historical rating matrices and try to fit our model in a least-square sense in expectation.
Then, the randomness should be eliminated by the optimizer since we want to fit all the different trajectories to one time sequence. This is not the way to go, if we desire a stochastic model for the rating transitions. Another approach would be considering all of the training data set, sample as many trajectories and calibrate again in a least-square sense. There is no reason, why each of the random trajectories should match the particular rating matrix where it is subtracted from, maybe it would match another one perfectly. So comparing trajectories does not make much sense either.
Hence, it makes more sense to compare distributions or moments of the data and the model. Now, the problem with using the historical rating matrices directly in this approach would be that at each specific point in time, we only have a few available matrices. Take for example the one year rating matrices, we only have 9 different matrices. Discussing a distribution of such a sample size is not very insightful.
Therefore, we rely on the ability of the TimeGAN to learn the behaviour of the time series of rating matrices. As aforementioned, considering the time series allows us to artificially To be more precise, we use the standard estimators for mean, variance and moments of higher order in our experiments, i.e. for k = 3, . . . , n, n ∈ N, Let Π denote the parameter set. Then, our objective function f n : Π → R n·(K−1)·K is given by where w k ∈ R ≥0 are weights and our minimisation problem can be formulated as a non-linear least square problem Of course, this procedure can be generalized by considering multiple points in time. Since this minimisation problem is very dependent on the performance of the DNN and its ability to learn the distribution of rating transition matrices from the historical data, one can also think of a penalized version of (4.5). For example one can add another least-square term for the most recent time series, i.e.
where · F denotes the Frobenius norm and λ 1 , λ 2 ≥ 0 are weights. We will make the code publicly available and leave this experiment for the reader.
Remark 4.1. As aforementioned, using rating matrices with more than four ratings is straightforward in this approach. Since the SDEs in the Lie algebra are decoupled and can be computed in parallel, solving them will not lead to a major performance bottleneck compared to fewer ratings. The more relevant issue is that the number of parameters in the calibration increases quadratically, making it more and more important to use some principle component analysis to make the calibration more efficient. A possibility to use the autoencoder of the TimeGAN comes to mind, this is however subject to future research.
Also it is straightforward to remove the condition that the default rating is absorbing. In this case, we would need (K − 1) · K decoupled SDEs in the Lie algebra.

The case of direct exponential mapping.
Let us now consider R CIR t := exp (L t ), where Each of the SDEs have a parameter for the mean-reversion b i , mean-reversion speed a i and volatility σ i , which are all assumed to be positive. During our calibration procedure we allow the Feller-condition to be violated for simplicity. The parameter set is therefore given by positive real numbers Π CIR := R by stacking the individual parameters below each other. We found during our experiments that values between zero and one worked best. We  Table 4. The first column explains to which basis element the coefficients belong.
To be more precise, 2-3 means that the initial rating is 2 and at t = 1 we transition to rating 3. The minimisation error (4.5) in this case was 7.494e − 05, telling us that the moments up to order 4 match very well and it took roughly 68.5 seconds using lsqnonlin with the Trust-Region-Reflective algorithm. In Figure 5, we can see the trajectories of R CIR  Table 4.
SDE on the appropriate half-space of the Lie group directly. To do this, it would be necessary to use SDEs respecting the underlying geometry, i.e. Stratonovich-SDEs, since they obey the chain rule, or the Itô counterpart by Itô-Stratonovich conversion.
In this line of research, numerical methods such as Runge-Kutta-Munthe-Kaas (RKMK) or the Magnus expansion are available, see for instance [14] and [8] for more details.
The advantage of studying these SDEs directly on the Lie group are that one can check more easily if the SDE will satisfy the rating matrix properties.

Analysis of the rating distributions and properties
Since we expect that downgrades are more likely than upgrades, we expect that the rating distributions should be skewed with one tail being fatter than the other. We can see this in both Figure  For R CIR t we see a close match of the beta distribution to the histograms and match our initial intuition that the model should have one tail being fatter than the other.
In Figure 6 we see in most of the subfigures a good match of the shapes of the beta distributions of R GAN and R CIR even though the CIR processes have constant coefficients and are calibrated to the moments of R GAN at t = 1. We saw the same for t = 1, 3 months and therefore decided not to put the figures to shorten the presentation.  Let us now assess the quality of the model rating matrices as for the training data set and TimeGAN by (4.1)-(4.4). Table 5 is structured exactly like Table 2. We can see similar results to Table 3. Almost all the conditions are satisfied perfectly except for (4.4), where only 7 % violated the condition at t = 6, 12 months. Another downside of this method can be seen in Figure 5 by focusing on the blue trajectory in the default-column. It seems possible that the default is not absorbing because the trajectories are not monotonically increasing, only the mean is increasing. This could be viable if we allow companies to recover from default over time if they were not bankrupt from begin with, which in fact would be more realistic, because otherwise either every entity would eventually default or at some point no entity would default anymore. Also it could be interesting to study conditions in this setting to ensure monotone increasing paths in the default column, which is subject to future research.
We will see in the next section that the geometric Euler approach will not suffer from this problem.

The case of geometric Euler Maruyama.
Let us now consider R gEM t and assume that each of the SDEs are given by They have a parameter for a constant drift b i , power a i and volatility σ i , which are all assumed to be positive. The parameter set is therefore given by positive real numbers Π gEM := by stacking the individual parameters below each other. We found during our experiments that values between zero and two worked best. We calibrated R gEM  Table 6. The first column explains to which basis element the coefficients belong. To be more precise, 2 − 3 means starting rating is 2 and at t = 1 we transition to rating 3. The minimisation error (4.5) in this case was 5.265e − 05., telling us that the moments up to order 4 match very well and it took roughly 1058 seconds using lsqnonlin with the Trust-Region-Reflective algorithm.
In Figure 8 we can see the trajectories of R gEM    Table 6.
that the paths are much smoother compared to Figure  suggesting that we should either use time-dependent parameters or different SDEs. Figure 9 and Figure 10 we can see the analogue of Figure 6 and Figure 7 from Section 4.3. We used the same trajectories of R GAN t in these plots to be able to compare both methods amongst each other.

Analysis of the rating distributions and properties In
Let us focus for the moment on Figure 10, i.e. the rating transitions for one year. For R gEM t we see a close match of the beta distribution to the histograms as well. Also we see a very good fit of the beta distributions of R GAN and R gEM towards each other. This fit looks even closer than in Figure 7 for R GAN and R CIR .

Conclusion and future research
In Figure 9, the six month rating transitions, we see a worse fit to the data than we saw in  were satisfied perfectly for this model.

Conclusion and future research
In this paper, we developed a novel methodology in the community of rating transition modelling, making it possible to formulate rating transitions as processes on Lie groups by using its relation to its Lie algebra and imposing SDEs there. We showed two different approaches, first the direct exponential mapping in Section 4.3 and showed numerical results using CIR processes in the Lie algebra. Second we demonstrated, how the geometric Euler method can be applied to preserve the Chapman-Kolmogorov equations in Section 4.4. In Table 7 we compare the two methods and their features.
Simple method with fast calibration More complex with slower calibration Needs only L i t to be positive Requires that L i t has monotonically increasing paths Satisfies all rating properties well Satisfies all rating properties perfectly Does not satisfy the Chapman-Kolmogorov equations Satisfies Chapman-Kolmogorov equations Default column is not absorbing Default column is absorbing As mentioned at various points throughout this paper, there are many possibilities for future research.
For instance, we could try to learn the historical generators instead of the rating transitions.
In this case, we would be able to calibrate the SDE on the Lie algebra to the fake generators.
Also novel neural network architectures called DeepONets (cf. [12]) could be thought of in this framework.
Another line of research could involve adding an additional network to the TimeGAN which outputs the calibrated parameters of the target SDE directly. It would be beneficial to link the Autoencoder or Supervisor network to this new network to exploit dimensionality reductions.
In a next step, we would like to include the possibility to furthermore calibrate the rating SDE to Credit-Default-Swap (CDS) quotes under the risk-neutral measure. This extension will be useful for instance in the context of rating triggers under a netting agreement with Credit-Support-Annex (CSA) for valuation adjustments.

Declarations Funding
This project has received funding from the European Union's Horizon 2020 research and innovation programme under the Marie Sklodowska-Curie grant agreement No 813261 and is part of the ABC-EU-XVA project.

Conflicts of interests
The authors have no relevant financial or non-financial interests to disclose.