Approximating Correlation Matrices Using Stochastic Lie Group Methods

: Specifying time-dependent correlation matrices is a problem that occurs in several important areas of ﬁnance and risk management. The goal of this work is to tackle this problem by applying techniques of geometric integration in ﬁnancial mathematics, i.e., to combine two ﬁelds of numerical mathematics that have not been studied yet jointly. Based on isospectral ﬂows we create valid time-dependent correlation matrices, so called correlation ﬂows, by solving a stochastic differential equation (SDE) that evolves in the special orthogonal group. Since the geometric structure of the special orthogonal group needs to be preserved we use stochastic Lie group integrators to solve this SDE. An application example is presented to illustrate this novel methodology.


Introduction
Correlation matrices play an important role e.g., in finance and risk management. A valid correlation matrix is a real matrix with the following properties: 1.
All diagonal elements of a correlation matrix are equal to one and absolute values of all non-diagonal elements are less than or equal to one.

2.
Correlation matrices are real symmetric and positive semi-definite, i.e. all eigenvalues are non-negative.
In this paper our goal is to construct time-dependent correlation matrices that fulfill the properties above and approximate the true correlation using real market data.
There are already methods available that were designed to tackle the same problem, see e.g., [1][2][3][4]. Newton-based methods for approximating covariance matrices can be found in [5][6][7]. Furthermore, there exist methods using hyperspherical decomposition [8] and unconstrained convex optimization [9]. But some methods show weaknesses in at least one of the desired properties of a correlation matrix mentioned above. Especially, the positive semi-definiteness is a criteria which is not well implemented. For example, the approach of [10] suffers from drawbacks in other portions of the matrix in order to maintain positive semi-definiteness.
Here we ensure the positive semi-definiteness of the correlation matrices constructed with our methodology by taking up the idea of [11]. The authors defined covariance flows based on isospectral flows by constructing matrices similar to an initial valid covariance matrix. This is a well-analyzed approach but still it lacks the stochastic nature of correlations.
In our methodology we include the stochastic behaviour of correlations by assuming that the orthogonal matrices needed for the covariance flows are driven by a stochastic differential equation (SDE) rather than an ordinary differential equation (ODE). Since the space of orthogonal matrices can be viewed as a Lie group, we use Lie group integrators [12] to solve this SDE. Lie group methods arose in the deterministic case for solving ODEs such that geometric properties of the Lie group are preserved, see e.g., [13,14] and ( [15], p. 126). Their application in the stochastic setting has been studied in e.g., [16][17][18]. So far, stochastic Lie group methods were mostly applied to SDEs considered in information theory [19] and engineering [20]. For further concise literature on Lie group methods, we refer the interested reader e.g., to ([15], Chapter IV.8) or [13].
However, the application of Lie group methods on SDEs considered in finance has not been analyzed yet. Consequently, the contribution of our paper is twofold: we respect the stochastic behaviour of correlations by considering an SDE that evolves in a Lie group and we use a stochastic Lie group integrator in a financial mathematics context to get a numerical solution of the considered SDE.
Our methodology can be used e.g., if one wants to specify time-dependent correlation matrices in a given time interval and is only aware of the correlation matrix at the initial time point. In the following sections we aim to formulate an SDE that describes the correlation flows for the given time interval. Moreover, we approximate the solution of this SDE by applying the geometric Euler-Maruyama scheme presented in [18,21]. We demonstrate how techniques from geometric numerical integration which arose from a mechanical engineering background can be used in a financial mathematical setting.
The remainder of the paper is organized as follows. Covariance flows are introduced in Section 2. In Section 3 we present a numerical method to solve SDEs based on the relation between Lie group and Lie algebra. We then turn our attention to simulations and the application of our methodology in risk management by using real historical market data in Section 4. A discussion of our results is given in Section 5.

