A Kernel Independence Test for Random Processes

Kacper Chwialkowski, Arthur Gretton

Introduction

Measures of statistical dependence between pairs of random variables (X,Y)(X,Y) are well established, and have been applied in a wide variety of areas, including fitting causal networks (Pearl, 2000), discovering features which have significant dependence on a label set (Song et al., 2012), and independent component analysis (Hyvärinen et al., 2004). Where pairs of observations are independent and identically distributed, a number of non-parametric tests of independence have been developed (Feuerverger, 1993; Gretton et al., 2007; Székely et al., 2009; Gretton & Györfi, 2010), which determine whether the dependence measure value is statistically significant. These non-parametric tests are consistent against any fixed alternative - they make no assumptions as to the nature of the dependence.

For many data analysis tasks, however, the observations being tested are drawn from a time series: each observation is dependent on its past values. Examples include audio signals, financial data, and brain activity. Given two such random processes, we propose a hypothesis test of instantaneous dependence, of whether the two signals are dependent at a particular time tt. Our test satisfies two important properties: it is consistent against any fixed alternatives, and it is non-parametric - we do not assume the dependence takes a particular form (such as linear correlation), nor do we require parametric models of the time series. We further avoid making use of a density estimate as an intermediate step, so as to avoid the assumption that the distributions have densities (for instance, when dealing with text or other structured data).

We use as our test statistic the Hilbert-Schmidt Independence Criterion (HSIC) (Gretton et al., 2005, 2007), which can be interpreted as the distance between embeddings of the joint distribution and the product of the marginals in a reproducing kernel Hilbert space (RKHS) (Gretton et al., 2012, Section 7). When characteristic RKHSs are used, the HSIC is zero iff the variables are independent (Sriperumbudur et al., 2010). Under the null hypothesis of independence, PXY=PXPYP_{XY}=P_{X}P_{Y}, the minimum variance estimate of HSIC is a degenerate U-statistic. The distribution of the empirical HSIC under the null is an infinite sum of independent χ2\chi^{2} variables (Gretton et al., 2007), which follows directly from e.g. (Serfling, 2002, Ch. 5). In practice, given a sample (xi,yi)i=1n(x_{i},y_{i})_{i=1}^{n} of pairs of variables drawn from PXYP_{XY}, the null distribution is approximated by a bootstrap procedure, where a histogram is obtained by computing the test statistic on many different permutations {xi,yπ(i)}i=1n\{x_{i},y_{\pi(i)}\}_{i=1}^{n}, to decouple XX and YY.

In the case where the samples Zt=(Xt,Yt)Z_{t}=(X_{t},Y_{t}) are drawn from a random process, the analysis of the asymptotic behaviour of HSIC requires substantially more effort than in the i.i.d. case. As our main contribution, we obtain both the null and alternative distributions of HSIC for random processes, where the null distribution is defined as XtX_{t} being independent of YtY_{t} at time tt. Such a test may be used for rejecting causal effects (i.e., whether one signal is not dependent on the values of another signal at a particular delay) or instant coupling (see our first experiment in Section 4.2).We distinguish our case from the problem of ensuring time series are independent simultaneously across all time lags, e.g the null will hold even if Xt=Yt−1X_{t}=Y_{t-1} where YtY_{t} is white noise. The null distribution is again an infinite weighted sum of χ2\chi^{2} variables, however these are now correlated, rather than independent. Under the alternative hypothesis, the statistic has an asymptotically normal distribution.

For the test to be used in practice, we require an empirical estimate of the null distribution, which gives the correct test threshold when Zt=(Xt,Yt)Z_{t}=(X_{t},Y_{t}) is a random process. Evidently, the bootstrap procedure used in the i.i.d. case is incorrect, as the temporal dependence structure within the YtY_{t} will be removed. This turns out to cause severe problems in practice, since the permutation procedure will give an increasing rate of false positives as the temporal dependence of the YtY_{t} increases (i.e., dependence will be detected between XtX_{t} and YtY_{t}, even though none exists, this is also known as a Type I error). Instead, our null estimate is obtained by making shifts of one signal relative to the other, so as to retain the dependence structure within each signal. Consequently, we are able to keep the Type I error at the designed level α=0.05\alpha=0.05. In our experiments, we address three examples: one artificial case consisting of two signals which are dependent but have no correlation, and two real-world examples on forex data. HSIC for random processes reveals dependencies that classical approaches fail to detect. Moreover, our new approach gives the correct Type I error rate, whereas a bootstrap-based approach designed for i.i.d. signals returns too many false positives.

Prior work on testing independence in time series may be categorized in two branches: testing serial dependence within a single time series, and testing dependence between one time series and another. The case of serial dependence turns out to be relatively straightforward, as under the null hypothesis, the samples become independent: thus, the analysis reduces to the i.i.d. case. Pinkse (1998); Diks & Panchenko (2005) provide a quadratic forms function-based serial dependence test which employs the same statistic as HSIC. Due to the simple form of the null hypothesis, the analysis of (Serfling, 2002, Ch. 5) applies. Further work in the context of the serial dependency testing includes simple approaches based on rank statistics e.g. Spearman’s correlation or Kendall’s tau, correlation integrals e.g. (Broock et al., 1996); criteria based on integrated squared distance between densities e.g (Rosenblatt & Wahlen, 1992); KL-divergence based criteria e.g. (Robinson, 1991; Hong & White, 2005); and generalizations of KL-divergence to so called qq-class entropies e.g. (Granger et al., 2004; Racine & Maasoumi, 2007).

