{'fraction_non_alphanumeric': 0.02432553492058023, 'fraction_numerical': 0.005822967990903766, 'mean_word_length': 4.756445854819516, 'pattern_counts': {'":': 0, '<': 0, '<?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': 3, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
Correlation Patterns in Foreign Exchange Markets

The value of an asset in a financial market is given in terms of another asset known as numeraire. The dynamics of the value is non-stationary and hence, to quantify the relationships between different assets, one requires convenient measures such as the means and covariances of the respective log returns. Here, we develop transformation equations for these means and covariances when one changes the numeraire. The results are verified by a thorough empirical analysis capturing the dynamics of numerous assets in a foreign exchange market. We show that the partial correlations between pairs of assets are invariant under the change of the numeraire. This observable quantifies the relationship between two assets, while the influence of the rest is removed. As such the partial correlations uncover intriguing observations which may not be easily noticed in the ordinary correlation analysis.


Introduction
Financial markets' data has traditionally challenged economists, mathematicians, and statisticians. However, in recent years, physicists have joined in providing answers on different features of these data which resulted in the emergent field of econophysics [1].
A particularly interesting feature of financial markets data is the, not yet fully explored, complex interdependent dynamics of the prices between various assets, which is most often modeled through the empirical correlations. This issue has been of specific value to the econophysics community and its members have provided numerous contributions addressing the relationships between stocks, market indexes and currencies [2,3,4,5,6,7,8,9,10].
In a foreign exchange market, the pairwise correlations between assets constitute a matrix. To understand the significant relationships in this matrix, one usually constructs a network by linking the strongly correlated pairs. The pairs are usually chosen via standard algorithms, such as Minimum Spanning Tree (MST) [2] or Planar Maximally Filtered Graph (PMFG) [11,12]. It has been acknowledged that the correlation matrix and hence the networks generated by MST and PMFG, in general depend on the choice of the base asset, formally known as numeraire, used to measure the value of all other assets. Moreover, changing the numeraire may also distort the plausibility of several economic theories. For instance, the key theory of exchange rates, the Purchasing Power Parity, relies on numeraire invariance, i.e., different numeraires should yield same conclusions. However, a growing body of literature negates the empirical validity of this property in foreign exchange markets [13,14,15]. In spite of these observations, the exact implications created by substituting the numeraire for another asset are yet to be determined.
Relating variables measured in different reference frames has a long history in physics. For example, the famous Galilean [16] and Lorentz [17] transformations are used for establishing correspondences between kinematic variables in classical and relativistic scenarios, respectively. Evidently, the role of reference frame in finance is played by the numeraire. In stock markets the natural choice of numeraire is the domestic currency, whereas at a foreign exchange different assets may fit for this purpose. In studies examining the properties of the latter markets, usually the most traded asset is taken as numeraire, while another less liquid asset is used to compare the results [6,8].
Motivated by these observations, here we derive the transformation equations for the key statistical quantities (means and covariances) when the numeraire is changed. As an application of these transformations, we discuss the choice of numeraire used for valuing the performance of a portfolio of assets, and provide arguments that the most appropriate numeraire is the local currency of the investor. More importantly, we give a thorough empirical analysis which not only confirms our findings, but also provides a detailed overview on the influence of the numeraire choice on the resulting correlations. In particular, we show that there is a typical pattern where certain correlations which are significant in one numeraire become insignificant in another.
Finally, we also comment on a numeraire invariant measure for capturing the correlation between assets. In fact, we find that one such measure is the partial correlation -the quantification of the linear relationship between two assets while controlling for the potential effect of all other assets in the market. As such, a network constructed via the partial correlations may provide a more adequate illustration on the pairwise relationships in a foreign exchange market.
The rest of the paper is organized as follows. In Section 2 we begin by providing the theoretical background and analysis of the problem of numeraire change. Section 3 describes the data used for empirical verification of the developed theory. In Section 4 we present the empirical results and discuss the implications created by substituting the numeraire. Finally, Section 5 summarizes our findings.

Theoretical analysis
The dynamics of exchange rates is in general non-stationary, and hence non-ergodic. This implies that one cannot exploit the raw values to examine the relationships between different assets. A convenient way to circumvent this problem is to instead focus on the logarithmic returns of exchange rates, which are known for their stationary dynamics [18].
We assume that the distribution of these log returns is multivariate Gaussian, which is a plausible assumption under the efficient market hypothesis [19], even though there are observations suggesting otherwise [20,21,22]. It is widely known that the Gaussian distribution is fully defined by its mean and covariance structure, which in turn is dependent on the chosen numeraire. This is of particular relevance in a foreign exchange market, as in it the value of any asset is given as a ratio with respect to another asset, i.e. the exchange rate. Thus, there is no single value of an asset, but many relative prices expressed in terms of the other assets. Once one selects a numeraire, even a random one, and hence determines the value of some asset in the market, in absence of arbitrage the values of the remaining ones are also determined. This is analogous to the assignment of a voltage to some node, which uniquely determines the voltages of all other nodes in an electrical circuit. In the following we analytically evaluate the consequences of changing numeraire on the values of the means, covariances and correlations in an arbitrary foreign exchange market.

Mean and covariance transformations
We begin by assuming that the observations arrive discretely at moments 1, 2, . . . , and randomly assign values to one of the currencies U 1 , U 2 , . . . . The values of the remaining currencies are then determined from the existing exchange rates. This indicates that the log return x u of any currency X given in the numeraire U at a particular moment n would be The return x w of X in another numeraire W is simple linear combination of the returns Since we are working with ergodic observables, we can apply the averaging rules, and conclude that the change of numeraire results in linear transformation of the mean of log returns as well, where the brackets denote averages. The covariance between the log returns of currencies X and Y in the first numeraire U is defined as (4) By using the return transformations (2) in the definition of the covariance (4), after simple algebra one can easily show that the covariance in the second base is The last expression is transformation of the covariance from one numeraire to another, and resembles those used in kinematics. Furthermore, from (5) we can directly extract the Pearson correlation coefficient, r w x,y = C w x,y / C w x,x C w y,y , as We note that a special case of the relationship (5) is the variance transform C w x,x = C u x,x − 2C u x,w + C u w,w , which has relevance in calculation of covariances when the three necessary variances are known [23,24]. This relationship is widely used in determining the covariance between two assets from the corresponding values of their implied variances, which in turn are estimated from the respective option prices [25,26].

Variance of portfolio
Modern portfolio theory states that the optimal portfolio is achieved by diversifying investments in a combination which leads to the lowest variance for given mean. It is evident that, in this aspect, changing the numeraire also modifies the parameter values of the portfolio -its expected return and variance. To find the respective transformation that is needed when one changes the numeraire, we consider a portfolio of assets, X 1 , X 2 , , . . . , X N , which under base U has value X u = N i=1 α i (X i /U ), where α i is the share of investments in X i . Consequently, its return in units of U is The portfolio return changes in the same manner as in equation (1), and its value in the numeraire W is Going further one can obtain the variance of the portfolio in numeraire U as After expanding the terms appearing in the transformation of the portfolio return (8) into the definition of the covariance (4) and some rearrangements we find that This is compactly written as by defining C u x,w = 2 N i=1 α i C u xi,w as the covariance between the portfolio and the second numeraire W observed from the point of view of the first one U .
Similarly to the twin paradox in special relativity [27], the dependence of the variance on the base currency poses a dilemma about which numeraire should be used as reference frame. To resolve this issue, let us assume that a particular investor is in a country with currency U . In order to finance a portfolio with starting value X(s) the agent should borrow the same amount in currency U from a local bank, and return it later at the final moment f , again in the same currency. Furthermore, suppose that the bank interest rate is zero and that the portfolio is valued at one currency unit U . Then, the initial and final wealth of the investor are correspondingly 0 and X u (f ) − U . The variance of the portfolio is given by equation (9).
The same investor should observe the variance expressed in the numeraire W only if it is initially financed by a credit denominated in that asset. This follows by observing the initial credit U/W (s), as valued in the second asset, and then purchasing the portfolio. In particular, by assuming negligible transaction costs (for simplicity), the value of the portfolio at purchase is in W currency units, with the same expression holding at the closing time f . If one substitutes the final and starting moments f and s, with n and n − 1 respectively, the return on the portfolio is given as in (8) This means that the log return of the investments is in one part due to the portfolio return x u and in another one due to the exchange rate return w u between W and U . On the other hand, it is obvious that the return of the borrowing cancels the exchange rate contribution of the return in investments since its value is −w u . Consequently, the return on the portfolio and respectively its variance is identical in both cases, which means that it might be more convenient for the investor to use its domestic currency as numeraire.

Partial correlation
To account for the possibility that other variables drive the relationship between the two variables under study, one calculates the respective partial correlation [10,28,29]. For the case of foreign exchange markets, this translates to the correlation between the log return of two assets controlled for the return of all other assets exchanged in the market.
To examine the numeraire dependence of this quantity, let us first define the set R containing all possible returns of all assets in the foreign exchange as valued in every possible numeraire. Then, the partial correlation between the returns of assets X and Y valued in numeraire U reads The partial correlation with numeraire W is defined in the same way, only conditioned on R\{x w , y w }. Notice that the linear transformation between the returns of x in u and w, x w = x u − w u , contains the constant term w u which is the sets of known variables in consideration of the two partial correlations ρ u x,y and ρ w x,y . Combining this fact with the property that adding constants in two variables does not change their correlation, implies that we can write the latter partial correlation as Hence, the partial correlation between the return of two assets controlled for the returns of all other assets traded in the market, is invariant on the numeraire. As a side note, we point out that such partial correlations are easily calculated through the precision matrix P which is the inverse of the correlation matrix C, and by utilizing the following normalization for each pair of assets X and Y [30].

Data
To verify the presented findings, we study market data provided by the Pacific Exchange Rate Service Dataset 1 (PERS). PERS is a freely available dataset which provides daily values of 92 currencies and commodities priced in various numeraires. In the analysis, we opted to include commodities because combining them with currencies allows for capturing more general patterns in financial markets. In fact, as we will see later on, there appear direct relations between the currencies and commodities.
As a time frame we utilized the four year period between 2014 and 2017. Since calculation of the log returns requires data for two consecutive days, we excluded from the analysis all data points for which there was no consecutive data 2 . Finally, from the analysis we excluded all currencies for which there were at least ten missing values and those assets that have constant exchange rates with the USD for at least five working days. We note that the considered period, the precious metals present in the dataset have around 30 missing values. Nevertheless, we kept them in the analysis as they may represent a significant driver in the returns of several currencies. Altogether, we ended up with 897 log returns data for 48 currencies and 5 commodities. The names of the assets together with their abbreviations are listed in Table 1. We point out that the initial data was gathered with US dollar (USD) as numeraire. When calculating the asset values in other numeraires we utilized the triangular equivalence, i.e., a rate X/Y was estimated from the known X/Z and Y /Z as X/Y = (X/Z)/(Y /Z). This is a common approach [31], even though small deviations from the real values known as triangular arbitrage, were found on shorter time scales. On longer scales, such as the daily ones, they are negligible [21]. Once all exchange rates were determined, by taking each of the 53 assets as numeraire, we calculated the daily log returns of the remaining 52 assets, and estimated the corresponding covariance and correlation matrices. To test the significance of all terms in the correlation (covariance) matrices we implemented the Bonferroni correction [32,33]. Under this test, the level of significance is given by dividing the level of significance under single test with the number of elements in the correlation matrix. Accordingly, we took the level of significance to be 0.05/(53 · 53).

Empirical validation of the transformations
First, we verify the validity of the transformations developed in the previous section. For this purpose, in Fig. 1 we plot heat maps for the empirical correlations between the studied assets as valued in EUR (Fig. 1a) and in USD (Fig. 1b), and their corresponding transformed correlations, from USD to EUR in Fig. 1c and from EUR to USD in Fig. 1d. One can easily notice the striking resemblance between these two types of correlations. In fact, the coefficient of determination, which quantifies the percentage of the variance in the empirical correlations explained with the transformed correlations, states that almost 100 percent of the variance in both the EUR matrix and USD matrix is explained with the transformations. The same conclusion holds for all other empirical correlations and transformation pairs. Fig. 1 also reveals the known fact that the numeraire ultimately determines the relationships in the correlation matrix [6,7,8]. While one typically uses the correlation matrix to build networks via MST or PMFG, and thus study the leading currencies and the clusters of mutually related assets, here instead we focus on the properties of the correlation matrix. Even though, this is not necessarily the same, we point out that the properties of the correlation matrix are those which uniquely determine the structure of the network.

Implications of changing the numeraire
For this purpose we turn our attention to the correlation matrix as estimated with USD as base currency. In the Appendix in Table 4 are shown the correlation coefficients obtained with this currency as numeraire, which are larger than 0.6. In order to extract the more significant ones, we apply filtering by considering only ones that exceed certain threshold.
First, when the threshold is 0.9, one can notice that for this numeraire the strongest positive correlations appear between the currencies of oil exporting Middle Eastern countries, i.e. between AED, KWD and SAR. They are accompanied by a clique of European currencies, CZK, DKK, EUR, and HRK together with the North African MAD. By lowering the threshold to 0.8, HUF and the PLN join the European cluster, while taking an even lower threshold of 0.6, further adds NOK, SEK and TND to the group. At the same time, this results in emergence of an East Asian clique containing the KRW, SGD and TWD, and significance in the correlation between the Oceania pair of AUD and NZD. One can easily hypothesize that the existence of these relations has roots in the geographical proximity of the countries, and hence increased economic interdependence. Without going into further analysis of the other, weaker correlation patterns, we just note that the three major currencies CHF, GBP and JPY in these USD-based calculations are close to the European cluster. The last currency also has very strong correlation with the gold.
If one uses another currency as numeraire, for instance EUR, remarkable differences in the correlation coefficients from those observed in the USD-based calculations are identified. By considering the correlations larger than 0.9, given in the Appendix in Table 5, one can notice that the Middle East currency trio AED, KWD and SAR is present again. Also a new clique of correlations exceeding 0.9 arises and which consists of CNY, JMD, HKD, LKR and USD. In addition, the correlation between XCD and HKD is also above 0.9. By decreasing the threshold, the later two cliques coalesce, while simultaneously attracting new Asian currencies, in particular, INR, PHP, THB and TWD together with the Latin American PEN, to the cluster. Further lowering the threshold to 0.6 results in inclusion of new members to the big cluster. The new members are the Asian IDR, ILS, KRW, MYR, SGD, and VND, the Latin American currencies CLP and HNL and the CAD. Also, under a lowered threshold one notices the correlation between the Oceania couple AUD and NZD and the joining of MAD to the USD-based mega cluster. It is worth to point out that the MAD was discovered to be rather correlated to the European currencies when observed from the USD as numeraire.
From this correlation analysis one notices that the European cluster appears within USD-based calculations, while the currencies that closely track the dynamics of the US dollar can be detected when EUR is the numeraire. From this observation one could further conjecture a test for determining the strong correlations between two assets X and Y based on two conditions. First, they should be highly correlated in various numeraires, and second, when one of them is used as numeraire (for example X), the correlations of the other, Y , with the remaining assets should become smaller. Loosely speaking, in base currency X the correlations of Y with the others are masked. If any other currency Z is correlated to both X and Y , then the correlation between X and Y in numeraire Z, with the other currencies U , r z y,u and r z x,u , will be small as well. Thus, using the CZK, DKK, or HRK as numeraire produces similar results as EUR -weak correlations of the other currencies from this European group with the rest, while keeping the Middle East and USD clusters of highly correlated currencies. We also found that the masking phenomenon has an effect even on the currencies which could not be easily associated to some cluster. For example, when considered EUR as base currency, the CHF, GBP, and JPY seem to be more correlated to the currencies of the USD cluster, while as seen from the USD perspective they appear closer to the European group.
To confirm the masking phenomenon we also considered using SAR as numeraire, which is the currency of the largest country of the strongly correlated Middle East trio. The respective Pearson correlation coefficients exceeding 0.6 are provided in the Appendix in Table 6. When filtering the correlations larger than 0.9 one discovers only the European clique, consisting of the CZK, DKK, EUR, HRK and MAD, while a USD-based cluster containing CNY, HKD, JMD, and LKR, appears when the threshold is lowered to 0.8. Again, by considering even weaker correlations, other currencies join to the respective groups, until they merge into one big cluster. For this numeraire we found an interesting exception of the masking phenomenon, i.e., we discovered a high correlation of 0.82 between AED and BHD which was previously missing. This suggests that BHD should belong to a cluster where AED is. As we pointed out previously, such strong correlation should also be observed from other numeraires like the EUR or USD. In fact, the masking should result in weak correlation between AED and BHD when the numeraire is SAR, since, as discovered from the view of the two previous numeraires, SAR is rather closely related to AED. Nevertheless, the results show the opposite. The interpretation behind this finding may be due to the fact both AED and BHD are currencies of oil exporting countries, or due to the economic relations with other countries. In what follows we will offer further indications for the plausibility of the second interpretation, since a very strong but negative partial correlation between SAR and BHD appears. Lastly, we note that using SAR as numeraire pushes the CHF, GBP, and JPY closer to EUR, whereas the previously observed strong correlation of JPY with the gold persists since JPY does not belong to either of the USD and EUR groups.

Robustness of correlated pairs
As a means to understand the influence of the choice of numeraire on the correlations between other currencies that probably have more independent dynamics, for each asset X we determined the maximal correlation under numeraire U , i.e., by searching for it over all other assets Z. The asset Y for which the strongest correlation r u x,max is obtained can be considered as the most similar to X when the numeraire is U . Obviously, this similarity relationship is asymmetrical, and by substituting the numeraire, the most similar asset to X could change as well. In this regard, by taking all numeraires under consideration, for each asset we estimate the number of occurrences of most similar assets. This allows us to effectively reduce the impact of numeraire in determining the similarity and thus develop a robust measure for the significance of the similarity. Clearly, higher number of such occurrences does not imply more pronounced similarity between two assets, as it does not quantify the magnitude of it. It only offers a robust way to identify the asset which most often appears to be "closest" in terms of correlation. Even though, this approach may appear more computationally demanding than the standardly used MST and PMFG, it offers a more comprehensive overview of quantifying the most similar asset as it considers all possible numeraires.
The results can be seen in Table 2 where we report each asset X alongside its most similar asset Y and the number of different numeraires under which Y is most similar to X. It can be easily noticed that similar results to the previous discussion regarding the USD, EUR and Middle Eastern cluster hold. Besides this, the performed analysis is able to uncover novel information about the correlation structure. Concretely, here we observe the similarity between Latin American BLR, CLP, COP and MXN, as well as between certain currencies from Asia. From the studied precious metals, the silver and platinum seem to exhibit similar dynamics to that of the gold, while the gold remains most similar to JPY. Moreover, we notice that GBP appears most similar to SGD instead of any other European currency, even when accounting for every possible numeraire from Europe, as compared to the SGD alone. Finally, we remark that HKD and SGD are the two assets which are most similar to the others. While the former currency may appear as a central regional trade unit, due to the fixed exchange rate to the USD, the later has a bigger role in global trading.

Network of partial correlations
Using the same data, we estimated the partial correlation between the assets, and as described in the Data section, we used the statistically significant relationships to build a network which describes their relatedness.
The statistically significant partial correlations are given in Table 3, while the resulting network is illustrated in Fig. 2. The network is largely disconnected with only several isolated clusters being formed which can be explained by considering the geographical proximity of countries again. We note that similar findings about the relations between currencies of neighboring countries have been previously obtained with the MST technique [5,8].
In particular, the largest cluster consists mainly of currencies from South and East Asia. In addition, precious metals can be found in this cluster due to their relation with JPY and THB. Here, it is also noteworthy to point out that the GBP exhibits negative partial correlation with JPY. Another easily interpretable cluster is the group of interconnected European currencies consisting of CZK, DKK, EUR, HRK, ISK and MAD. Interestingly, other European currencies, specifically PLN and HUF, are instead connected to a USD-based cluster due to the negative partial correlation between PLN and USD. This cluster further includes HKD, LKR and JML. The next cluster consists of the Middle east currencies AED, KWD and SAR, which are acompanied with BHD due to its rather strong negative partial correlation with AED.
A rather intriguing cluster centred around MXN appears. This cluster, on the one hand, consists of neighboring Latin American currencies BRL, COP and CLP, and the geographically distant currencies ZAR nad TRY, on the other hand. The last cluster describes the relationships between oiled-based assets, mainly due to the price of West Texas Intermediate being partially correlated with the CAD, whereas the Brent Crude oil is related with RUB. Moreover, the oil production industry is probably the cause for the positive partial correlation between RUB and NOK, which in turn puts the latter with the neighboring SEK into this group, rather than into the EUR-based one. We point out that NOK and SEK have more strong unconditional correlations with the currencies from the other other EU countries than with the RUB. In this cluster the Oceania pair of AUD and NZD is included due to the significant partial correlation between AUD and CAD. Finally, INR and PHP form an isolated pair of mutually influential currencies from neighboring countries. Table 2: Most similar assets. The most similar peer (second and fifth column) to certain asset (first and fourth column) is the one which has strongest correlation to the latter in largest number of different numeraires. The number of such occurrences for each pair is given in the third and sixth column.

Conclusions
In short summary, in this paper we investigated how the means, covariances and correlations of the logarithmic returns of assets are modified when the numeraire in a foreign exchange is changed. We also showed that the same techniques can be applied for the portfolio of an investor, and thus identify the most appropriate numeraire for him/her to use. This Figure 2: Partial correlation network. The edges represent statistically significant partial correlations.
turned out to be the domestic currency of the investor. Finally, we showed that while the magnitude of the ordinary correlations are highly dependent on the choice of numeraire, the partial correlations are invariant in this aspect. The empirial analysis easily confirmed these findings.