A note on the equivalence between the conditional uncorrelation and the independence of random variables

It is well known that while the independence of random variables implies zero correlation, the opposite is not true. Namely, uncorrelated random variables are not necessarily independent. In this note we show that the implication could be reversed if we consider the localised version of the correlation coefficient. More specifically, we show that if random variables are conditionally (locally) uncorrelated for any quantile conditioning sets, then they are independent. For simplicity, we focus on the absolutely continuous case. Also, we illustrate potential usefulness of the stated result using two simple examples.


Introduction
The concept of linear correlation was first presented in Galton (1889), see Stigler (1989) for a historical note on the correlation invention.While mathematically simple and elegant, statistical analysis based on correlation measurement could be confusing and lead to subtle errors if not treated with caution, see e.g.Aldrich (1995), Veličković (2015), and references therein.Since correlation aims to measure the linear dependence between random variables, it often fails to properly capture non-linear structures.Although the dependence could be fully described using the copula function, it is more appealing, especially to practitioners, to use simpler (numeric) characteristics to describe the degree of dependence, see Nelsen (2006) or Kotz and Drouet (2001).Because of that, a lot of alternative measures of dependence have been proposed in the literature and this field is constantly evolving.Let us alone mention the concepts of concordance measures, entropy correlations, projection correlations, tail correlations, partial and conditional correlations, maximal correlations, time-varying dynamic correlations, local Gaussian correlations, and distance correlations based on energy statistics, see Scarsini (1984); Rao et al. (2011); Zhu et al. (2017); Akemann et al. (1984); Baba et al. (2004); Kenett et al. (2015); Witsenhausen (1975); Aielli (2013); Tjøstheim and Hufthammer (2013); Székely et al. (2007); Tjøstheim et al. (2022), and references therein.
Typically, it is expected that the zero value of a given dependence measure should, in some sense, imply independence.What is interesting, at first, the concept of null linear correlation was often mixed with independence and it took some time for statisticians to distinguish between null correlation and statistical independence, see David (2009).Of course, it is currently well known that while the independence of random variables implies zero correlation, the opposite is not true, see Broffitt (1986) for a classroom example.
In this short paper we answer a simple question about how one can revert the aforementioned implication, i.e. whether one can use linear correlation to study (proper) independence.Allowing non-linear transforms of random variables, the reverse implication is in fact trivially true as one of the alternative definition of independence states that two random variables X and Y are independent, if f (X) and g(X) are uncorrelated for any test functions f and g; in fact, it is sufficient to consider set indicator functions to directly recover the definition of independence.Still, this characterisation is not appealing from practical perspective since it is hard to pre-set the family of test functions that would work for any arbitrary pair of random variables and lead to efficient statistical setup.Another approach is to consider a localised version of correlation and study its properties, see Section 6 in Kotz and Drouet (2001) for details.In this paper, following Jaworski and Pitera (2020), we propose to bind those two approaches together and consider a family of conditional correlations, where the conditioning is based on the quantile set linked to the values of X and Y , see Section 3 for details.In the main result of this paper, Theorem 1, we show that null correlation on every quantile set implies independence of random variables so that the aforementioned implication could be reverted by looking locally into linear relation between random variables.Namely, we show that random variables are independent if and only if they are locally linearly independent.Due to our best knowledge, quite surprisingly, this result has not been stated nor analysed previously in the literature -this is most likely due to the fact that localised correlations considered so far were not bound directly to quantile sets allowing efficient local treatment.
We believe that our proposal could be appealing to practitioners and could lead to development of new efficient statistical frameworks.In fact, the sample version of (local) quantile correlation could be easily computed using rank statistics and exhibits statistical properties similar to the unconditional correlation; this aspect is left to future research.In other words, the results presented in this paper lay the theoretical ground to expansion of the statistical framework based on quantile conditional moments which already proved to be useful, see e.g.Hebda-Sobkowicz et al. (2020), Jelito andPitera (2021), andPitera et al. (2022).As an example, one could define the conditional version of the auto-correlation function that could be used to study time-series which exhibits heavy tails, see Example 10 for details, or study the tail-based correlations to recover dependence conditioned on tail-events, see Jaworski and Pitera (2016).
This paper is organised as follows.In Section 2, we introduce the basic notation and define the concept of quantile conditional correlation.In Section 3, we state and prove the main result, Theorem 1, together with its multidimensional extensions.Finally, in Section 4, we show two simple examples that illustrate how our approach could be used to study dependence between random variables.