In most of the tests of independence of two time series, specific conditions have been enforced, e.g that processes follow a moving average specification or the dependence is linear. Prior work in the context of dependency tests of two time series includes cross covariance based tests e.g. (Haugh, 1976; Hong, 1996; Shao, 2009); and a Generalized Association Measure based criterion (Fadlallah et al., 2012). Some work has been undertaken in the non-parametric case, however. A non-parametric measure of independence for time series, based on the Hilbert-Schmidt Independence Criterion, was proposed by Zhang et al. (2008). While this work established the convergence in probability of the statistic to its population value, no asymptotic distributions were obtained, and the statistic was not used in hypothesis testing. To our knowledge, the only non-parametric independence test for pairs of time series is due to Besserve et al. (2013), which addresses the harder problem of testing independence across all time lags simultaneously. Let XtX_{t} follow a MA(2) model and put Yt=Xt−20Y_{t}=X_{t-20}. This is a case addressed by Besserve et al. (2013), who will reject their null hypothesis, whereas our null is accepted The procedure is to compute the Hilbert-Schmidt norm of a cross-spectral density operator (the Fourier transform of the covariance operator at each time lag). The resulting statistic is a function of frequency, and must be zero at all frequencies for independence, so a correction for multiple hypothesis testing is required. It is not clear how the asymptotic analysis used in the present work would apply to this statistic, and this remains an interesting topic of future study.

The remaining material is organized as follows. In Section 2 we provide a brief introduction to random processes and various mixing conditions, and an expression for our independence statistic, HSIC. In Section 3, we characterize the asymptotic behaviour of HSIC for random variables with temporal dependence, under the null and alternative hypotheses, and establish the test consistency. We propose an empirical procedure for constructing a statistical test, and demonstrate that the earlier bootstrap approach will not work for our case. Section 4 provides experiments on synthetic and real data.

Background

In this section we introduce necessary definitions referring to random processes. We then go on to define a V-statistic estimate of the Hilbert-Schmidt Independence Criterion, which applies in the i.i.d. case.

Next, we formalize a concept of memory of a process. A process is called absolutely regular (β\beta-mixing) if β(m)→0\beta(m)\rightarrow 0, where

The second supremum in the β(m)\beta(m) definition is taken over all pairs of finite partitions {A1,⋯ ,AI}\{A_{1},\cdots,A_{I}\} and {B1,⋯ ,BJ}\{B_{1},\cdots,B_{J}\} of the sample space such that Ai∈A1nA_{i}\in\mathcal{A}_{1}^{n} and Bj∈An+m∞B_{j}\in\mathcal{A}_{n+m}^{\infty}, and Abc\mathcal{A}_{b}^{c} is a sigma field spanned by a subsequence, Abc=σ(Zb,Zb+1,...,Zc)\mathcal{A}_{b}^{c}=\sigma(Z_{b},Z_{b+1},...,Z_{c}). A process is called uniform mixing (ϕ\phi-mixing) if ϕ(m)→0\phi(m)\rightarrow 0, where

Uniform mixing implies absolute regularity, i.e. β(m)≤ϕ(m)\beta(m)\leq\phi(m) (Bradley et al., 2005). Under technical assumptions, Autoregressive Moving Average processes — or more generally Markov Chains — are absolutely regular or uniformly mixing (Doukhan, 1994).

Hilbert-Schmidt Independence Criterion

Let kk, ll be positive definite kernels associated with respective reproducing kernel Hilbert spaces HX\mathcal{H}_{\mathcal{X}} on X\mathcal{X}, and HY\mathcal{H}_{\mathcal{Y}} on Y\mathcal{Y}. We assume that kk and ll are bounded and continuous. We associate to the random variable XX a mean embedding μX(x):=EXk(X,x)\mu_{X}(x):=\mathcal{E}_{X}k(X,x), such that ∀f∈HX\forall f\in\mathcal{H}_{\mathcal{X}}, ⟨f,μX⟩HX=EX(f(X))\langle f,\mu_{X}\rangle_{\mathcal{H}_{\mathcal{X}}}=\mathcal{E}_{X}(f(X)) (Berlinet & Thomas-Agnan, 2004; Smola et al., 2007). We assume kk, ll are characteristic kernels, meaning the mappings μX\mu_{X} and μY(y):=EYl(Y,y)\mu_{Y}(y):=\mathcal{E}_{Y}l(Y,y) are injective embeddings of the probability measures to the corresponding RKHSs; i.e., distributions have unique embeddings (Fukumizu et al., 2008; Sriperumbudur et al., 2010).

We next recall a measure of statistical dependence, the Hilbert-Schmidt Independence Criterion (HSIC), which can be expressed in terms of expectations of RKHS kernels (Gretton et al., 2005, 2007). Denote a group of permutations over 4 elements by S4S_{4}, with π\pi one of its elements, i.e., a permutation of four elements. We define

Let γ\gamma be an expected value of the function hh, γ=Eh(Z1∗,Z2∗,Z3∗,Z4∗)\gamma=\mathcal{E}h(Z_{1}^{*},Z_{2}^{*},Z_{3}^{*},Z_{4}^{*}). This expectation corresponds to HSIC, computed using a function symmetric in its arguments. For kk and ll characteristic, continuous, translation invariant, and vanishing at infinity, γ\gamma is equal to zero if and only if the null hypothesis holds (see (Lyons, 2013, Lemma 3.8), applying (Sriperumbudur et al., 2011, Proposition 2), and the note at the end of Section 5).

The value of γ\gamma corresponds to a distance between embeddings of (X1∗,Y2∗)(X_{1}^{*},Y_{2}^{*}) and (X1∗,Y1∗)(X_{1}^{*},Y_{1}^{*}) to an RKHS with the product kernel κ=k⋅l\kappa=k\cdot l (Gretton et al., 2012, Section 7). A biased empirical estimate of the Hilbert-Schmidt Independence Criterion can be expressed as a VV-statistic (the unbiased estimate is a U-statistic, however the difference will be accounted for when constructing a hypothesis test, through an appropriate null distribution).

V𝑉V statistics.

A VV-statistic of a kk-argument, symmetric function ff is written

If j=k−1j=k-1 we say that the function is canonical. We refer to a normalized VV statistic as a VV-statistic multiplied by the sample size, n⋅Vn\cdot V.

HSIC for random processes

In this section we construct the Hilbert-Schmidt Independence Criterion for random processes, and define its asymptotic behaviour. We then introduce an independence testing procedure for time series.

We introduce two hypotheses: the null hypothesis H0\mathbf{H_{0}} that XtX_{t} and YtY_{t} are independent, and the alternative hypothesis H1\mathbf{H_{1}} that they are dependent. To build a statistical test based on n⋅V(h,Z)n\cdot V(h,Z) we need two main results. First, if null hypothesis holds, we show n⋅V(h,Z)n\cdot V(h,Z) converges to a random variable. Second, if the null hypothesis does not hold, the n⋅V(h,Z)n\cdot V(h,Z) estimator diverges to infinity. Following these results, the Type I error (the probability of mistakenly rejecting the null hypothesis) will stabilize at the design parameter α\alpha, and the Type II error (the probability of mistakenly accepting the null hypothesis when the variables are dependent) will drop to zero, as the sample size increases.

