I NTERPRETABLE M ODELS FOR G RANGER C AUSALITY U SING S ELF - EXPLAINING N EURAL N ETWORKS
Anonymous authors
Paper under double-blind review
A BSTRACT
Exploratory analysis of time series data can yield a better understanding of complex dynamical systems.
Granger causality is a practical framework for analysing interactions in sequential data, applied in a wide range of domains.
In this paper, we propose a novel framework for inferring multivariate Granger causality under nonlinear dynamics based on an extension of self-explaining neural networks.
This framework is more interpretable than other neural-network-based techniques for inferring Granger causality, since in addition to relational inference, it also allows detecting signs of Granger-causal effects and inspecting their variability over time.
In comprehensive experiments on simulated data, we show that our framework performs on par with several powerful baseline methods at inferring
Granger causality and that it achieves better performance at inferring interaction signs.
The results suggest that our framework is a viable and more interpretable alternative to sparse-input neural networks for inferring Granger causality.
I NTRODUCTION
Granger causality (GC) (Granger, 1969) is a popular practical approach for the analysis of multivariate time series and has become instrumental in exploratory analysis (McCracken, 2016) in various disciplines, such as neuroscience (Roebroeck et al., 2005), economics (Appiah, 2018) and climatology (Charakopoulos et al., 2018).
Recently, the focus of the methodological research has been on inferring GC under nonlinear dynamics (Tank et al., 2018; Nauta et al., 2019; Wu et al., 2020; Khanna & Tan, 2020; L ¨ owe et al., 2020), causal structures varying across replicates (L ¨ owe et al., 2020), and unobserved confounding (Nauta et al., 2019; L ¨ owe et al., 2020).
To the best of our knowledge the latest powerful techniques for inferring GC do not target the effect sign detection (see Section 2.1 for a formal deﬁnition) or exploration of effect variability with time and, thus, have limited interpretability.
This drawback defeats the purpose of GC analysis as an exploratory statistical tool.
In some nonlinear interactions, one variable may have an exclusively positive or negative effect on another if it consistently drives the other variable up or down, respectively.
Negative and positive causal relationships are common in many real-world systems, for example, gene regulatory networks feature inhibitory effects (Inoue et al., 2011) or in metabolomics, certain compounds may inhibit or promote synthesis of other metabolites (Rinschen et al., 2019).
Differentiating between the two types of interactions would allow inferring and understanding such inhibition and promotion relationships in real-world dynamical systems and would facilitate a more comprehensive and insightful exploratory analysis.
Therefore, we see a need for a framework capable of inferring nonlinear GC which is more amenable to interpretation than previously proposed methods (Tank et al., 2018; Nauta et al., 2019; Khanna & Tan, 2020).
To this end, we introduce a novel method for detecting nonlinear multivariate Granger causality that is interpretable, in the sense that it allows detecting effect signs and exploring inﬂuences among variables throughout time.
The main contributions of the paper are as follows:
We extend self-explaining neural network models (Alvarez-Melis & Jaakkola, 2018) to time series analysis.
The resulting autoregressive model, named generalised vector autoregression (GVAR), is interpretable and allows exploring GC relations between variables, signs of Granger-causal effects, and their variability through time.
We propose a framework for inferring nonlinear multivariate GC that relies on a GVAR model with sparsity-inducing and time-smoothing penalties. Spurious associations are mit-
igated by ﬁnding relationships that are stable across original and time- reversed (Winkler et al., 2016) time series
data. We comprehensively compare the proposed framework and the powerful baseline methods of Tank et al.
(2018), Nauta et al.
and Khanna & Tan (2020) on a range of synthetic time series datasets with known Granger-causal relationships.
We evaluate the ability of the methods to infer the ground truth GC structure and effect signs.
B ACKGROUND AND R ELATED W ORK 2. G RANGER C AUSALITY
Granger-causal relationships are given by a set of directed dependencies within multivariate time series.
The classical deﬁnition of Granger causality is given, for example, by L¨utkepohl (2007).
Below we deﬁne nonlinear multivariate GC, based on the adaptation by Tank et al.
Consider a time series with p variables: { x t } t ∈ Z + = (cid:110)(cid:0) x 1 t x 2 t ... x pt (cid:1) (cid:62) (cid:111) t
∈
Z
+ .
Assume that causal relationships between variables are given by the following structural equation model:
[Equation]
where x j 1:( t − 1) is a shorthand notation for x j 1 , x j 2 , ..., x jt − 1 ; ε it are additive innovation terms; and g i ( · ) are potentially nonlinear functions, specifying how the future values of variable x
i depend on the past values of x .
We then say that variable x j does not Granger-cause variable x
i , denoted as x j (cid:54)−→ x i , if and only if g i ( · ) is constant in x j 1:( t − 1) .
Depending on the form of the functional relationship g i ( · ) , we can also differentiate between positive and negative Granger-causal effects.
In this paper, we deﬁne the effect sign as follows: if g i ( · ) is increasing in all x j 1:( t − 1) , then we say that variable x
j has a positive effect on x i , if g i ( · ) is decreasing in x j 1:( t − 1) , then x j has a negative effect on x i .
Note that an effect may be neither positive nor negative.
For example, x j can ‘contribute’ both positively and negatively to the future of x i at different delays, or, for instance, the effect of x j on x
i could depend on another variable.
Granger-causal relationships can be summarised by a directed graph G =
( V , E ) , referred to as summary graph (Peters et al., 2017), where V = { 1 , ..., p } is a set of vertices corresponding to variables, and E = (cid:8) ( i, j ) :
x i −→ x j (cid:9) is a set of edges corresponding to Granger-causal relationships.
Let
A ∈ { 0 , 1 } p × p denote the adjacency matrix of G .
The inference problem is then to estimate A from observations { x t } Tt =1 , where T is the length of the time series observed.
In practice, we usually ﬁt a time series model that explicitly or implicitly infers dependencies between variables.
Consequently, a statistical test for GC is performed.
A conventional approach (L ¨ utkepohl, 2007) used to test for linear Granger causality is the linear vector autoregression (VAR) (see Appendix A).
2. R ELATED W ORK 2.2. T ECHNIQUES FOR I NFERRING N ONLINEAR G RANGER C AUSALITY
Relational inference in time series has been studied extensively in statistics and machine learning.
Early techniques for inferring undirected relationships include time-varying dynamic Bayesian networks (Song et al., 2009) and time-smoothed, regularised logistic regression with time-varying coefﬁcients (Kolar et al., 2010).
Recent approaches to inferring Granger-causal relationships leverage the expressive power of neural networks (Montalto et al., 2015;
Wang et al., 2018; Tank et al., 2018;
Nauta et al., 2019; Khanna & Tan, 2020; Wu et al., 2020; L ¨ owe et al., 2020) and are often based on regularised autoregressive models, reminiscent of the Lasso Granger method (Arnold et al., 2007).
Tank et al.
(2018) propose using sparse-input multilayer perceptron (cMLP) and long short-term memory (cLSTM) to model nonlinear autoregressive relationships within time series.
Building on this, Khanna & Tan (2020) introduce a more sample efﬁcient economy statistical recurrent unit (eSRU) architecture with sparse input layer weights.
Nauta et al.
(2019) propose a temporal causal discovery framework (TCDF) that leverages attention-based convolutional neural networks to test for GC.
Appendix B contains further details about these and other relevant methods.
Approaches discussed above (Tank et al., 2018; Nauta et al., 2019; Khanna & Tan, 2020) and in
Appendix B (Marinazzo et al., 2008; Ren et al., 2020; Montalto et al., 2015; Wang et al., 2018; Wu et al., 2020; L¨owe et al., 2020) focus almost exclusively on relational inference and do not allow easily interpreting signs of GC effects and their variability through time.
In this paper, we propose a more interpretable inference framework, building on self explaining-neural networks (Alvarez-Melis & Jaakkola, 2018), that, as shown by experiments, performs on par with the techniques described herein.
2.2. S TABILITY - BASED S ELECTION P ROCEDURES
The literature on stability-based model selection is abundant (Ben-Hur et al., 2002; Lange et al., 2003; Meinshausen & B¨uhlmann, 2010; Sun et al., 2013).
For example, Ben-Hur et al.
(2002) propose measuring stability of clustering solutions under perturbations to assess structure in the data and select an appropriate number of clusters.
Lange et al.
(2003) propose a somewhat similar approach.
Meinshausen & B¨uhlmann (2010) introduce the stability selection procedure applicable to a wide range of high-dimensional problems: their method guides the choice of the amount of regularisation based on the error rate control.
Sun et al.
(2013) investigate a similar procedure in the context of tuning penalised regression models.
2.2. S ELF - EXPLAINING N EURAL N ETWORKS
Alvarez-Melis & Jaakkola (2018) introduce self-explaining neural networks (SENN) – a class of intrinsically interpretable models motivated by explicitness, faithfulness, and stability properties.
A
SENN with a link function g ( · ) and interpretable basis concepts h ( x ) : R p
→
R k follows the form f ( x ) = g ( θ
[Equation] [Equation] [Equation]
where x ∈ R p are predictors; and θ ( · ) is a neural network with k outputs.
We refer to θ ( x ) as generalised coefﬁcients for data point x and use them to ‘explain’ contributions of individual basis concepts to predictions. In the case of g ( · ) being sum and concepts being raw inputs, Equationsimpliﬁes to [Equation]
Appendix C lists additional properties SENNs need to satisfy, as deﬁned by Alvarez-Melis & Jaakkola (2018).
A SENN is trained by minimising the following gradient-regularised loss function, which balances performance with interpretability:
[Equation]
where L y ( f ( x ) , y ) is a loss term for the ground classiﬁcation or regression task; λ > 0 is a regularisation parameter; and L θ ( f ( x )) =
(cid:13)(cid:13) ∇ x f ( x ) − θ ( x ) (cid:62) J hx
( x ) (cid:13)(cid:13) 2 is the gradient penalty, where J hx is the Jacobian of h ( · ) w.r.t.
x .
This penalty encourages f ( · ) to be locally linear.
M ETHOD
We propose an extension of SENNs (Alvarez-Melis & Jaakkola, 2018) to autoregressive time series modelling, which is essentially a vector autoregression (see Equation 11 in Appendix A) with generalised coefﬁcient matrices.
We refer to this model as generalised vector autoregression (GVAR).
The GVAR model of order K is given by
[Equation]
where Ψ θ k : R p
→ R p × p is a neural network parameterised by θ k .
For brevity, we omit the intercept term here and in following equations.
No speciﬁc distributional assumptions are made on the additive innovation terms ε t .
Ψ θ k
( x t − k ) is a matrix whose components correspond to the generalised coefﬁcients for lag k at time step t .
In particular, the component ( i, j ) of Ψ θ k ( x t − k ) corresponds to the inﬂuence of x jt − k on x it .
In our implementation, we use K MLPs for Ψ θ k ( · ) with p input units and p 2 outputs each, which are then reshaped into an R p × p matrix.
Observe that the model deﬁned in Equation 5 takes on a form of SENN (see Equation 3) with future time series values as the response, past values as basis concepts, and sum as a link function.
Relationships between variables x 1 , ..., x p and their variability throughout time can be explored by inspecting generalised coefﬁcient matrices.
To mitigate spurious inference in multivariate time series, we train GVAR by minimising the following penalised loss function with the mini-batch gradient descent:
[Equation]
where { x t } Tt =1 is a single observed replicate of a p -variate time series of length T ; ˆ x t = (cid:80)
Kk =1 Ψ
ˆ θ k
( x t − k )
x t − k is the one-step forecast for the t -th time point by the GVAR model; Ψ t is a shorthand notation for the concatenation of generalised coefﬁcient matrices at the t -th time point: (cid:104)
[Equation] ) (cid:105) ∈ R p ×
Kp ; R ( · ) is a sparsity-inducing penalty term; and λ, γ ≥ 0 are regularisation parameters.
The loss function (see Equation 6) consists of three terms: (i) the mean squared error (MSE) loss, (ii) a sparsity-inducing regulariser, and (iii) the smoothing penalty term.
Note, that in presence of categorically-valued variables the MSE term can be replaced with e.g. the cross-entropy loss.
The sparsity-inducing term R ( · ) is an appropriate penalty on the norm of the generalised coefﬁcient matrices.
Examples of possible penalties for the linear VAR are provided in Table 4 in Appendix
A.
These penalties can be easily adapted to the GVAR model.
In the current implementation, we employ the elastic-net-style penalty term (Zou & Hastie, 2005; Nicholson et al., 2017)
R ( Ψ t ) =
α (cid:107) Ψ t (cid:107) 1 + (1 − α ) (cid:107) Ψ t (cid:107) 22 , with α = 0 .
The smoothing penalty term, given by
[Equation]
, is the average norm of the difference between generalised coefﬁcient matrices for two consecutive time points.
This penalty term encourages smoothness in the evolution of coefﬁcients w.r.t.
time and replaces the gradient penalty
L θ ( f ( x )) from the original formulation of SENN (see Equation 4).
Observe that if the term is constrained to be 0 , then the GVAR model behaves as a penalised linear VAR on the training data: coefﬁcient matrices are invariant across time steps.
Thus, the proposed penalised loss function (see Equation 6) allows controlling the (i) sparsity and (ii) nonlinearity of inferred autoregressive dependencies.
As opposed to the related approaches of Tank et al.
and Khanna & Tan (2020), signs of Granger causal effects and their variability in time can be assessed as well by interpreting matrices Ψ
ˆ θ k
( x t ) , for K + 1 ≤ t ≤ T .
Figure 1 shows a plot of generalised coefﬁcients versus time in a toy linear time series (see Appendix L for details).
Observe that for causal relationships, generalised coefﬁcients are large in magnitude, whereas for non-causal links, coefﬁcients are shrunk towards 0.
Moreover, the signs of coefﬁcients agree with the true interaction signs ( a i ).
We further support these claims with empirical results in Section 4.
In addition, we provide an ablation study for the loss function in Appendix D.
3. I NFERENCE F RAMEWORK
Once neural networks Ψ
ˆ θ k , k = 1 , ..., K , have been trained, we quantify strengths of Grangercausal relationships between variables by aggregating matrices Ψ
ˆ θ k
( x t ) across all time steps into summary statistics.
We aggregate the obtained generalised coefﬁcients into matrix S ∈ R p × p as follows:
[Equation]
Intuitively, S i,j are statistics that quantify the strength of the Granger-causal effect of x i on x j using magnitudes of generalised coefﬁcients.
{+We expect S i,j to be close to 0 for non-causal relationships and S i,j (cid:29) 
+}
if x i → x j . Note that in practice S is not binary-valued, as opposed to the ground truth adjacency matrix A , which we want to infer, because the outputs of Ψ ˆ θ k ( · ) are not shrunk to exact zeros. Therefore, we need a procedure deciding for which variable pairs S i,j are signiﬁcantly different from 0.
To infer a binary matrix of GC relationships, we propose a heuristic stability-based procedure that relies on time-reversed Granger causality (TRGC) (Haufe et al., 2012;
Winkler et al., 2016).
The intuition behind time reversal is to compare causality scores obtained from original and time-reversed data: we expect relationships to be ﬂipped on time-reversed data (Haufe et al., 2012;
Winkler et al., 2016). Winkler et al.
(2016) prove the validity of time reversal for linear ﬁnite-order autoregressive processes.
In our work, time reversal is leveraged for inferring stable dependency structures in nonlinear time series.
Algorithm 1 summarises the proposed stability-based thresholding procedure.
During inference, two separate GVAR models are trained: one on the original time series data, and another on timereversed data (lines 3-4 in Algorithm 1).
Consequently, we estimate strengths of GC relationships with these two models, as in Equation 7, and choose a threshold for matrix S which yields the highest agreement between thresholded GC strengths estimated on original and time-reversed data (lines 5in Algorithm 1). A sequence of Q thresholds, given by ξ = ( ξ 1 , ..., ξ Q ) , is considered where the i -th threshold is an ξ i -quantile of values in S .
The agreement between inferred thresholded structures is measured (line 7 in Algorithm 1) using balanced accuracy score (Brodersen et al., 2010), denoted by BA ( · , · ) , equal-to the average of sensitivity and speciﬁcity, to reﬂect both sensitivity and speciﬁcity of the inference results. Other measures can be used for quantifying the agreement, for example, graph similarity scores (Zager & Verghese, 2008). In this paper, we utilise BA, because considered time series have sparse GC summary graphs and BA weighs positives and negatives equally.
In practice, trivial solutions, such as inferring no causal relationships, only self-causal links or all possible causal links, are very stable.
The agreement for such solutions is set to 0.
Thus, the procedure assumes that the true causal structure is different from these trivial cases.
Figure 6 in Appendix E contains an example of stability-based thresholding applied to simulated data.
Algorithm 1: Stability-based thresholding. Input: One replicate of multivariate time series { x t } Tt =1 ; regularisation parameters λ and γ ≥ 0 ; model order K ≥ 1 ; sequence ξ = ( ξ 1 , ..., ξ Q ) , 0 ≤ ξ 1 < ξ 2 < ... < ξ Q ≤ 1 .
Output: Estimate ˆ A of the adjacency matrix of the GC summary graph.
Let { ˜ x t } Tt =1 be the time-reversed version of { x t } Tt =1 , i.e. { ˜ x 1 , ..., ˜ x T } ≡ { x T , ..., x 1 } .
Let τ ( X , χ ) be the elementwise thresholding operator.
For each component of X , τ ( X i,j , χ )
= 1 , if | X i,j | ≥ χ , and τ [Equation]
To summarise, this procedure attempts to ﬁnd a dependency structure that is stable across original and time-reversed data in order to identify signiﬁcant Granger-causal relationships.
In Section 4, we demonstrate the efﬁcacy of this inference framework. In particular, we show that it performs on par with previously proposed approaches mentioned in Section 2.2.
3.1. C OMPUTATIONAL C OMPLEXITY
Our inference framework differs from the previously proposed cMLP, cLSTM
(Tank et al., 2018),
TCDF (Nauta et al., 2019), and eSRU (Khanna & Tan, 2020) w.r.t. computational complexity.
Mentioned methods require training p neural networks, one for each variable separately, whereas our inference framework trains 2 K neural networks.
A clear disadvantage of GVAR is its memory complexity: GVAR has many more parameters, since every MLP it trains has p 2 outputs.
Appendix F provides a comparison between training times on simulated datasets with p ∈ { 4 , 15 , 20 } .
In practice, for a moderate order K and a larger p , we observe that training a GVAR model is faster than a cLSTM and eSRU.
E XPERIMENTS
The purpose of our experiments is twofold: ( i ) to compare methods in terms of their ability to infer the underlying GC structure; and ( ii ) to compare methods in terms of their ability to detect signs of
GC effects.
We compare GVAR to 5 baseline techniques: VAR with F -tests for Granger causalityand the Benjamini-Hochberg procedure (Benjamini & Hochberg, 1995) for controlling the false discovery rate (FDR) (at q = 0 . 05 ); cMLP and cLSTM (Tank et al., 2018) 2 ; TCDF (Nauta et al., 2019) 3 ; and eSRU (Khanna & Tan, 2020) 4 .
We particularly focus on the baselines that, similarly to GVAR, leverage sparsity-inducing penalties, namely cMLP, cLSTM, and eSRU.
In addition, we provide a comparison with dynamic Bayesian networks (Murphy & Russell, 2002) in Appendix I.
4. I NFERRING G RANGER C AUSALITY
graph adjacency matrix of the Lorenz 96 system with p = 20 .
Dark cells correspond to the absence of a GC relationship; light cells denote a GC relationship.
We ﬁrst compare methods w.r.t.
their ability to infer GC relationships correctly on two synthetic datasets.
We evaluate inferred dependencies on each independent replicate/simulation separately against the adjacency matrix of the ground truth GC graph, an example is shown in Figure 2.
Each method is trained only on one sequence.
Unless otherwise mentioned, we use accuracy (ACC) and balanced accuracy (BA) scores to evaluate thresholded inference results.
For cMLP, cLSTM, and eSRU, the relevant weight norms are compared to 0. For
TCDF, thresholding is performed within the framework based on the permutation test described by Nauta et al.
For GVAR, thresholded matrices are obtained by applying Algorithm 1.
In addition, we look at the continuously-valued inference results: norms of relevant weights, scores, and strengths of GC relationships (see Equation 7).
We compare these scores against the true structure using areas under receiver operating characteristic (AUROC) and precision-recall (AUPRC) curves.
For all evaluation metrics, we only consider offdiagonal elements of adjacency matrices, ignoring self-causal relationships, which are usually the easiest to infer.
Note that our evaluation approach is different from those of Tank et al.
and Khanna & Tan (2020); this partially explains some deviations from their results.
Relevant hyperparameters of all models are tuned to maximise the BA score or AUPRC (if a model fails to shrink any weights to zeros) by performing a grid search (see Appendix H for details about hyperparameter tuning).
4.1. L ORENZ 96 M ODEL
A standard benchmark for the evaluation of GC inference techniques is the Lorenz 96 model (Lorenz, 1995).
This continuous time dynamical system in p variables is given by the following nonlinear differential equations:
[Equation]
where x 0 := x p , x − 1 := x p − 1 , and x p +1 := x 1 ; and F is a forcing constant that, in combination with p , controls the nonlinearity of the system (Tank et al., 2018; Karimi & Paul, 2010).
As can be seen from Equation 8, the true causal structure is quite sparse. Figure 2 shows the adjacency matrix of the summary graph for this dataset (for other datasets, adjacency matrices are visualised in Appendix G).
We numerically simulate R = 5 replicates with p = 20 variables and T =observations under F = 10 and F = 40 .
The setting is similar to the experiments of Tank et al.
(2018) and Khanna & Tan (2020), but includes more variables.
Table 1 summarises the performance of the inference techniques on the Lorenz 96 time series under
F = 10 and F = 40 .
For F = 10 , all of the methods apart from TCDF are very successful at inferring GC relationships, even linear VAR.
On average, GVAR outperforms all baselines, although performance differences are not considerable.
For F = 40 , the inference problem appears to be more difﬁcult (Appendix J investigates performance of VAR and GVAR across a range of forcing constant values).
In this case, TCDF and cLSTM perform surprisingly poorly, whereas cMLP, eSRU, and
GVAR achieve somewhat comparable performance levels.
GVAR attains the best combination of accuracy and BA scores, whereas cMLP has the highest AUROC and AUPRC.
Thus, on Lorenzdata, the performance of GVAR is competitive with the other methods. and 40 .
Inference is performed on each replicate separately, standard deviations (SD) are evaluated across 5 replicates
[Table]
4.1. S IMULATED F MRI T IME S ERIES
Another dataset we consider consists of rich and realistic simulations of blood-oxygen-leveldependent (BOLD) time series (Smith et al., 2011) that were generated using the dynamic causal modelling functional magnetic resonance imaging (fMRI) forward model 5 .
In these time series, variables represent ‘activity’ in different spatial regions of interest within the brain.
Herein, we consider R = 5 replicates from the simulation no. 3 of the original dataset.
These time series contain p = 15 variables and only T = 200 observations.
The ground truth causal structure is very sparse (see Appendix G).
Details about hyperparameter tuning performed for this dataset can be found in
Appendix H.2.
This experiment is similar to one presented by Khanna & Tan (2020)
[Table]
Table 2 provides a comparison of the inference techniques.
Surprisingly, TCDF outperforms other methods by a considerable margin (cf.
Table 1).
It is followed by our method that, on average, outperforms cMLP, cLSTM
[Table]
and eSRU in terms of both AUROC and AUPRC.
GVAR attains a
BA score comparable to cLSTM.
Importantly, eSRU fails to shrink any weights to exact zeros, thus, hindering the evaluation of accuracy and balanced accuracy scores (marked as ‘NA’ in Table 2).
This experiment demonstrates that the proximal gradient descent (Parikh & Boyd, 2014), as implemented by eSRU (Khanna & Tan, 2020), may fail to shrink any weights to 0 or shrinks all of them, even in relatively simple datasets.
cMLP seems to provide little improvement over simple VAR w
[Table]
r.t.
AUROC or AUPRC.
In general, this experiment promisingly shows that GVAR performs on par with the techniques proposed by Tank et al.
and Khanna & Tan (2020) in a more realistic and data-scarce scenario than the Lorenz 96 experiment.
[Table]
4. I NFERRING E FFECT S IGN
So far, we have only considered inferring GC relationships, but not the signs of Granger-causal effects.
Such information can yield a better understanding of relations among variables.
To this end, we consider the Lotka–Volterra model with multiple species (cid:0) Baca¨er (2011) provides a deﬁnition of the original two-species system (cid:1) , given by the following differential equations:
[Equation]
where x i correspond to population sizes of prey species; y j denote population sizes of predator species 6 ; α, β, η, δ, ρ > 0 are ﬁxed parameters controlling strengths of interactions; and Pa ( x i ) ,
Pa ( y j ) are sets of Granger-causes of x i and y j , respectively.
According to Equations 9 and 10, the population size of each prey species x i is driven down by (cid:12)(cid:12)
Pa ( x i ) (cid:12)(cid:12) predator species (negative effects), whereas each predator species y j is driven up by (cid:12)(cid:12)
Pa ( y j ) (cid:12)(cid:12) prey populations (positive effects).
We simulate the multi-species Lotka–Volterra system numerically.
Appendix K contains details about simulations and the summary graph of the time series.
To infer effect directions, we inspect signs of median generalised coefﬁcients for trained GVAR models.
For cMLP, cLSTM, TCDF, and eSRU, we inspect signs of averaged weights in relevant layers.
For VAR, we examine coefﬁcient signs.
For the sake of fair comparison, we restrict all models to a maximum lag of K = 1 (where applicable).
In this experiment, we focus on BA scores for positive (cid:0) BA pos (cid:1) and negative (cid:0) BA neg (cid:1) relationships.
Appendix L provides another example of detecting effect signs with GVAR, on a trivial benchmark with linear dynamics.
Table 3 shows the results for this experiment.
Linear VAR does not perform well at inferring the
GC structure, however, its coefﬁcient signs are strongly associated with true signs of relationships.
cMLP provides a considerable improvement in GC inference, and surprisingly its input weights are informative about the signs of GC effects.
cLSTM fails to shrink any of the relevant weights to zero; furthermore, the signs of its weights are not associated with the true signs.
Although eSRU performs better than VAR at inferring the summary graph, its weights are not associated with effect signs at all.
TCDF performs poorly in this experiment, failing to infer any relationships apart from selfcausation.
Our model considerably outperforms all baselines in detecting effect signs, achieving nearly perfect scores: it infers more meaningful and interpretable parameter values than all other models.
These results are not surprising, because the baseline methods, apart from linear VAR, rely on interpreting weights of relevant layers that, in general, do not need to be associated with effect signs and are only informative about the presence or absence of GC interactions.
Since the GVAR model follows a form of SENNs (see Equation 2), its generalised coefﬁcients shed more light into how the future of the target variable depends on the past of its predictors.
This restricted structure is more intelligible and yet is sufﬁciently ﬂexible to perform on par with sparse-input neural networks.
[Table]
[Figure] In addition to inferring the summary graph, GVAR allows inspecting variability of generalised coefﬁcients.
Figure 3 provides an example of generalised coefﬁcients inferred for a two-species Lotka–
Volterra system.
Although coefﬁcients vary with time, GVAR consistently infers that the predator population is driven up by prey and the prey population is driven down by predators.
For the multispecies system used to produce the quantitative results, inferred coefﬁcients behave similarly (see
Figure 12 in Appendix K).
C ONCLUSION
In this paper, we focused on two problems: ( i ) inferring Granger-causal relationships in multivariate time series under nonlinear dynamics and ( ii ) inferring signs of Granger-causal relationships.
We proposed a novel framework for GC inference based on autoregressive modelling with self-explaining neural networks and demonstrated that, on simulated data, its performance is promisingly competitive with the related methods of Tank et al.
and Khanna & Tan (2020).
Proximal gradient descent employed by cMLP, cLSTM, and eSRU often does not shrink weights to exact zeros and, thus, prevents treating the inference technique as a statistical hypothesis test.
Our framework mitigates this problem by performing a stability-based selection of signiﬁcant relationships, ﬁnding a GC structure that is stable on original and time-reversed data.
Additionally, proposed GVAR model is more amenable to interpretation, since relationships between variables can be explored by inspecting generalised coefﬁcients, which, as we showed empirically, are more informative than input layer weights.
To conclude, the proposed model and inference framework are a viable alternative to previous techniques and are better suited for exploratory analysis of multivariate time series data.
In future research, we plan a thorough investigation of the stability-based thresholding procedure (see Algorithm 1) and of time-reversal for inferring GC.
Furthermore, we would like to facilitate a more comprehensive comparison with the baselines on real-world data sets.
It would also be interesting to consider better-informed link functions and basis concepts (see Equation 2).
Last but not least, we plan to tackle the problem of inferring time-varying GC structures with the introduced framework.
A L INEAR V ECTOR A UTOREGRESSION
Linear vector autoregression (VAR) (L¨utkepohl, 2007) is a time series model conventionally used to test for Granger causality (see Section 2.1).
VAR assumes that functions
g i ( · ) in Equation 1 are linear:
[Equation]
where ν ∈ R p is the intercept vector;
Ψ k ∈ R p × p are coefﬁcient matrices; and ε t ∼ N p ( 0 , Σ ε ) are Gaussian innovation terms.
Parameter K is the order of the VAR model and determines the maximum lag at which Granger-causal interactions occur.
In VAR, Granger causality is deﬁned by zero constraints on the coefﬁcients, in particular, x i does not Granger-cause x j if and only if, for all lags k ∈ { 1 , 2 , ..., K } , ( Ψ k ) j,i = 0 .
These constraints can be tested by performing, for example,
F -test or Wald test.
Usually a VAR model is ﬁtted using multivariate least squares.
In high-dimensional time series, regularisation can be introduced to avoid inferring spurious associations.
Table 4 shows various sparsity-inducing penalties for a linear VAR model of order
K (see Equation 11), described by
Nicholson et al.
Different penalties induce different sparsity patterns in coefﬁcient matrices Ψ 1 , Ψ 2 , ..., Ψ K .
These penalties can be adapted to the GVAR model for the sparsity-inducing term
R ( · ) in Equation 6.
Ψ...
Ψ K
] ∈ R p ×
Kp (
[Table]
B I NFERRING G RANGER C AUSALITY UNDER N ONLINEAR D YNAMICS
Below we provide a more detailed overview of the related work on inferring nonlinear multivariate
Granger causality, focusing on the recent machine learning techniques that tackle this problem.
Kernel-based Methods .
Kernel-based GC inference techniques provide a natural extension of the
VAR model, described in Appendix A, to nonlinear dynamics.
Marinazzo et al.
(2008) leverage reproducing kernel Hilbert spaces to infer linear Granger causality in an appropriate transformed feature space.
Ren et al.
(2020) introduce a kernel-based GC inference technique that relies on regularisation – Hilbert–Schmidt independence criterion (HSIC)
Lasso GC.
Neural Networks with Non-uniform Embedding .
Montalto et al.
(2015) propose neural networks with non-uniform embedding (NUE).
Signiﬁcant Granger causes are identiﬁed using the NUE, a feature selection procedure.
An MLP is ‘grown’ iteratively by greedily adding lagged predictor components as inputs.
Once stopping conditions are satisﬁed, a predictor time series is claimed a signiﬁcant cause of the target if at least one of its lagged components was added as an input.
This technique is prohibitively costly, especially, in a high-dimensional setting, since it requires training and comparing many candidate models.
Wang et al.
(2018) extend the NUE by replacing MLPs with
LSTMs.
Neural Granger Causality .
Tank et al.
(2018) propose inferring nonlinear Granger causality using structured multilayer perceptron and long short-term memory with sparse input layer weights, cMLP and cLSTM.
To infer GC, p models need to be trained with each variable as a response.
cMLP and cLSTM leverage the group Lasso penalty and proximal gradient descent (Parikh & Boyd, 2014) to infer GC relationships from trained input layer weights.
Attention-based Convolutional Neural Networks .
Nauta et al.
(2019) introduce the temporal causal discovery framework (TCDF) that utilises attention-based convolutional neural networks (CNN).
Similarly to cMLP and cLSTM (Tank et al., 2018), the TCDF requires training p neural network models to forecast each variable.
Key distinctions of the TCDF are (i) the choice of the temporal convolutional network architecture over MLPs or LSTMs for time series forecasting and (ii) the use of the attention mechanism to perform attribution.
In addition to the GC inference, the
TCDF can detect time delays at which Granger-causal interactions occur.
Furthermore, Nauta et al.
(2019) provide a permutation-based procedure for evaluating variable importance and identifying signiﬁcant causal links.
Economy Statistical Recurrent Units .
Khanna & Tan (2020) propose an approach for inferring nonlinear Granger causality similar to cMLP and cLSTM (Tank et al., 2018).
Likewise, they penalise norms of weights in some layers to induce sparsity.
The key difference from the work of Tank et al.
(2018) is the use of statistical recurrent units (SRUs) as a predictive model.
Khanna & Tan (2020) propose a new sample-efﬁcient architecture – economy-SRU (eSRU).
Minimum Predictive Information Regularisation .
Wu et al.
(2020) adopt an informationtheoretic approach to Granger-causal discovery.
They introduce learnable corruption, e.g. additive
Gaussian noise with learnable variances, for predictor variables and minimise a loss function with minimum predictive information regularisation that encourages the corruption of predictor time series.
Similarly to the approaches of Tank et al.
Nauta et al.
; Khanna & Tan (2020), this framework requires training p models separately.
Amortised Causal Discovery & Neural Relational Inference .
Kipf et al.
(2018) introduce the neural relational inference (NRI) model based on graph neural networks and variational autoencoders.
The NRI model disentangles the dynamics and the undirected relational structure represented explicitly as a discrete latent graph variable.
This allows pooling time series data with shared dynamics, but varying relational structures.
L ¨ owe et al.
(2020) provide a natural extension of the NRI model to the Granger-causal discovery.
They introduce a more general framework of the amortised causal discovery wherein time series replicates have a varying causal structure, but share dynamics.
In contrast to the previous methods (Tank et al., 2018; Nauta et al., 2019; Khanna & Tan, 2020; Wu et al., 2020), which in this setting, have to be retrained separately for each replicate, the NRI is trained on the pooled dataset, leveraging shared dynamics.
C P ROPERTIES OF S ELF - EXPLAINING N EURAL N ETWORKS
As deﬁned by Alvarez-Melis & Jaakkola (2018), g ( · ) , θ ( · ) , and h ( · ) in Equation 2 need to satisfy:
g ( · ) is monotonic and additively separable in its arguments; 2.
∂g
∂z i > 0 with z i
= θ ( x ) i h
( x ) i , for all i ; 3.
θ ( · ) is locally difference-bounded by h ( · ) ,
i
e. for every x 0 , there exist δ > 0 and L ∈ R s.t.
if (cid:107) x − x 0 (cid:107) <
δ , then (cid:107) θ ( x ) − θ ( x 0 ) (cid:107) ≤ L (cid:107)
h ( x ) − h ( x 0 ) (cid:107) ; 4. { h ( x ) i } ki =1 are interpretable representations of x ; 5.
k is small.
D A BLATION S TUDY OF THE L OSS F UNCTION
We inspect hyperparameter tuning results for the GVAR model on Lorenz 96 (see Section 4.1.1) and synthetic fMRI time series (Smith et al., 2011)
(see Section 4.1.2) as an ablation study for the loss function proposed (see Equation 6).
Figures 4 and 5 show heat maps of BA scores (left) and AUPRCs (right) for different values of parameters λ and γ for Lorenz 96 and fMRI datasets, respectively.
For the Lorenz 96 system, sparsity-inducing regularisation appears to be particularly important, nevertheless, there is also an increase in BA and AUPRC from a moderate smoothing penalty.
For fMRI, we observe considerable performance gains from introducing both the sparsityinducing and smoothing penalty terms.
Given the sparsity of the ground truth GC structure and the scarce number of observations ( T = 200 ), these gains are not unexpected.
During preliminary experiments, we ran grid search across wider ranges of λ and γ values, however, did not observe further improvements from stronger regularisation.
In summary, these results empirically motivate the need for two different forms of regularisation leveraged by the GVAR loss function: the sparsityinducing and smoothing penalty terms
E S TABILITY - BASED T HRESHOLDING : E XAMPLE
Figure 6 shows an example of agreement between dependency structures inferred on original and time-reversed synthetic sequences across a range of thresholds (see Algorithm 1).
In addition, we plot the BA score for resulting thresholded matrices evaluated against the true adjacency matrix.
As can be seen, the peak of stability agrees with the highest BA achieved.
In both cases, the procedure described by Algorithm 1 chooses the optimal threshold, which results in the highest agreement with the true dependency structure (unknown at the time of inference).
[Figure]
F C OMPARISON OF T RAINING & I NFERENCE T IME
To compare the considered methods in terms of their computational complexity, we measure training and inference time across three simulated datasets with p ∈ { 4 , 15 , 20 } variables and varying time series lengths.
This experiment was performed on an Intel Core i7-7500U CPU (2.70 GHz × 4) with a GeForce GTX 950M GPU.
All models were trained for 1000 epochs with a mini-batch size of 64.
In each dataset, the same numbers of hidden layers and hidden units were used across all models.
When applicable, models were restricted to the same order ( K ).
Table 5 contains average training and inference time in seconds with standard deviations.
Observe that for the fMRI and Lorenzdatasets, GVAR is substantially faster than cLSTM and eSRU.
[Table]
G GC S UMMARY G RAPHS OF S IMULATED T IME S ERIES
[Figure]
Dark cells correspond to the absence of a GC relationship, i.e. A i,j = 0 ; light cells denote a GC relationship, i.e. A i,j = 1 .
H H YPERPARAMETER T UNING
In our experiments (see Section 4), for all of the inference techniques compared, we searched across a grid of hyperparameters that control the sparsity of inferred GC structures.
Other hyperparameters were ﬁne-tuned manually.
Final results reported in the paper correspond to the best hyperparameter conﬁgurations.
With this testing setup, our goal was to fairly compare best achievable inferential performance of the techniques.
Tables 6, 7, and 8 provide ranges for hyperparameter values considered in each experiment.
For cMLP and cLSTM (Tank et al., 2018), parameter λ is the weight of the group Lasso penalty; for
TCDF (Nauta et al., 2019), signiﬁcance parameter α is used to decide which potential GC relationships are signiﬁcant; eSRU (Khanna & Tan, 2020) has three different penalties weighted by λ 1:3 .
For the stability-based thresholding (see Algorithm 1) in GVAR, we used Q = 20 equally spaced values in [0 , 1] as sequence ξ 7 .
For Lorenz 96 and fMRI experiments, grid search results are plotted in
Figures 4, 8, and 5.
Figure 9 contains GVAR grid search results for the Lotka–Volterra experiment.
H.
[Figure] [Table]
[Table]
[Table]
L OTKA -V OLTERRA
[Table]
[Figure]
I C OMPARISON WITH D YNAMIC B AYESIAN N ETWORKS
We provide a comparison between GVAR and linear Gaussian dynamic Bayesian networks (DBN).
DBNs are a classical approach to temporal structure learning (Murphy & Russell, 2002).
We use R (R Core Team, 2020) package dbnR (Quesada, 2020) to ﬁt DBNs on all datasets considered in Section 4.
We use two structure learning algorithms: the max-min hill-climbing (MMHC) (Tsamardinos et al., 2006) and the particle swarm optimisation (Xing-Chen et al., 2007).
Table 9 contains average balanced accuracies achieved by DBNs and GVAR for inferring the GC structure.
Not surprisingly,
DBNs outperform GVAR on the time series linear dynamics, but fail to infer the true structure on Lorenz 96, fMRI, and Lotka–Volterra datasets.
[Table]
J T HE L ORENZ 96 S YSTEM : F URTHER E XPERIMENTS
In addition to the experiments in Section 4.1.1, we examine the performance of VAR and GVAR models across a range of forcing constant values F = 0 , 5 , 10 , 25 , 50 for the Lorenz 96 system with p =variables.
Figure 10 shows average AUPRCs with bands corresponding to the 95% CI for the mean.
It appears that for both models, inference is more challenging for lower ( < 10 ) and higher values of F ( > 20 ).
This observation is in agreement with the results in Section 4.1.1, where all inference techniques performed worse under F = 40 than under F = 10 .
Note that herein same GVAR hyperparameters were used across all values of F .
It is possible that better inferential performance could be achieved with GVAR after comprehensive hyperparameter tuning.
K T HE L OTKA –V OLTERRA S YSTEM
The original Lotka–Volterra system (Baca ¨ er, 2011) includes only one predator and one prey species, population sizes of which are denoted by x and y, respectively.
Population dynamics are given by the following coupled differential equations: [Equation]
[Equation]
(13) where α, β, δ, ρ > 0 are ﬁxed parameters determining strengths of interactions.
In this paper, we consider a multiple species version of the system, given by Equations 9 andin Section 4.2.
We simulate the system under α = ρ = 1 . 1 , β
= δ = 0 .
2 , η = 2 .
75 × 10 − 5 , (cid:12)(cid:12)
Pa ( x i ) (cid:12)(cid:12) = (cid:12)(cid:12) Pa ( y j ) (cid:12)(cid:12) = 2 , p = 10 , i.e. 2 p = 20 variables in total, with T = 2000 observations.
Figure 11 depicts signs of GC effects between variables in a multi-species Lotka–Volterra with 2 p = 20 species and 2 parents per variable.
We simulate this system numerically by using the Runge-Kutta method 8 .
We make a few adjustments to the state transition equations, in particular: we introduce normally-distributed innovation terms to make simulated data noisy; during state transitions, we clip all population sizes below 0.
Figure 12 shows traces of generalised coefﬁcients inferred by GVAR: magnitudes and signs of coefﬁcients reﬂect the true dependency structure.
L E FFECT S IGN D ETECTION IN A L INEAR VAR
Herein we provide results for the evaluation of GVAR and our inference framework on a very simple synthetic time series dataset.
We simulate time series with p = 4 variables and linear interaction dynamics given by the following equations:
[Equation]
where coefﬁcients a i ∼ U ([ − 0 .
8 , − 0 .
2] ∪ [0 . 2 , 0 . 8]) are sampled independently in each simulation; and ε · t ∼ N (0 , 0 . 16) are additive innovation terms.
This is an adapted version of one of artiﬁcial datasets described by Peters et al.
(2013), but without instantaneous effects.
The GC summary graph of the system is visualised in Figure 13.
It is considerably denser than for the Lorenz 96, fMRI, and Lotka–Volterra time series investigated in Section 4.
Similarly to the experiment described in Section 4.2, we infer GC relationships with the proposed framework and evaluate inference results against the true dependency structure and effect signs.
Table 10 contains average performance across 10 simulations achieved by
GVAR with hyperparameter values K = 1 , λ = 0 .
2 , and γ = 0 .
In addition, we provide results for some of the baselines (no systematic hyperparameter tuning was performed for this experiment).
GVAR attains perfect AUROC and AUPRC in all 10 simulations.
In some cases, stability-based thresholding fails to recover a completely correct GC structure, nevertheless, average accuracy and balanced accuracy scores are satisfactory.
Signs of inferred generalised coefﬁcients mostly agree with the ground truth effect signs, as given by coefﬁcients a 1:8 in Equation 14.
Not surprisingly, linear VAR performs the best on this dataset w.r.t.
all evaluation metrics.
Both cMLP and eSRU successfully infer GC relationships, achieving results comparable to GVAR.
However, neither infers effect signs as well as GVAR.
Thus, similarly to the experiment in Section 4.2, we conclude that generalised coefﬁcients are more interpretable than neural network weights leveraged by cMLP, TCDF, and eSRU.
To summarise, this simple experiment serves as a sanity check and shows that our GC inference framework performs reasonably in low-dimensional time series with linear dynamics and a relatively dense GC summary graph (cf.
Figure 7).
Generally, the method successfully infers both the dependency structure and interaction signs. [Table] M P REDICTION E RROR
Herein we evaluate the prediction error of models on held-out data.
Last 20% of time series points were held out to perform prediction on Lorenz 96, fMRI
[Table]
and Lotka–Volterra datasets.
Root-meansquare error (RMSE) was computed for predictions across R = 5 independent replicates:
[Equation]
j =
[Equation]
(cid:118)(cid:117)(cid:117)(cid:116)(cid:80)
[Equation]
, (15) where ˆ x jt is the one-step forecast made by a model for the t -th point of the j -th variable
[Table]
and T is the length of the held-out time series segment.
Table 11 contains average RMSEs for all models across the considered datasets.
In general, RMSEs are not associated with the inferential performance of the models (cf. tables 1,
[Table]
and 3).
For example, while TCDF achieves the best inferential performance on fMRI (see Table 2), its prediction error is higher than for cMLP.
This ‘misalignment’ between the prediction error and the consistency of variable selection is not surprising and has been discussed before, e.g. by Meinshausen & B ¨ uhlmann (2010).
[Table]