# Dynamic Functional Principal Components for Testing Causality
## 3 Testing Linear Causality
### Three Procedures for Testing the Causality  
This first testing procedure is called F-causality (see Algorithm 1) and is explained in detail in [6]. We propose an enhanced procedure (see Algorithm 2) inspired by [18] and by [17] based on dynamic functional principal components. This is the second testing procedure. In this case, the number of dynamic functional principal components (\(d\) and \(d^{\prime}\)) can be chosen to explain a reasonable part of the variance (for example, 85%). This second procedure is called Dynamic-FPCA. We propose a last procedure, called the Classical test. This last procedure is based on differentiating the series, which are viewed as classical time series of period \(m\). Recall that we have  
\[ \begin{array}{rll}H_{0}&:&\text{No causal relation},\\ H_{1}&:&\text{causal relation},\end{array} \]  
and in the case of FAR(1), this is equivalent to  
\[ \begin{array}{rll}H_{0}&:&\rho_{12}=0\\ H_{1}&:&\rho_{12}\
eq 0.\end{array} \]  
We present the three procedures of testing non-causality under the form of the Algorithms 1-3. Algorithm 1 refers to first testing procedure (F-causality). The second one (Algorithm 2) is based on the scores of the dynamic functional principal components, and the second testing procedure (Dynamic-FPCA). The last one (Algorithm 3) refers to the classical testing procedure (Classical). ```
1. (Data) We have \((X_{1},\ldots,X_{n})\) and \((Y_{1},\ldots,Y_{n})\)
2. (Estimation of the parameters) We perform the estimation of \(\rho\) according to the previous section. We separate the two different models, one estimation of \(\rho\) without the \(Y_{i}\) (nested model) and one that includes them (pooled model). 3. (Estimation of the errors) \(\varepsilon_{1}\) is then estimated in the different models for \(t=2,\ldots,n\), by

\[\left\{ \begin{array}{l}\widehat{\varepsilon}_{t}^{1}=Y_{t}-\widehat{\rho}_{ 11}(Y_{t-1})+\widehat{\rho}_{12}(X_{t-1}),\text{ (pooled model)},\\ \widehat{\varepsilon}_{t}^{2}=Y_{t}-\widehat{\rho}_{11}(Y_{t-1}),\text{ (nested model)}.\end{array} \right.\]
4. (Test the equality of operators based on the errors) We perform the proposed test of [PERSON] and [PERSON] [16] on the equality of the covariance operators of the estimated errors. ```
1. (Data) We have \((X_{1},\ldots,X_{n})\) and \((Y_{1},\ldots,Y_{n})\). 2. (Parameters) Choose \(L\) and \(q\) defined in Section 3.1. 3. (Dynamic FPCA) Compute the first \(d\) and \(d^{\prime}\) dynamic FPCA scores for the two functional time series. 4. Use a multivariate test on the scores to conclude. For instance, (a) Model the scores by a VAR model. (b) Apply a Wald test on the scores. ```
**Algorithm 2** Dynamic-FPCA Test
```
1. (Data) We have \((X_{1},\ldots,X_{n})\) and \((Y_{1},\ldots,Y_{n})\), and each curve has \(m\) points. 2. (time series) We obtain two \"classical\" time series \((x_{1},\ldots,x_{m\
eq n})\) and \((y_{1},\ldots,y_{m\
eq n})\) by not viewing them as functional time series. 3. (Differencing) Due to the potentially non-stationarity of these classical time series, we use the differencing technique of period \(m\). 4. Use a multivariate test to conclude. ## 4 Empirical Analysis

### Design of the Experiments

A simulation study was developed to check the performance of the three procedures. We used R software, namely package \"fda\" [20], \"far\" [21] and \"freqdom.fda\". To verify the results of our test under the Null and the alternatives, we simulated different scenarios. We used the packages \"far\" in order to simulate functional time series and to estimate the parameters of the models, the package \"fda\" to perform the test of equality of covariance and the package \"freqdom.fda\" to compute the dynamic FPCA scores. Under the null, we used three independent functional time series and one model computed with the \"far\" package (see \"Null 1\"). Under the alternative of causality, we tested five different scenarios. We simulated with \(\rho\) on a sinusoidal basis that approximates the Hilbert space \(\mathcal{H}\).