We begin by introducing an auxiliary kernel function ss, and characterize the normalized VV-statistic distribution of ss using a CLT introduced by (Borisov & Volodko, 2008). We then show that the normalized VV-statistic associated with the function ss has the same asymptotic distribution as the n⋅V(h,Z)n\cdot V(h,Z) distribution.

By Steinwart & Scovel (2012) Corollary 3.5, the bounded, continuous kernel ss has a representationA bounded kernel is compactly embedded into L2(Z,B(Z),PZ)L^{2}(\mathbf{Z},\mathcal{B}(\mathbf{Z}),P_{\mathbf{Z}}) (Steinwart & Scovel, 2012).

Let the process ZtZ_{t} have a mixing coefficient smaller than m−3m^{-3} (β(m),ϕ(m)≤m−3)(\beta(m),\phi(m)\leq m^{-3}) and satisfy either of the following conditions:

ZtZ_{t} is β\beta-mixing. For some ϵ>0\epsilon>0 and for an even number c≥2c\geq 2, the following holds

sup⁡iE∣ei(X1)∣2+ϵ≤∞\sup_{i}\mathcal{E}|e_{i}(X_{1})|^{2+\epsilon}\leq\infty, where eie_{i} is the basis introduced in the Statement 1 and ∣⋅∣|\cdot| denotes an absolute value.

∑m=1∞βϵ/(2+ϵ)(m)<∞\sum_{m=1}^{\infty}\beta^{\epsilon/(2+\epsilon)}(m)<\infty.

If the null hypothesis holds, then ss is a canonical function and a kernel. What is more,

where τj\tau_{j} is a centred Gaussian sequence with the covariance matrix

We now characterize the asymptotics of V(h,Z)V(h,Z).

Under assumptions of Lemma 2, if H0\mathbf{H_{0}} holds, then the asymptotic distribution of the empirical HSIC (with scaling nn) is the same as that of n⋅V(s,Z)n\cdot V(s,Z),

Under assumptions of the Lemma 2, if H1\mathbf{H_{1}} holds, then γ>0\gamma>0 and n(V(h,Z)−γ)\sqrt{n}(V(h,Z)-\gamma) has asymptotically normal distribution with mean zero and finite variance.

Consequently, if the null hypothesis does not hold then P(n⋅V(h,Z)>C)=P(V(h,Z)>Cn)→1P(n\cdot V(h,Z)>C)=P(V(h,Z)>\frac{C}{n})\to 1 for any fixed CC. Finally, we show that the γ\gamma estimator is easy to compute. According to Gretton et al. (2007, equation 4), V(h,Z)=n−2trHKHL,V(h,Z)=n^{-2}trHKHL, where Kab=k(Xa,Xb)K_{ab}=k(X_{a},X_{b}), Lab=l(Ya,Yb)L_{ab}=l(Y_{a},Y_{b}) ,Hij=δij−n−1H_{ij}=\delta_{ij}-n^{-1} and nn is a sample size.

We begin by showing that the H0H_{0} distribution of the γ\gamma estimator obtained via the bootstrap approach of (Diks & Panchenko, 2005; Gretton et al., 2007) gives an incorrect p-value estimate when used with independent random processes. In fact, the null hypothesis obtained by permutation corresponds to the processes being both i.i.d. and independent from each other. Recall the covariance structure of the γ\gamma estimator from Theorem 1,

We can represent eae_{a} and ebe_{b} as ea(z)=euX(x)eoY(y)e_{a}(z)=e^{X}_{u}(x)e^{Y}_{o}(y), eb(z)=eiX(x)epY(y)e_{b}(z)=e^{X}_{i}(x)e^{Y}_{p}(y), as a decomposition of the Z\mathbf{Z} basis into bases of X\mathbf{X} and Y\mathbf{Y}, respectively. Consider a partial sum TnT_{n} of series from the above equation (3), with XtX_{t} replaced with its permutation Xπ(t)X_{\pi(t)},

Using covariance inequalities from (Doukhan, 1994, Section 1.2.2) we conclude that EeoY(Y1)epY(Yj+1)=O(Λ(j)12)\mathcal{E}e^{Y}_{o}(Y_{1})e^{Y}_{p}(Y_{j+1})=O(\Lambda(j)^{\frac{1}{2}}) and EeuX(Xπ(1))eiX(Xπ(j+1))=O(Λ(∣π(j)−π(1)∣)12)\mathcal{E}e^{X}_{u}(X_{\pi(1)})e^{X}_{i}(X_{\pi({j+1})})=O(\Lambda(|\pi(j)-\pi(1)|)^{\frac{1}{2}}) where Λ\Lambda is an appropriate mixing coefficient (β\beta or ϕ\phi). Recall that 0<Λ(j)<Cj−30<\Lambda(j)<Cj^{-3}.

We can therefore reduce the problem to the convergence of a random variable

where π\pi is a random permutation drawn from the uniform distribution over the set of nn-element permutations. In the supplementary material we show that this sum converges in probability to zero.

Since Sn>Tn>0S_{n}>T_{n}>0, then TnT_{n} converges to zero in probability, and consequently the covariance matrix entry Eτaτb\mathcal{E}\tau_{a}\tau_{b} converges to unity for a=ba=b, and to zero otherwise. Indeed, the expected value Eea((Xπ(1),Y1))eb((Xπ(1),Y1))=0\mathcal{E}e_{a}((X_{\pi(1)},Y_{1}))e_{b}((X_{\pi(1)},Y_{1}))=0 if a≠ba\neq b and is equal to one otherwise. Note that this is the covariance matrix described by Gretton et al. (2007).