Covariance Flows
For creating valid time-dependent correlation matrices, we first introduce covariance flows {P t : 0 ≤ t ≤ T}. A covariance flow is a set of similar, time-dependent matrices P t of the covariance space P(n) = {P ∈ R n×n : P = P , x Px ≥ 0 for all x ∈ R n , n ∈ N}. (1) These covariance matrices can be easily transformed into corresponding correlation matrices R t . The computation of covariance flows is based on isospectral flows, see [11]. Due to the symmetry of covariance matrices the principal axis theorem can be applied, i.e., there exists an orthogonal matrix Q and a diagonal matrix D consisting of the eigenvalues of P such that P = Q DQ.
Without loss of generality, we can assume that Q is a rotation matrix whose determinant is always equal to 1. Thus, we assume Q to be an element of the special orthogonal group where GL(n) is the general linear group, i.e., the set of n × n invertible matrices. Since SO(n) defines a differentiable manifold and the matrix multiplication is a differentiable mapping, SO(n) is a matrix Lie group. The corresponding Lie algebra is denoted by so(n) and consists of skew-symmetric n × n-matrices, for details we refer to e.g., ([22], p. 58). Now let an initial covariance matrix P 0 be given. We consider the covariance flow Creating time-dependent covariance matrices P t that are similar to P 0 implies the generation of time-dependent, orthogonal matrices Q t , t ≥ 0. Therefore, we consider the following stochastic differential equation (SDE): where K t , V t,1 , V t,2 ∈ R n×n and W t,1 and W t,2 are independent, standard Brownian motions, i.e. it holds dW t,1 , dW t,2 ∼ N (0, dt). In order to ensure that the resulting matrices Q t have the desired properties, we use the characterization of K t , V t,1 and V t,2 defined in the following theorem.
A more general version and the proof of this theorem can be found in [18]. Theorem 1 suggests that the easiest way to determine the unknown matrices is to first find symmetric matrices V 2 t,1 and V 2 t,2 such that skew-symmetric square roots V t,1 and V t,2 exist. The matrix K t can then be identified as the lower triangular matrix of where the entries on the diagonal of K t are equal to 0.5 times the diagonal elements of Y 2 t . The matrices V t,1 , V t,2 and K t can be fixed according to a given problem.
Regarding our goal, which is the approximation of correlation matrices using real market data, we estimate the matrices V t,1 , V t,2 and K t from the considered market data by using a least-squares approach. We describe our initialization of these matrices more detailed in Section 4.

Stochastic Lie Group Method
In the following we are taking a closer look on the SDE (5) and how it can be solved numerically. In general, there is no closed form solution. However, a solution can be defined via a Magnus expansion Q t = Q 0 e Ω t , Ω 0 = 0, where Ω t ∈ R n×n obeys a matrix SDE. This auxiliary SDE is given in the following theorem and can also be found in [18]. where The expression d exp −1 −Ω (X) is given by where B k are the Bernoulli numbers and ad X (Y) = [X, Y] is the adjoint operator which is used iteratively In the case where the solution Q t of the SDE (5) is in the Lie group SO(n), it holds that the matrix SDE (6) evolves in the corresponding Lie algebra so(n) [18]. The Lie algebra so(n) is the tangent space of the differentiable manifold SO(n) at the identity, see e.g., ([22] p. 71). This simple Euclidean-like geometry of the Lie algebra can be used to solve SDEs that evolve in the associated Lie group.
Therefore, we compute a numerical solution of the SDE (5) by solving the SDE (6) e.g., with the Euler-Maruyama scheme in the Lie algebra so(n) and projecting this solution Ω t back onto the Lie group via the exponential map, exp : so(n) → SO(n), to get a solution for Q t . Since this scheme preserves the geometry of the manifold SO(n), it is called the geometric Euler-Maruyama scheme [18]. One can easily check that the geometry of SO(n), namely the condition Q t Q t = I, is not preserved if a numerical integration scheme is applied directly to (5) instead of (6). A simple version of the geometric Euler-Maruyama scheme applied to (5) is given in the following algorithm. It can be interpreted as a special case of a stochastic version of the Runge-Kutta-Munthe-Kaas schemes [14] and a more general version of the algorithm can also be found in [18].
There are only limited convergence results available for stochastic Lie group methods. However, it was proven in [21] that the geometric Euler-Maruyama scheme converges with rate O(∆ j ) with respect to mean uniform squared error over the whole interval [0, T].
In the Euler-Maruyama step of Algorithm 1 we truncated each of the infinite sums involved in (6) to the first summand only. The geometry is preserved under these truncations because for skew-symmetric matrices X and Y, the adjoint operator ad k X (Y) is also skew-symmetric for any k ≥ 0, which can be easily proved by induction. It follows that any truncation of Ω j+1 is in so(n) and thus, any projection of Ω j+1 is in SO(n).
In the Projection step of Algorithm 1 and in Theorem 2 the exponential map is used as a parametrization for the Lie group. However, the basic concepts of Lie group methods are not limited to this specific parametrization. One could also use other mappings, e.g., the Cayley transform cay(Ω) = (I − Ω) −1 (I + Ω). Since a truncation of infinite sums induced by the definition of the matrix exponential can be avoided, considering the Cayley map instead might be beneficial in cases of higher dimensions where no closed form expressions for the exponential map are available. A comparison of the usage of these two maps, exp(Ω) and cay(Ω), in the context of Lie group methods can be viewed in [23].
Initialization step: Let Q j be the approximation of Q t at t = t j . Analogously: K j , V j,1 and V j,2 .