Preliminaries
Let (Ω, F, P) be a probability space and let (X, Y ) be a random vector defined on this space.By Sklar's theorem, we know that the joint distribution of (X, Y ) can be represented as where FX and FY denote the distributions of X and Y , respectively, and C is the copula function of the vector (X, Y ), see e.g.Theorem 2.3.3 in Nelsen (2006).For simplicity, from now on we assume that the vector (X, Y ) is absolutely continuous and use fX , fY , f , and c, to denote the density functions of X, Y , (X, Y ), and C, respectively.Also, we assume that FX and FY are bijective, the vector (X, Y ) has a full (non-degenerate) support, and the copula density c is continuous.In this case, the copula function C is unique and can be easily recovered from the joint distribution using the formula are the quantile functions of X and Y , respectively.Now, let us introduce a notation associated with quantile conditional covariances.Given a set A ∈ F, we define the conditional covariance of (X, Y ) on A by setting provided that the expectations are well-defined.In this paper, we are interested in quantile-based conditioning.Namely, given a vector (X, Y ) and quantile splits 0 < p1 < q1 < 1 and 0 < p2 < q2 < 1, we define the corresponding quantile set as Note that since we assumed a full support, we get P[A] > 0 for any quantile split.Also, since both X and Y are bounded on A, we get that (2) is well-defined and finite.Thus, we can also define the corresponding conditional correlation by setting , where From now on we assume that we are given specific quantile splits 0 < p1 < q1 < 1 and 0 < p2 < q2 < 1, and use A to denote the corresponding quantile set as defined in (3).For brevity, we also introduce the corresponding value projection set With this notation, we get that (2) could be expressed as We say that X and Y are conditionally uncorrelated on A, if CorA[X, Y ] = 0.