A correct approach to approximating the asymptotic null distribution of n⋅V(h,Z)n\cdot V(h,Z) under H0\mathbf{H}_{0} is by shifting of one time series relative to the other. Define the shifted process Stc=Yt+c mod nS^{c}_{t}=Y_{t+c\text{ mod }n} for an integer cc, 0≤c≤n0\leq c\leq n and 0≤t≤n0\leq t\leq n. If we let cc vary over 0≤A≤B≤n0\leq A\leq B\leq n for AA such that the dependence between Yt+AY_{t+A} and XtX_{t} is negligible, then we can approximate the null distribution with an empirical distribution calculated on points (V(h,Zk))A≤k≤B(V(h,Z^{k}))_{A\leq k\leq B}, where Ztk=(Xt,Stk)Z^{k}_{t}=(X_{t},S^{k}_{t}). This is due to the fact that the shifted process StcS^{c}_{t} retains most of the dependence, since it does not scramble the time index.As a illustration, consider Wt=Yt−10W_{t}=Y_{t-10}. If YtY_{t} is stationary then the dependence structure of (Wt1,Wt2)(W_{t_{1}},W_{t_{2}}) and (Yt1,Yt2)(Y_{t_{1}},Y_{t_{2}}) is the same. If we set Wt=W_{t}= Yπ(t)Y_{\pi(t)} this property does not hold. We call this method Shift HSIC. In the supplementary material we show that Shift HSIC samples from the correct null distribution.

Experiments

In the experiments we compare Shift HSIC with the Bootstrap HSIC of Gretton et al. (2007). We investigate three cases: an artificial dataset, where two time series are coupled non-linearly; and two forex datasets, where in one case we seek residual dependence after one time series has been used to linearly predict another, and in the other case, we reveal strong dependencies between signals that are not seen via linear correlation.

We investigate two dependent, autoregressive random processes XtX_{t},YtY_{t}, specified by

with an autoregressive component aa. The coupling of the processes is a result of the dependence in the innovations ϵt,ηt\epsilon_{t},\eta_{t}. These ϵt,ηt\epsilon_{t},\eta_{t} are drawn from an Extinct Gaussian distribution, defined in Algorithm 1. The parameter pp (called extinction rate) controls how often a point drawn form a ball B(0,r)B(0,r) dies off. According to Algorithm 1, the probability of seeing a point inside the ball B(0,r)B(0,r) is different than for a two dimensional Gaussian N(0,Id)N(\mathbf{0},Id). On the other hand, as pp goes to zero, the Extinct Gaussian converges in distribution to N(0,Id)N(\mathbf{0},Id). Figure 1 illustrates the joint distribution of Xt,YtX_{t},Y_{t}. The left scatter plot in Figure 1 presents XtX_{t} and YtY_{t} generated with an extinction rate of 50%50\%, while the right hand plot is generated with an extinction rate of 99.87%99.87\%. Processes used in this experiment had an autoregressive component of 0.20.2, and the radius of the innovation process was 11.

Figure 2 compares the power of the Shift HSIC test and the correlation test. The XX axis represents an extinction rate, while the YY axis shows the true positive rate. Shift HSIC is capable of detecting non-linear dependence between XtX_{t} and YtY_{t}, which is missed by linear correlation. The red star depicts performance of the KCSD algorithm developed by Besserve et al. (2013), with parameters tuned by its authors: note that this result required using four times as many data points as HSIC.

False positive rates.

We next investigate the rate of false positives for Shift HSIC and Bootstrap HSIC on independent copies of the AR(1)AR(1) processes used in the previous experiment. To generate independent processes, we first sampled two pairs (Xt,Yt)(X_{t},Y_{t}), (Xt′,Yt′)(X_{t}^{\prime},Y_{t}^{\prime}) of time series using (6), and then constructed ZZ by taking XX from the first pair and YY from the second, i.e., Zt=(Xt,Yt′)Z_{t}=(X_{t},Y_{t}^{\prime}). We set an extinction rate to 50%50\%. As a reviewer pointed out, the example for the FP rates can be simplified, however we decided to be consistent with the marginal distribution of XtX_{t},YtY_{t} across the experiments. The AR component aa in the model (6) controls the memory of a processes - the larger this component, the longer the memory. We performed the Shift HSIC and the Bootstrap HSIC tests on ZtZ_{t} generated under H0\mathbf{H_{0}} with different AR components. Figure 3 illustrates the results of this experiment. The XX axis is indexed by the AR component and YY axis shows the FP rate. As the temporal dependence increases, the Bootstrap HSIC incorrectly gives an increasing number of false positives: thus, it cannot be relied on to detect dependence in time series. The Shift HSIC false positive rate remains at the targeted 5%5\% p-value level.

2 Forex data

We use Foreign Exchange Market quotes to evaluate Shift HSIC performance on the real life data. Practitioners point out that forex time series are noisy and hard to handle, especially at low granulations (smaller then 15 minutes). We decided to work with forex time series to show that Shift HSIC can detect dependence even on such a difficult dataset. The forex time series were granulated to obtain two minute sampling (the granulation function returned the last price in the two minute window). Using the test of Diks & Panchenko (2005), we checked that serial dependence of the differentiated time series decays fast enough to satisfy the assumed mixing conditions (by a differentiated time series, we refer to (Xt−Xt−1)t∈N(X_{t}-X_{t-1})_{t\in\mathbf{N}}). The choice of the pairs and trading day (21st January 2013) were arbitrary.

Having one Australian dollar we may obtain a quantity of Yen in two ways, either by using AUD/JPY exchange rate explicitly or by buying Canadian dollars and then selling them at the CAD/JPY rate. Let XtX_{t} be a differentiated AUD/JPY exchange rate and YtY_{t} be a differentiated product of exchange rates AUD/CAD×\timesCAD/JPY. We will investigate the relation between these two. Common sense dictates that YtY_{t} should behave similarly to XtX_{t}. After examining the cross-correlation of XtX_{t} and YtY_{t}, we propose a simple regression model to describe the interaction between the signals,

We fit the model and see that a0=0.97a_{0}=0.97, and the remaining coefficients are not bigger then 0.060.06 in absolute value. This suggest that most of the dependence is explained by an instantaneous coupling. We further investigate the cross-correlation between residuals Rt=Yt−Y^tR_{t}=Y_{t}-\hat{Y}_{t} and XtX_{t}. We observe no significant correlations in the first 30 lags.