Simulation
In this section we want to apply the method described in the previous sections to approximate correlations that can be observed in a real market. For this purpose we consider historical prices of the S&P 500 index and the Euro/US-Dollar exchange rate on a daily basis. We compute moving correlations with a window size of 30 days and obtain correlations from 3 January 2005 to 6 January 2006 (see Figure 1).

Date
Historical Correlation Figure 1. The 30-day historical correlations between S&P 500 and Euro/US-Dollar exchange rate, source of data: www.yahoo.com.
Assume the following scenario: A risk manager retrieves from the middle office's reporting system the initial correlation matrix at t = 0 (which corresponds to 3 January 2005) of the regarded historical data i.e., the Pearson correlation coefficient between the S&P 500 index and the Euro/US-Dollar exchange rate was computed as ρ = −0.0159. Due to the stochastic behaviour of correlations and the path shown in Figure 1 being only one of many possible realizations a density plot of the historical correlations is needed. Therefore, we suppose that the risk manager is aware of the density function of the considered correlation and estimate a density function from the historical data using kernel smoothing functions, which is also plotted in Figure 2. For more details on the density estimation see [24]. Then, the goal is to create valid time-dependent correlation matrices that reflect the stochastic nature of correlations while trying to match the density function of the historical data.

Construction of Covariance and Correlation Flows
Our methodology, which is designed to solve the risk manager's problem described in the scenario above, for approximating correlation matrices can be summarized by the following steps:

1.
Find matrices V t,1 , V t,2 and K t such that the conditions in Theorem 1, namely V t,1 , V t,2 ∈ so(n) and K t + K t = V 2 t,1 + V 2 t,2 , are fulfilled.

2.
Insert the matrices computed in the previous step into (5) and solve this SDE, i.e. dQ t = Q t K t dt + Q t V t,1 dW t,1 + V t,2 dW t,2 , Q 0 = I, by using Algorithm 1, the geometric Euler-Maruyama scheme.

3.
Compute for a given initial covariance matrix P 0 the covariance flow P t = Q t P 0 Q t . 4.
Transform the so computed covariance matrices P t to corresponding correlation

Setting the Coefficient Matrices
For the first step, we construct a symmetric matrix Y 2 t := V 2 t,1 + V 2 t,2 such that skewsymmetric matrices V t,1 and V t,2 can be derived. According to Rinehart [25], every real square root of a symmetric matrix is similar to a real skew square root of this matrix if it is negative semi-definite with nonzero eigenvalues that have even multiplicities. Regarding this required matrix structure, this step might seem like an obstacle. However, this initialization step is actually the part that gives the degrees of freedom needed to incorporate historical market data. To explain this further, we consider the following generator of so(2): An element of so(2) is then any scalar multiple of the generator: Together with a function g(t) : R ≥0 → R, an arbitrary time-dependent skew-symmetric matrix Y t can be defined as The function g(t) can be chosen arbitrarily, e.g., as a cubic polynomial. Experimenting with different functions, we found that the following function performed best given the historical data where x 1 , . . . , x 8 ∈ R represent parameters that can be associated with possible degrees of freedom. The symmetric matrices V 2 t,1 and V 2 t,2 can now be arranged, e.g., in a convex combination where x 9 ∈ [0, 1]. The so constructed V 2 t,1 (resp. V 2 t,2 ) fulfills the aforementioned requirements such that skew square roots V t,1 (resp. V t,2 ) can be computed. As mentioned before we set K t equal to the lower triangular matrix of Y 2 t where the diagonal elements of K t are equal to the diagonal entries of Y 2 t multiplied with 0.5.