Main result
In this section we present the main result of this note, which shows that the independence of random variables could be linked to their conditional uncorrelation on any quantile set.
Theorem 1. Random variables X and Y are independent if and only if they are conditionally uncorrelated on every quantile set, i.e. for any quantile splits 0 < p1 < q1 < 1 and 0 < p2 < q2 < 1 and the related set A, we get CorA[X, Y ] = 0.
Second, let us show that (6) implies the independence of X and Y .Using (6) and recalling that C could be seen as a distribution function of a random vector with marginals distributed uniformly on [0, 1], for any x, y ∈ [0, 1] we get which shows that the copula of (X, Y ) is the product copula.Recalling (1), we get that X and Y are independent, which concludes the proof.
Remark 2 (Conditional Spearman's ρ and independence).From Theorem 1 one can easily deduce that random variables X and Y are independent if and only if conditional Spearman's ρ coefficient on every quantile set is equal to zero.To prove this is it enough to observe that Spearman's ρ is in fact Pearson's correlation applied to the copula function.
Remark 4 (Tail-event dependence and spatial contagion).From Theorem 1 we can see that to reject the (global) independence of X and Y , it is enough to find a single quantile split 0 < p1 < q1 < 1 and 0 < p2 < q2 < 1 on which the conditional quantile correlation is not equal to zero.In signal processing or financial time-series modelling, it is natural to consider left tail events, e.g. when one or both of the values q1 and q2 are small.Such events could be linked to the presence of the so-called spatial contagion in which dependence increases in the presence of system turbulence.This might be used to construct statistical frameworks based on quantile tail-event analysis, see Durante and Jaworski (2010), Jaworski and Pitera (2016), and references therein.
As we show now, Theorem 1 could be extended to the multivariate case.To get this extension, we use two alternative approaches.First, in Theorem 5, we consider a conditional correlation matrix.Second, in Theorem 6, we use linear combinations of margins.
Before we state the result, let us introduce some notation.Consider an n-dimensional random vector X = (X1, . . ., Xn) and assume that it satisfies the assumptions analogous to the ones used in Theorem 1, i.e. bijectiveness of the the marginal distribution functions, full support condition, absolute continuity of the joint distribution, and continuity of the copula density.Also, for any quantile splits 0 < pi < qi < 1, i = 1, . . ., n, we define the quantile set corresponding to (X1, . . ., Xn) by where Qi is the quantile function of Xi, i = 1, . . ., n.Finally, by ΣA we denote the associated conditional correlation matrix with the entries given by ΣA[i, j] := [CorA(Xi, Xj)], i, j = 1, . . ., n; we also use In to denote the n × n identity matrix.
Theorem 5.The n-dimensional random vector X has (jointly) independent margins if and only if for any quantile splits 0 < pi < qi < 1, i = 1, . . ., n, and the related set A, its conditional correlation matrix ΣA is equal to the identity matrix.
Proof.The argument is based on the proof of Theorem 1 and we provide only an outline.Also, for simplicity, we consider only n = 3; the general case follows the same logic.As before, it is straightforward to check that the independence of margins imply diagonal conditional correlation matrix, so we focus on the reverse implication.
In fact, as in the proof of Theorem 1, we get that the formula is valid for any pi, qi ∈ (0, 1), i = 1, 2, 3; see the discussion following (11) for details.Using this observation, for any x, y, z ∈ [0, 1], as in (12), we get C(x, y, z) =  The next generalisation of Theorem 1 is based on linear combinations.For simplicity, given an n-dimentional random vector X and an m-dimensional random vector Y , we pre-assume that for any α ∈ R n \ {0} and β ∈ R m \ {0}, the random vector ( X, α , Y, β ), where •, • denotes the standard Euclidean inner product, satisfy our usual assumptions, i.e. bijectiveness of the the marginal distribution functions, full support condition, absolute continuity of the joint distribution, and continuity of the copula density.Theorem 6.Let X and Y be n-dimensional and m-dimensional random vectors, respectively.Then, X and Y are independent if and only if for any α ∈ R n \ {0} and β ∈ R m \ {0}, the random variables X, α and Y, β are conditionally uncorrelated, i.e. for any quantile splits 0 < p1 < q1 < 1 and 0 < p2 < q2 < 1 and the related set A, defined for Proof.As in the proof of Theorem 1, we focus on the argument that (17) implies independence; the reverse implication is standard.Note that (17) combined with Theorem 1 implies that the random variables X, α and Y, β are independent for any α ∈ R n and β ∈ R m .In particular, we get where φZ (t) := E[exp (i Z, t )], t ∈ R d , denotes the characteristic function of an arbitrary d-dimensional random vector Z.
Theorem 7. Let X be an n-dimensional random vector.Assume that for any k = 1, . . ., n − 1 and α k ∈ R k \ {0}, the random variables X k+1 and X 1:k , α k are conditionally uncorrelated.Then, the margins of X are (jointly) independent.
Remark 8.It should be noted that Theorem 7 could be used to get a characterisation of infinite series of random variables, e.g.(Xt) t∈N .Indeed, it is enough to recall that the independence of the family (Xt) t∈N means independence of any finite subfamily of random variables.

Examples
We conclude this note with two simple examples which illustrate Theorem 1. Example 9 refers to a classic example of uncorrelated random variables which are not independent, while Example 10 shows how one can localise the auto-correlation analysis in signal processing to study time-series independence.In particular, it should be noted that our framework allows to consider all classes of processes including the ones with heavy-tails, for which the unconditional auto-correlation function might not exist.
Example 9 (Uncorrelated normal random variables that are not independent).Let us consider a classic example of two uncorrelated normal random variables that are not independent, see Broffitt (1986).Let X be a standard normal random variable and W be a Rademacher random variable.Let us assume that X and W are independent and set Y := W X.
Using a classic argument one may show that: (1) Y is standard normal random variable; (2) X and Y are (unconditionally) uncorrelated; (3) X and Y are not independent.To illustrate how Theorem 1 works, we provide an explicit formula for the quantile conditional covariance of X and Y .
Example 10 (Auto-correlation analysis).The analysis of auto-correlation is a common and standard technique used in time series analysis and signal processing to detect serial dependence in time-series, see e.g.Hamilton (1994); Brockwell and Davis (2002) and references therein.In particular, it is often used to verify lack of trend or volatility clustering in financial data, see e.g.Fama and French (1988); Cont (2001); Jiang et al. (2016).Given a time-series sample (xt) n t=1 , the empirical auto-correlation of lag k is typically computed by estimating the (unconditional) correlation between the subsamples (xt) n t=k+1 and (xt) n−k t=1 .In this simple example, we use market data to show how the information about conditional correlation could be used to refine standard auto-correlation function (ACF) analysis.For simplicity, we decided to take one exemplary stock market data.Namely, we consider weekly (adjusted price) returns of AAPL stock in the period 01/08/2016 -01/08/2022, the data is illustrated in Figure 2. In Figure 3, we present the classical auto-correlation function (ACF) plots for log-returns, absolute values of log-returns, as well as squared log-returns.While, the first plot is often used for generic independence check (lack of trend), the last two might be used to investigate the so-called volatility clustering effect, see Cont (2001).Although from Figure 2 one can deduce that the data is not i.i.d., the ACF functions do not detect any major problem, especially for lag k = 1.
Let us now focus on lag k = 1 and check if we can refine the ACF analysis using conditional auto-correlation function rather than the unconditional one.From Theorem 1 we know that to check independence between consecutive observations, we can calculate their local auto-correlation on a quantile set, i.e. empirical correlation for conditioned samples (xt) n t=2 and (xt) n−1 t=1 .Namely, let us consider the quantile split p1 = p2 = 0.01 and q1 = q2 = 0.7, and compute the conditional correlation on the corresponding set A given by (3).In Figure 4, we present the lagged sample plot where the values of xt are confronted with the values of xt−1; the red data-points indicate conditional sub-sample on which correlation is computed.The estimated value of the conditional correlation is equal to 0.31, which indicate that the time-series observations are not independent.To sanity check if this claim is statistically significant, we performed a simple normal distribution based Monte Carlo exercise.Namely, we picked M = 100 000 strong Monte Carlo samples of size n = 312, i.e. size equal to the size of the original sample, from independent normal distributions.For each run, we computed the conditional correlation for the same lag and the same sample quantile set.The 0.1% upper quantile of the obtained MC density is equal to 0.25, which shows that the initial sample empirical correlation 0.31 is (statistically) significantly different from zero.
We want to note that while the analysis performed in this example is simplistic, and the obtained statistical significance is based on strong normality assumptions, the obtained results indicate that the conditional version of the auto-correlation function might be useful in time-series analysis.Also, note that such analysis could be applied even to heavy tailed data for which the unconditional auto-correlation might not exists; this topics are left for the future research.

Figure 3 .
Figure 3. Auto-correlation function (ACF) plots for AAPL stock price weekly log-returns in the period 01/08/2016 -01/08/2022.The left exhibit shows ACF applied to log-returns, the middle exhibit shows ACF applied to absolute values of log-returns, while the right exhibit shows ACF applied to squared log-returns.

Figure 4 .
Figure 4. Lag plot (k = 1) for weekly APPL log-returns.The red region indicates the conditional set A on which we computed (empirical) conditional correlation which is equal to 0.31.This indicates that the consequent observations are not independent.