Next we investigate dependence of residuals with lagged values of the explanatory variables, i.e., RtR_{t} with Xt−kX_{t-k} for k∈(0,⋯ ,30)k\in(0,\cdots,30). After calculating p-values using the Bootstrap HSIC and the Shift HSIC, we discover dependence only at lags 44, 55, 99, 1313 and 2929, as presented in the Figure 4. Lack of the dependence at lag zero suggests that the linear model for coupling is reasonable. However, both the Bootstrap HSIC and the Shift HSIC support the hypothesis that there is a strong relation at lag 55, which is not explained well by the linear model.

The questions remains whether test statistics at lags 44, 99, 1313 and 2929 indicate further model misspecification. Under H0\mathbf{H_{0}}, at a significance level 94%94\%, we expect 1.8 out of 30 statistics to be higher than the 94th percentile. Excluding the statistic at lag 55, the Shift HSIC test reports two statistics above this percentile, while Bootstrap HSIC reports four. Should the statistics at the different lags be independent from each other, the probabilities of seeing two and four statistics above the percentile are respectively 25%25\% and 6%6\%. Shift HSIC indicates that the model fits the data well, while the Bootstrap HSIC suggests that some non-linear dependencies remain unexplained.

Dependence structure.

The data are five currency pairs. A correlation based independence test, and the Shift HSIC test, were performed on each pair of currencies. The dependencies revealed by these tests are depicted in Figure 5 - nodes represent the time series and edges represent dependence. Shift HSIC reveals a strong coupling between EUR/RUB and USD/JPY, HKD/JPY and XAU/USD that was not found by simple correlation. All edges revealed by Shift HSIC have p-values at most at level 0.030.03 - clearly, the Shift HSIC managed to find a strong non-linear dependence. Note that the obtained graphs are cliques.

Proofs

A UU-statistic of a kk-argument, symmetric function ff, is written

A decomposition due to Hoeffding allows us to decompose this U-statistic into a sum of UU-statistics of canonical functions, U(h,Z)=∑k=1l(lk)U(hk,Z)U(h,Z)=\sum_{k=1}^{l}{l\choose k}U(h_{k},Z), where hk(z1,...,zl)h_{k}(z_{1},...,z_{l}) are components of the decomposition. According to Serfling (2002, section 5.1.5), each of h1h_{1},h2h_{2},h3h_{3},h4h_{4} is symmetric and canonical. Note that hkh_{k} is defined using independent samples Z∗Z^{*} - this is because the CLT or LLN state that U-statistics or V-statistics of mixing processes converge to their expected value taken with respect to independent copies, i.e., Z∗Z^{*}. Under H0\mathbf{H}_{0}, h1h_{1} is equal to zero everywhere and h2=16sh_{2}=\frac{1}{6}s, where these results were obtained by Gretton et al. (2007).The second result is hard to locate - it is in appendix A.2, text between equations 12 and 13 See supplementary material for details.

In order to characterize U(h,Z)U(h,Z), we show that under null hypothesis U(h2,Z)U(h_{2},Z) converges to a random variable, and both U(h3,Z)U(h_{3},Z),U(h4,Z)U(h_{4},Z) converge to zero in a probability (the latter proof can be found in the supplementary material). Bellow we characterise U(h2,Z)U(h_{2},Z) convergence.

First recall that under null hypothesis h2=16sh_{2}=\frac{1}{6}s. We will check the conditions of (Borisov & Volodko, 2008, Theorem 1) (also available in the supplementary). First, from Mercer’s Theorem (Steinwart & Scovel, 2012, Corollary 3.5), we deduce that the h2h_{2} coefficients in L2(Z,BZ,PZ)L_{2}(\mathbf{Z},\mathcal{B}_{\mathbf{Z}},P_{\mathbf{Z}}) are absolutely summable. In the supplementary material we show that Eei(Z1∗)=0\mathcal{E}e_{i}(Z_{1}^{*})=0. Recall the assumptions of Lemma 2. If A holds then ∑k=1∞ϕ(k)12<∞\sum_{k=1}^{\infty}\phi(k)^{\frac{1}{2}}<\infty and sup⁡iE∣ei(X1)∣2=1<∞\sup_{i}\mathcal{E}|e_{i}(X_{1})|^{2}=1<\infty (eie_{i} is an orthonormal eigenfunction). Finally, if B holds then the process ZtZ_{t} is α\alpha-mixing. The remaining assumptions concerning uniform mixing in Borisov & Volodko (2008) are exactly the same as in this lemma. ∎

(Lemma 2) We use the fact that h2h_{2} is equal to ss up to scaling (6U(h2,Z)=U(s,Z)6U(h_{2},Z)=U(s,Z)), and Lemma 3, to see that nU(s,Z)→D∑i∞λi(τi2−1)nU(s,Z)\stackrel{{\scriptstyle D}}{{\to}}\sum_{i}^{\infty}\lambda_{i}(\tau_{i}^{2}-1). Since Es(Zt,Zt)=E∑i=1∞λiei(Zt)2=∑i=1∞λi\mathcal{E}s(Z_{t},Z_{t})=\mathcal{E}\sum_{i=1}^{\infty}\lambda_{i}e_{i}(Z_{t})^{2}=\sum_{i=1}^{\infty}\lambda_{i}, then by the LLN for mixing processes,

We use a relationship between UU and VV statistics,

(Theorem 1) We operate under the null hypothesis. Recall that U(h,Z)U(h,Z) can be decomposed as U(h,Z)=∑k=14(4k)U(hk,Z)U(h,Z)=\sum_{k=1}^{4}{4\choose k}U(h_{k},Z). Here h1≡0h_{1}\equiv 0. We show in the supplementary material that U(h3,Z)U(h_{3},Z) and U(h4,Z)U(h_{4},Z) tend to zero in probability. From Lemma 3,

We define an auxiliary symmetric function ww,

It is obvious that Ew(Z1∗,Z2∗,Z3∗)\mathcal{E}w(Z_{1}^{*},Z_{2}^{*},Z_{3}^{*}) == 6Eh(Z1∗,Z1∗,Z2∗,Z3∗)6\mathcal{E}h(Z_{1}^{*},Z_{1}^{*},Z_{2}^{*},Z_{3}^{*}). We consider the difference between the unnormalized VV and UU statistics,