Preparation for the Geometric Euler-Maruyama Scheme
For the second step, solving (5) with Algorithm 1, we chose to simulate 100 independent realizations of Brownian motions. As a result, we obtained M = 100 paths of skew-symmetric matrices Ω t at each time step t = t j+1 , j ≥ 0. Next, we computed the mean of these different paths as an estimator for the expectation value which we then projected onto SO(n) via the exponential map, i.e.
In the projection step of Algorithm 1 we used for fast computation which results from Taylor series expansion of sin ω and cos ω. If more than two correlations are considered, e.g., Ω ∈ so(3), then the Rodrigues formula ( [26], p. 261) can be used to avoid dealing with the infinite sum expression of the matrix exponential.

Computation of Covariance Flows
For the third step of computing covariance flows, we first need an initial P 0 to begin with. As in [11], we estimate the covariance matrix of the whole historical data by using the MATLAB function cov and as a result we got We keep the eigenvalues {0.2325 × 10 −4 , 0.4271 × 10 −4 } of this historical covariance matrix C and construct a P 0 with the same eigenvalues such that the corresponding correlation , is a good approximation for the given historical correlation matrix at t = 0. More precisely, we are looking for an orthogonal matrix H ∈ R 3×3 such that where D is a diagonal matrix containing the eigenvalues ofĈ multiplied with 1000.
Since the eigenvalues ofĈ are very small, multiplying with the factor 1000 simplifies the optimization procedure of finding a compatible initial matrix P 0 . The choice of this factor can be adapted according to the given historical data. In our experiments, the initial covariance matrix is found as whereas the orthogonal matrix used to get P 0 is given by Due to the construction of our covariance flow it follows that every computed covariance matrix P t = Q t P 0 Q t will be positive semi-definite and contain information from the whole historical data.

Computation of Correlation Flows
Finally, we convert the covariance flows to correlation flows by where Σ t = diag(P t ) 1 2 . The covariance flows or rather the correlation flows are computed such that the mean squared error between the empirical density function of the historical data f hist (z) and the empirical density function of the correlation flow f flow (z) is minimized where N is the number of points where the kernel smoothing function estimate is evaluated at. For the computation of both empirical density functions, f hist and f flow , we used the MATLAB function ksdensity.

Results
Taking up the risk manager's problem we assume that he followed the steps described above and implemented them in a software package of his choice. Implementing the steps of our methodology in the software package MATLAB we found that the error defined in (21) is minimized by the following choice of parameters  (12) and (13). The mean squared error using these parameters is 3.527 × 10 −3 . The corresponding density function of our correlation flow compared to the historical density function is plotted in Figure 3. The plot shows that the fitting by least-squares works well. The optimal bandwidth of the kernel smoothing function estimate of the historical data was computed to be 0.0559. We chose the same bandwidth for the density estimate

Discussion
We have presented a method to produce feasible covariance and correlation matrices. Based on isospectral flows we produced matrices similar to an initial valid covariance matrix, which we determined beforehand using historical data. In these covariance flows we assumed the required rotation matrices to be driven by an SDE in order to mimic the stochastic behaviour of correlations. These rotation matrices can be used to control the tendency of the corresponding correlation flows. For instance, one can require that the correlation flows match a desired density function.
Our generated covariance and correlation matrices are not only real symmetric and positive semi-definite but also exhibit stochastic behaviour. Hence, the correlation flows computed with our methodology have proven to fulfill the requirements for a valid correlation matrix while reflecting the randomness of correlations. In other words, we were able to expand the approach for constructing correlation flows presented in [11] by modelling an SDE for the underlying problem which we then solved by applying stochastic Lie group methods, i.e. we have shown that a financial mathematical problem can be solved by using methods of geometric numerical integration.
There are multiple possibilities to extend our presented methodology. For example, the function f (t) used in the linear combination (11) can be chosen such that even more degrees of freedom are involved. In the case where n > 2 correlations are considered and thus, a basis for so(n) with more elements (similar to (9)) is needed, one could incorporate as many functions for the linear combination as there are basis matrices. For the numerical integration of (6) one could also use a method of higher order. The Euler-Maruyama scheme in Algorithm 1 could for example be replaced by the Milstein scheme. By analyzing modified equations one could construct even higher order methods, see e.g., [27].