where ∑i∈Cm\sum_{i\in C_{m}} denotes summation over all (nm)n\choose m combinations of mm distinct elements {i1,⋯ ,im}\{i_{1},\cdots,i_{m}\} from {1,⋯ ,n}\{1,\cdots,n\}. The difference is equal to the sum over 44-tuples with at least one pair of equal elements. We can choose such tuples in (42)=6\binom{4}{2}=6 ways. Observe that ww covers the choice of all these six tuples. Since for any z1,z2∈Zz_{1},z_{2}\in\mathbf{Z}, h(z1,z1,z1,z2)=0h(z_{1},z_{1},z_{1},z_{2})=0, then ww is zero whenever more than two indices are equal. Therefore we can sum ww over distinct indices z1,z2,z3z_{1},z_{2},z_{3},

We see that SnS_{n} is almost a UU-statistic (U(w,Z)U(w,Z)). By the CLT for UU-statistics from Denker & Keller (1983), Theorem 1(c), we obtain

On the other hand, via the relation h2=16sh_{2}=\frac{1}{6}s and the h2h_{2} definition, we get Es(Z1∗,Z1∗)=6Eh(Z1∗,Z1∗,Z2∗,Z3∗)\mathcal{E}s(Z_{1}^{*},Z_{1}^{*})=6\mathcal{E}h(Z_{1}^{*},Z_{1}^{*},Z_{2}^{*},Z_{3}^{*}), and therefore

We normalize by 1n(n−1)(n−2)\frac{1}{n(n-1)(n-2)}, and take the limit in nn,

We substitute (9) and (8) on the right hand side, and use equation (7) from Lemma 2 to replace lim⁡n→∞1n∑ins(Zi,Zi)\lim_{n\to\infty}\frac{1}{n}\sum_{i}^{n}s(Z_{i},Z_{i}) with ∑i=1∞λi\sum_{i=1}^{\infty}\lambda_{i}, yielding

(Theorem 2) If the null hypothesis does not hold, then γ>0\gamma>0 (Gretton et al., 2005). In this case hh is nondegenerate, and we can use Denker & Keller (1983, Theorem 1(c)) to see that n4 σ(V(h,Z)−γ)∼N(0,1)\frac{\sqrt{n}}{4\ \sqrt{\sigma}}(V(h,Z)-\gamma)\sim N(0,1), where σ\sigma is finite (see the note below Theorem 1 of (Denker & Keller, 1983), stating that in case (c) σ2\sigma^{2} is finite, and the note above Theorem 1 stating that σ2=lim⁡n→∞n−1σn2\sigma^{2}=\lim_{n\to\infty}n^{-1}\sigma_{n}^{2} ). ∎

(Lemma 1) We use Lemma 1 and Theorem 4 from Gretton et al. (2005) to show that Eh(Z1∗,Z2∗,Z3∗,Z4∗)=0\mathcal{E}h(Z_{1}^{*},Z_{2}^{*},Z_{3}^{*},Z_{4}^{*})=0 iff (X1∗,Y1∗)(X_{1}^{*},Y_{1}^{*}) has a product distribution. Since Z1∗=DZ1Z_{1}^{*}\stackrel{{\scriptstyle D}}{{=}}Z_{1} and Zt=DZ1Z_{t}\stackrel{{\scriptstyle D}}{{=}}Z_{1}, we infer that XtX_{t} is independent from YtY_{t} iff Eh(Z1∗,Z2∗,Z3∗,Z4∗)=0\mathcal{E}h(Z_{1}^{*},Z_{2}^{*},Z_{3}^{*},Z_{4}^{*})=0. ∎

The authors thank the reviewers and colleagues for helpful feedback, especially M. Skomra, D. Toczydlowska, and A. Zaremba.

References

Appendix A A Kernel Independence Test for Random Processes - Supplementary

The sections in the supplementary material are in the same order those in the article. In particular, the nn-th reference to the supplementary in the article is nn-th subsection in the supplementary material.

The arXiv version of the report and supplementary may be found at: http://arxiv.org/abs/1402.4501

Before we start, we cite (Yoshihara, 1976, Lemma 1), which will be used below.

Note that if a function gg is symmetric, then we can always reorder its arguments if necessary.

Let π\pi be a permutation drawn from a uniform distribution over the set of nn-element permutations. We will prove that the random variable

converges to zero in probability at rate O(n−1)O(n^{-1}). Since 0≤Sn≤Qn0\leq S_{n}\leq Q_{n}, then SnS_{n} converges to zero in probability at the same rate.

E∣π(1)−π(i)∣−32=O(n−1)\mathcal{E}|\pi(1)-\pi(i)|^{-{\frac{3}{2}}}=O(n^{-1}).

Let jj be a positive integer smaller than nn. Observe that the sum ∑in∣j−i∣−32\sum_{i}^{n}|j-i|^{-{\frac{3}{2}}} is finite,

where ζ(⋅)\zeta(\cdot) is the Riemann zeta function. Now expand the expected value E∣π(1)−π(i)∣−32\mathcal{E}|\pi(1)-\pi(i)|^{-{\frac{3}{2}}} using a conditional expected value,

If k≠jk\neq j are positive integers smaller than nn, then

We use the inequality (10) and properties of a conditional expected value.

QnQ_{n} converges to zero in probability. The convergence rate is 1n\frac{1}{n}.

First, using Lemma 5 , we compute the expected value of QnQ_{n}

Next, using Lemma 6, we compute the second moment

Using the Chebyshev’s inequality we obtain the required result. ∎

A.2 Testing procedure - Shift HSIC samples from the right distribution

We will investigate the value of the VV-statistic for a shifted process i.e. nV(h,Zk)nV(h,Z^{k}).

If the null hypothesis holds, then XtX_{t} and Yt+kY_{t+k} are independent for any kk. To see this, suppose that there exists kk for which XtX_{t} and Yt+kY_{t+k} are dependent (the processes are stationary, so this is true for all tt). The observation XtX_{t} depends on its past values: in particular, Xt−kX_{t-k} is a parent of XtX_{t}. If in addition Xt−k→YtX_{t-k}\rightarrow Y_{t}, then YtY_{t} and XtX_{t} will be dependent, as they share a parent.

We will use this fact to show that the nV(h,Zk)nV(h,Z^{k}) has the same distribution as the nV(h,Z)nV(h,Z). Recall the covariance structure of nV(h,Z)nV(h,Z) from Theorem 1,

We represent eae_{a} and ebe_{b} as ea(z)=euX(x)eoY(y)e_{a}(z)=e^{X}_{u}(x)e^{Y}_{o}(y), eb(z)=eiX(x)epY(y)e_{b}(z)=e^{X}_{i}(x)e^{Y}_{p}(y). This represents a decomposition of the basis of Z\mathbf{Z} into basis of X,Y\mathbf{X},\mathbf{Y}, respectively. Consider one of the above infinite sums with YtY_{t} replaced with the shifted process StkS^{k}_{t},

We obtain the following covariance structure for nV(h,Zk)nV(h,Z^{k}),

We have used the fact that YtY_{t} is stationary, EeoY(Y1+k)epY(Yj+1+k)=eoY(Y1)epY(Yj+1)\mathcal{E}e^{Y}_{o}(Y_{1+k})e^{Y}_{p}(Y_{j+1+k})=e^{Y}_{o}(Y_{1})e^{Y}_{p}(Y_{j+1}) and that the pairs (X1,X1+j)(X_{1},X_{1+j}), (Y1+k,Yj+1+k)(Y_{1+k},Y_{j+1+k}) are independent (because XtX_{t} and Yt+kY_{t+k} are independent for all shifts kk). For the second term,

we have used covariance inequalities from Doukhan (1994, section 1.2.2) and our bounds on mixing coefficients to obtain that when j≥n−kj\geq n-k, then E∣euX(X1)eiX(Xj+1)∣≤(n−k)−32\mathcal{E}|e^{X}_{u}(X_{1})e^{X}_{i}(X_{j+1})|\leq(n-k)^{-\frac{3}{2}} (and by e.g. Holders inequality, EeoY(Y1+k)epY(Y1+(n−j))\mathcal{E}e^{Y}_{o}(Y_{1+k})e^{Y}_{p}(Y_{1+(n-j)}) is finite). The first component takes the form

Here ∑j=1n−kEea(Z1)eb(Zj+1)\sum_{j=1}^{n-k}\mathcal{E}e_{a}(Z_{1})e_{b}(Z_{j+1}) converges to ∑j=1∞Eea(Z1)eb(Zj+1)\sum_{j=1}^{\infty}\mathcal{E}e_{a}(Z_{1})e_{b}(Z_{j+1}) from equation (14). Since Eea(Z1k)eb(Z1k)=Eea(Z1)eb(Z1)\mathcal{E}e_{a}(Z^{k}_{1})e_{b}(Z^{k}_{1})=\mathcal{E}e_{a}(Z_{1})e_{b}(Z_{1}), the covariance structure from equation (14) is recovered.

Null hypothesis does not hold.

In this case, the dependence between XtX_{t} and Yt+kY_{t+k} decreases as kk increases, since the mixing coefficients for each of the time series converges to zero. In the limit of large kk and nn, the normalized VV-statistic will converge to the null distribution, where XtX_{t} and YtY_{t} are independent random processes. The proof of this result under the assumed mixing conditions, with suitable conditions on the increase of kk with nn, is a topic of future work (the next two sections give an outline of the results that would need to be established for the shifted process).

A.3 Proofs - Hoeffding decomposition

The Hoeffding decomposition (e.g. Serfling, 2002) allows us to decompose U-statistics into a sum of simpler UU-statistics that can be easier to analyse. In the following section we will perform a Hoeffding decomposition of U(h,Z)U(h,Z) and investigate some of its properties. In the sequel we assume that kk and ll are bounded kernels. For the UU statistic U(h,Z)U(h,Z), we call the function hh a core.

Any U-statistic can be written as a sum of V-statistics with degenerate cores. To show this, we define the auxiliary functions

for each c=1,...,m−1c=1,...,m-1 and put gm=hg_{m}=h.

We assume the expected value of the core with respect to starred {Zt}\{Z_{t}\} is zero, i.e., Eh(Z1∗,⋯ ,Zm∗)=0\mathcal{E}h(Z_{1}^{*},\cdots,Z_{m}^{*})=0. The canonical functions that enable the core decomposition are

We call these functions components of a core.

The U-statistic of a core function hh can be written as a sum of U-statistics with degenerate cores,

Recall that ∑i∈Cm\sum_{i\in C_{m}} denotes summation over all (nm)n\choose m combinations of mm distinct elements {i1,⋯ ,im}\{i_{1},\cdots,i_{m}\} from {1,⋯ ,n}\{1,\cdots,n\}.

Under H0\mathbf{H_{0}}, ∀z∈Z\forall z\in\mathbf{Z} h1(z)=0h_{1}(z)=0.

We use the shorthand notation k(a,b)≡k(xa,xb)k(a,b)\equiv k(x_{a},x_{b}), l(a,b)≡l(ya,yb)l(a,b)\equiv l(y_{a},y_{b}), such that

Let us expand this expression. By using the symmetry of kk and ll, and writing the arguments in lexicographical order, we obtain

Finally we introduce colours to picture grouping of terms that will cancel each other during integration.

We will show that brown terms of equation (16) cancel each other. Recall that h1(z1)=Eh(z1,Z2∗,Z3∗,Z4∗)h_{1}(z_{1})=\mathcal{E}h(z_{1},Z_{2}^{*},Z_{3}^{*},Z_{4}^{*}). Without loss of generality we may assume that we integrate with respect to all variables but xax_{a} and yay_{a}. Observe that

Define q=Ek(xa,Xb∗)q=\mathcal{E}k(x_{a},X_{b}^{*}), p=El(ya,Yb∗)p=\mathcal{E}l(y_{a},Y_{b}^{*}). Therefore, after integration, the brown terms of the equation can be written as

Similar reasoning shows that red, green and violet terms cancel out. ∎

A component of a core function is a canonical core.

We will use induction by components’ index to show that hch_{c} is degenerate. The expected value of the first component is zero, indeed Eh1(Z1∗)=Eh(Z1∗,...,Zm∗)=0\mathcal{E}h_{1}(Z_{1}^{*})=\mathcal{E}h(Z_{1}^{*},...,Z_{m}^{*})=0. Suppose that for all c′c^{\prime} smaller then cc degeneracy holds. Using component symmetry it is enough to show that the expected value Ehc(z1,...,Zc∗)\mathcal{E}h_{c}(z_{1},...,Z_{c}^{*}) is equal to zero. We can write

Now the first sum ∑1≤i1<...<ic′≤c−1hc′(zi1,...,zic′)\sum_{1\leq i_{1}<...<i_{c^{\prime}}\leq c-1}h_{c^{\prime}}(z_{i_{1}},...,z_{i_{c^{\prime}}}) does not contain term zcz_{c} so integration with respect to Zc∗Z_{c}^{*} does not affect it. On the other hand, by induction assumption E∑1≤i1<...<ic′−1<chc′(zi1,...,Zc∗)=0\mathcal{E}\sum_{1\leq i_{1}<...<i_{c^{\prime}-1}<c}h_{c^{\prime}}(z_{i_{1}},...,Z_{c}^{*})=0. Obviously Egc(z1,...,Zc∗)=gc−1(z1,...,zc−1)\mathcal{E}g_{c}(z_{1},...,Z_{c}^{*})=g_{c-1}(z_{1},...,z_{c-1}). Using these observations we obtain

Since the set {1≤i1<...<ic−1≤c−1}\{1\leq i_{1}<...<i_{c-1}\leq c-1\} contains only one sequence,

For this nice simplification we have used definition of the component hc−1h_{c-1}. ∎

We use that h2h_{2} is canonial, and the exact form of Eh(z1,z2,Z3∗,Z4∗)\mathcal{E}h(z_{1},z_{2},Z_{3}^{*},Z_{4}^{*}) from (Gretton et al., 2007), Section A.2, text between equation 12 and 13. ∎

Under H0\mathbf{H_{0}}, h2=16sh_{2}=\frac{1}{6}s.

Let N:={1,⋯ ,n}N:=\{1,\cdots,n\}, and let BB be a set of all strictly increasing 44-tuples, B⊂N4B\subset N^{4}. A UU-statistic can be expressed as sum over elements of BB,

If the variance of this random variable goes to zero,

then using Chebyshev’s inequality we can conclude that it converges to a constant in probability. To show this, we use Lemma 3 from Arcones (1998). We see that the first condition of Theorem 1 from Arcones (1998) is met, since h4h_{4} is bounded and the mixing coefficient converges to zero. Therefore, by the fact that h4h_{4} is canonical, we can use Lemma 3 from Arcones (1998), which states that

for some p>2p>2 and M=∥h∥∞M=\parallel h\parallel_{\infty} . Take pp such that 3(p−2)p=2.5\frac{3(p-2)}{p}=2.5 and use inequality β(m)≤m−3\beta(m)\leq m^{-3} to obtain

We now need to show that EnU(h4,Z)\mathcal{E}nU(h_{4},Z) converges to zero. We will use Lemma 4 with δ=2\delta=2, and that β(k)23≤k−2\beta(k)^{\frac{2}{3}}\leq k^{-2},

for some constant MM as in Lemma 4. Next

We have used the fact that ∑d=a+3n1(d−a)2≤2ζ(2)\sum_{d=a+3}^{n}\frac{1}{(d-a)^{2}}\leq 2\zeta(2).

The reasoning for U(h3,Z)U(h_{3},Z) is similar. ∎

A.5 Proofs - Borisov & Volodko (2008, Theorem 1)

Let mm be the number of arguments of a symmetric kernel ff. Let one of the following two sets of conditions be fulfilled:

The stationary sequence XiX_{i} satisfies θ\theta-mixing and

∑k=1∞ϕ(k)12<∞\sum_{k=1}^{\infty}\phi(k)^{\frac{1}{2}}<\infty,

sup⁡iE∣ei(X1)∣2<∞\sup_{i}\mathcal{E}|e_{i}(X_{1})|^{2}<\infty.

The stationary sequence XiX_{i} satisfies α\alpha-mixing. For some ϵ>0\epsilon>0 and for an even number c≥2c\geq 2 the following holds:

sup⁡iE∣ei(X1)∣2+ϵ≤∞\sup_{i}\mathcal{E}|e_{i}(X_{1})|^{2+\epsilon}\leq\infty,

∑k=1∞kc−2αϵ/(c+ϵ)(k)<∞\sum_{k=1}^{\infty}k^{c-2}\alpha^{\epsilon/(c+\epsilon)}(k)<\infty

where ei(X1)e_{i}(X_{1}) are a basis of L2(X,F)L_{2}(X,F). Then, for any degenerate kernel f(t1,...,tm)∈L2(Xm,Fm)f(t_{1},...,t_{m})\in L_{2}(X_{m},F_{m}), under conditions

∑i1,...,im∞∣fi1,...,im∣<∞\sum_{i_{1},...,i_{m}}^{\infty}|f_{i_{1},...,i_{m}}|<\infty, where fi1,...,imf_{i_{1},...,i_{m}} are the coefficient of ff in L2(Xm,Fm)L_{2}(X_{m},F_{m}),

e0=1e_{0}=1 or Eei(Zj)=0\mathcal{E}e_{i}(Z_{j})=0 for all ii,

where τj\tau_{j} is a centred Gaussian sequence with the covariance matrix

νj(i1,...,im):=∑r=1mδj,ir\nu_{j}(i_{1},...,i_{m}):=\sum_{r=1}^{m}\delta_{j,i_{r}}, and Hk(x)H_{k}(x) are the Hermite polynomials,

A.6 Proofs - Expected value of the eigenfunctions

From the eigenvalue equation λiEei(z)=Eh2(z,Z2∗)ei(Z2∗)\lambda_{i}\mathcal{E}e_{i}(z)=\mathcal{E}h_{2}(z,Z_{2}^{*})e_{i}(Z_{2}^{*}), h2h_{2} degeneracy, and the independence of Z1∗Z_{1}^{*} and Z2∗Z_{2}^{*}, we conclude that