Next Article in Journal
Optimization of the Unambiguity of Cross-Correlated Ultrasonic Signals through Coded Excitation Sequences for Robust Time-of-Flight Measurements
Previous Article in Journal
Efficient Retrieval of Music Recordings Using Graph-Based Index Structures
Previous Article in Special Issue
Adaptive Sparse Cyclic Coordinate Descent for Sparse Frequency Estimation
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Article

Dynamic Functional Principal Components for Testing Causality

L@bISEN, Vision-AD Team, ISEN Yncrea Ouest, 2 rue de la Châtaigneraie, 35510 Cesson-Sévigné, France
*
Author to whom correspondence should be addressed.
Submission received: 29 December 2020 / Revised: 30 April 2021 / Accepted: 4 June 2021 / Published: 8 June 2021
(This article belongs to the Special Issue Signal Processing and Time-Frequency Analysis)

Abstract

:
In this paper, we investigate the causality in the sense of Granger for functional time series. The concept of causality for functional time series is defined, and a statistical procedure of testing the hypothesis of non-causality is proposed. The procedure is based on projections on dynamic functional principal components and the use of a multivariate Granger test. A comparative study with existing procedures shows the good results of our test. An illustration on a real dataset is provided to attest the performance of the proposed procedure.

1. Introduction

Functional data analysis has become an important field of modern statistics, and now an abundant literature on this topic exists. The monograph of [1] is an introductory source with very valuable examples and techniques for the analysis of functional data. Another standard book about functional data analysis is [2]. As a good introduction to dependent functional data and functional time series, we recommend the monographs of [3,4]. Recently, the classical notion of causality in the sense of Granger (see [5]) has been extended to the functional time series cases. This extension is important and useful to the statistical community. The notion of Granger causality test can be explained as a statistical hypothesis test that measures the usefulness of adding a variable to forecast another variable. Granger causality is a predictive notion of causality. The causality for functional time series has been studied from a Granger point of view by Saumard [6]. The procedure was used in two application research articles; Almanjahie et al. [7] studied the relations between oil prices and the gross domestic product and Sancetta [8] with an application in financial econometrics. In this article, we provide a new testing procedure based on dynamic functional principal components.
Since the pioneering work of [5,9], an abundant literature has become available on causality of classical time series (for a broader review see [10,11]). In fact, there are various possible approaches for defining causality, notably causality in the frequency domain [12], a nonparametric approach [13], and causality on Bayesian networks [14]. Furthermore, the wide range of applications (causality in econometrics, neuroscience, social science, biomedical, signals) indicates the central role of causality in science.
In this article, we recall the notion of causality for functional stationary time series and propose tests of non-causality. There are nowadays different tools to analyze dependency on functional data, such as a mixing, linear process [3,15], where a definition of dependency on functional data has been proposed that generalizes the m-dependency, called L p m -approximable sequences. This notion is exploited to theoretically justify the “F-causality” test. “F-causality” stands for functional causality. This first test exploits the functional nature of the data and adapts a test of equality between operators for stationary functional time series (see [16]) to the context of causality. This test is explained in detail in [6]. The proposed test relies on functional dynamic principal components, which are able to capture the variability of functional time series better than functional principal components as demonstrated in [17]. Once we obtain the dynamic FPCA scores, we make the decision by using a multivariate Granger test on the scores. Aue et al. [18] use the same idea for predicting functional time series. Our dynamic-FPCA based procedure is publicly available at https://github.com/PyMattAI/DynamicFPCA_Causality.git (accessed on 7 June 2021) In order to compare, we studied another procedure that does not use the functional nature of the data, which is called the classical test. This procedure is based on differentiating the time series and using a multivariate Granger test.
A functional time series is a sequence of functional objects that are dependent. For example, in Figure 1, a classical time series of monthly sea surface temperatures (in °C) from January 1982 to December 2018 is plotted. These sea surface temperatures were measured by Moore buoys in the ‘Niño region’. The functional versions of the same data points are represented in Figure 2. One functional observation represents the sea surface temperature for one year. From the 12 × 37 data of the classical time series, we generate 37 observations of a functional time series that are observed each month. More generally, a functional time series X t ( u ) , where t = 1 , , N (N is the sample size of the functional time series) and u [ 0 , 1 ] (where there are m points by functional observations we observe at the points u i i = 1 , , m from [ 0 , 1 ] ) can be generated from a classical time series x t where t = 1 , , N * m , with m being the number of observations points. We have the relation X t ( u i ) = x ( t 1 ) × m + i .
The functional time series must be stationary in order for our test to perform well. It is worth mentioning that stationarity for functional time series and stationarity for classical time series are quite different. For example, we could have a stationary functional time series from a classical time series that is not stationary. Mainly, it is the case when the classical time series has a seasonality over a period T, and we cut this series at these intervals of time.The classical time series appears non-stationary, but if we consider the data as functional observations, it can be stationary. Hence, our test provides a natural framework to test causality for classical non-stationary time series. The application of a traditional test and our procedure to the real dataset highlight this fact.
In Section 2, the definition of causality for functional stationary time series and an example in the autoregressive functional processes are introduced. In Section 3, we recall how we can estimate the dynamic FPCA and propose three algorithms for testing the non-causality including the dynamic FPCA-based testing procedure. We conclude this article with Section 4 and Section 5, which are developed to empirically analyze the testing procedure, and an application of the procedure to explain the relation between electricity demand and temperature in Australia.

2. Linear Causality with Two Functional Time Series

2.1. Definition

Let H be a separable Hilbert space, with its inner product · , · and the norm associated h = h , h , h H . We take H = L 2 [ 0 , 1 ] for simplicity. Thereafter, for every functional time series { Z t } t Z valued in H , we make the assumptions that E Z t 2 < + and E [ Z t ] = 0 , t Z ; moreover, we assume that { Z t } t Z is strongly stationary. Let us recall the two definitions: strongly and weakly stationary. We say that series of random functions ( Z t ) are strongly stationary if for any h Z , k N and any sequence of indices t 1 , , t k , ( Z t 1 , , Z t k ) and ( Z h + t 1 , , Z h + t k ) are identically distributed. We say that { Z t } t Z is weakly stationary if for all t we have:
(i)
Z t verifies E Z t 2 < + ,
(ii)
E Z t = E Z 0 ,
(iii)
h Z , ( u , v ) 0 , 1 2 , we have cov ( Z t + h ( u ) , Z t ( v ) ) = cov ( Z h ( u ) , Z 0 ( v ) ) .
Let us introduce a key concept in functional data analysis about the second-order property of the process. To understand why this operator is a key concept, we recommend reading [19]. We define the operator of covariance Γ Z of the stationary functional time series Z t by:
Γ Z ( U ) = E Z , U Z , U H ,
where we omit the index t of time, due to stationarity. It is well known that this operator is a self-adjoint, positive, nuclear operator.
Let X t and Y t be two stationary functional time series valued in H . Let U t be the information accumulated since time t 1 , and U t X t denote all this information without the series X t . Define the predictive error series by
ε t ( Y | U ) = Y t Y ^ t ( U ) ,
where Y ^ t ( U ) is the best linear predictor of Y t using the information U t . Then, we have the following definition.
Definition 1
(Causality). We say that X is causing Y if Γ ε ( Y | U X ) Γ ε ( Y | U ) is a positive definite operator.
This definition is a natural extension of the idea of causality studied by Granger [5]. In fact, we replace the variance of the time series by the covariance operator of the functional time series. In addition, in order to compare covariance operator, we assume that a symmetric operator A is greater than a symmetric operator B if the difference A B is a positive definite operator. This is a theoretical definition because, in general, we do not have access to the information U t , so we must be careful for the conclusions in practice.

2.2. An Example

Let X t = ( Y t , X t ) be an autoregressive process valued at H : = L 2 [ 0 , 1 ] × L 2 [ 0 , 1 ] associated with ( ρ , ε ) , where ρ is a linear operator of H and ε is a H -strong white noise. For more information on the definition of autoregressive process valued in separable Hilbert space, see [3]. We have
X t = ρ ( X t 1 ) + ε t .
We can rewrite the model as
Y t = ρ 11 ( Y t 1 ) + ρ 12 ( X t 1 ) + ε 1 t , X t = ρ 21 ( Y t 1 ) + ρ 22 ( X t 1 ) + ε 2 t ,
with ρ 11 : = ρ L 2 [ 0 , 1 ] × 0 ( 1 ) , ρ 12 : = ρ 0 × L 2 [ 0 , 1 ] ( 1 ) and the same idea for ρ 21 and ρ 22 . The symbol f A stands for the restriction of the function f on the subset A of a definition set. The notation F ( 1 ) for an operator F, whose image is on a product space, means we take only the first component of the operator. According to the Definition 1, we say that ( X t ) does not linearly cause ( Y t ) if and only if ρ 12 = 0 . In fact, if ρ 12 = 0 , the two covariance operators of the definition are equals, and then the difference between the operators cannot be positively defined.

3. Testing Linear Causality

3.1. Dynamic FPCA

Hörmann et al. [17] have proposed a dynamic version of functional principal component analysis (FPCA) that is more efficient for functional time series than the traditional FPCA. As stated by [17] “classical static FPCs still can be consistently estimated, but, in contrast to the i.i.d. setup, they will not lead to an adequate dimension reduction technique”. In fact, the dynamic FPCs tend to recover the process better than the traditional FPCs. In this section, we recall briefly the practical aspects of this method. We consider a functional time series ( X t : t Z ) where X t takes values in L 2 [ 0 , 1 ] . We assume here that ( X t : t Z ) is weakly stationary. We define the autocovariance kernels c h by
c h ( u , v ) = cov ( X h ( u ) , X 0 ( v ) ) , u , v [ 0 , 1 ] .
We denote C h , h Z as the operator corresponding to the autocovariance kernels as c h and C ^ h as the empirical counterpart of C h at lag h. We define the estimated spectral density operator at frequency θ :
F ^ θ = | h | q 1 | h | q C ^ h e i h θ , 0 < q < n .
Then, we can estimate the m-th dynamic functional principal score by
Y ^ m t = l = L L X t l , ϕ ^ m l , m = 1 , , p and t = L + 1 , , n L ,
where L is some integer and ϕ ^ m l are the m-th estimated dynamic FPC filter coefficients coming from the fourier transform of the eigenfunction of F ^ θ .

3.2. 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 ) 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
H 0 : No causal relation , H 1 : causal relation ,
and in the case of FAR(1), this is equivalent to
H 0 : ρ 12 = 0 H 1 : ρ 12 0 .
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).
Algorithm 1 F-causality Test
(1)
(Data) We have ( X 1 , , X n ) and ( Y 1 , , Y n )
(2)
(Estimation of the parameters) We perform the estimation of ρ according to the previous section. We separate the two different models, one estimation of ρ without the Y i (nested model) and one that includes them (pooled model).
(3)
(Estimation of the errors) ε 1 is then estimated in the different models for t = 2 , , n , by
ε ^ t 1 = Y t ρ ^ 11 ( Y t 1 ) + ρ ^ 12 ( X t 1 ) , ( pooled model ) , ε ^ t 2 = Y t ρ ^ 11 ( Y t 1 ) , ( nested model ) .
(4)
(Test the equality of operators based on the errors) We perform the proposed test of Zhang and Shao [16] on the equality of the covariance operators of the estimated errors.
Algorithm 2 Dynamic-FPCA Test
(1)
(Data) We have ( X 1 , , X n ) and ( Y 1 , , Y n ) .
(2)
(Parameters) Choose L and q defined in Section 3.1.
(3)
(Dynamic FPCA) Compute the first d and d 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 3 Classical Test
(1)
(Data) We have ( X 1 , , X n ) and ( Y 1 , , Y n ) , and each curve has m points.
(2)
(time series) We obtain two “classical” time series ( x 1 , , x m * n ) and ( y 1 , , y m * 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

4.1. 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 ρ on a sinusoidal basis that approximates the Hilbert space H . In fact, we used the function “theoretical.coef” (package “far”) to obtain the parameters used internaly by the function “simul.farx” (package “far”) to make the simulation. Table 1 presents the different forms for ρ .
The first scenario “Null 1” is used in the last line (line 4) of Table 2 of the level. Here, we represent the space H by the space H m × H m . H m is the space of Y t and H m for X t . Then, it can have more than two lines to represent ρ , depending on the dimension of approximations of the two spaces H m and H m . For example, if we take dim ( H m ) = 3 and dim ( H m ) = 2 (as in the first scenario) with a basis with two components, then in the case of scenario 1, we have the following approximations:
ρ 11 = 0.45 0.00 0.00 0.00 0.3 0.00 0.00 0.00 0.34 , ρ 12 = 0.002 0.001 0.001 0.002 0.00 0.00 ,
ρ 21 = 0.00 0.00 0.00 0.00 0.00 0.00 , ρ 22 = 0.45 0.00 0.00 0.40 .
We use different values for n = 100 , 200 , with the parameter n c v = 20 , 40 and m = 50 . n is the sample size, n c v the number used for the cross validation in the model F A R ( 1 ) and m is the number of discretization points used for one observation of the functional time series. The level of significance that was studied was α = 0.05 . The two parameters L and q of the Dynamic-FPCA algorithm were chosen according to the freqdom.fda package initializations with q = 30 and L as the minimum between the maximum possibilities and 60 (to avoid high calcuation time). For the analysis of d and d , we chose to give the same value d = d for the sake of simplicity.
In order to have an idea of what we are manipulating, we made some plots of different time series; see Figure 3, Figure 4 and Figure 5. Figure 3 represents the whole trajectory of a functional time series simulated with sample size of 100. Figure 4 is the same as Figure 3 but we bring back the sequence series to the same time domain. Figure 5 plots the whole trajectory of two functional time series, which are in a causal relation.

4.2. Results

We present the type I error (power, respectively) in Table 2 (Table 3, respectively) for each different considered scenario. We make a replication of order 1000 for each scenario. Then, we count the number of rejections of the Null hypothesis, which in the case of a true Null hypothesis gives an approximation of the type I error and in the case of false Null hypothesis gives an approximation of the power of the test (which is 1 β where β is the type II error).
In Table 2, we see that the nominal level 0.05 is very well respected for the F-causality and Dynamic-FPCA tests and for different values of n. The parameter p of the classical test has to be well tuned, and there are many variations for this parameter. However, for p = 3 and only its value in the different simulation setup, the classical test reaches the nominal level correctly.
In Table 3, we perform the test for the different scenarios with parameters n = 100 or 200, m = 50 and K = 1 to 6. We observe, in general, that the power is sufficiently high for the five different models. The sample size plays a role in the power. Higher is the sample size, the better is the power of the test. With n = 200 , the power is sufficient. We can also see the influence of the parameter K. We also note that if K is badly selected, then there can be a lack of power, as we can see in model 3, for example.

4.3. Comparison of the Three Tests

Since the nominal level is well respected for the two first tests, it seems that the second test Dynamic-FPCA is more powerful than the two other tests in all the scenarios except for model 1. We can explain this by observing that the Dynamic-FPCA captures the properties of functional time series more, as shown in [17]. To understand the fact that model 1 is better for the F-causality test, we can say the departure from the null hypothesis is weak, as ρ 12 is nearly zero.
As the classical test does not reach the level of significance, and the Dynamic-FPCA seems more powerful than the F-causality test, we recommend that the Dynamic FPCA test is performed.

5. Real Data Illustration

The dataset we used is available in the R package “fds” [22] and is already studied in [23]. The article [23] deals with the electricity demands and the temperature in Adelaide. This dataset consists of half-hourly electricity demands in Adelaide and temperatures measured at the Adelaide airport from Sunday to Saturday between 6 July 1997 and 31 March 2007 (see Figure 6 for the electricity demand on Thursday and Figure 7 for the temperature on Thursday).
We wanted to test the causal relation between these two variables: the electricity demands and the temperatures. To do so, we used the three algorithms. As in article [23], we found a dependency between this two variables. Everyday, the temperatures in Adelaide impact the electricity demands in this city.

5.1. Results of F-Causality Algorithm

In order to test the causality between the electricity demands and the measured temperatures based on F-causality, some parameters need to be defined. Hence, the ncv was set to 100, and the number of replication (sample size) was set to 508. A generic test was performed between all days for the causality testing. For each test, a couple of results are calculated by finding the optimal K value, and results of the method are included in Table 4. The line represents the electricity demand each day, and the column represents the temperature measured in the airport. Table 4 reports the optimal K value and causality result (“True” or “False”) for each couple. From both tables, we can clearly observe that with the optimal parameter method, the temperature affects the daily electricity demand, except on Tuesday and Wednesday. Moreover, it is also observed that the temperature on a given day may cause the electricity demand another day, which is explained by a similarity of temperatures.

5.2. Results of the Dynamic FPCA Algorithm

To perform the dynamic FPCA causality test, the same parameters as in F-causality are set. Moreover, in each couple of tests, the causality is calculated with different values of d parameter 1, 2 and 3, and results are presented in Table 5.
Table 5 reports the causality result in terms of percentage for each couple. Firstly, the obtained results when d is set to 2 and 3 are not discriminative since they show high causality for all couples. Secondly, it can be noticed that the temperature causes the electricity demand each day. Furthermore, it is also observed that the temperature on a given day may cause the electricity demand another day.

5.3. Results of the Classical Algorithm

In order to compare, we also performed the classical test (Table 6) with the p-values. There is a major drawback to performing a classical test, namely non-stationarity. In fact, the functional analysis allows us to perform the test directly on the functional series, which can be directly seen as stationary functional series. In the classical setting, we must differentiate the fourteen series at lag 48 to remove the seasonal components. We chose to differentiate the series at lag 48 because of the recording of the series. In fact, the series is recorded every half hour in a day. Therefore, we chose to differentiate at lag 2 × 24 . Furthermore, we chose to fix p at 3, as it seems to perform at this value in the simulations. The same conclusion for each day holds for the classical test as the Dynamic-FPCA test.

6. Conclusions

Causality is a hard notion due to the lack of universal definition. One notion of linear causality for functional data was proposed and studied. We have proposed three statistical procedures to test this concept in a special case, i.e., the autoregressive model of order 1. A mathematical study of the behavior of the testing procedures would be an interesting future work. Extensions to more general models will be also considered in future work. The performance of the proposed testing procedures shows good behavior in simulations. The simulation study shows different behaviors between classical test, F-causality test and the Dynamic-FPCA test. An application to the electricity demands and the temperature is studied in detail. Finally, we can conclude that the dynamic FPCA algorithm is more suitable for the causality test due to its effectiveness to measure the causality with precision. Possible alternatives to the test of Zhang and Shao would be to perform a global F-test as in [24] or to test the effect of the variable X on errors as [25]. Another possible extension is to study the link between the shape through the phase and amplitude variation in functional data [2] and causality.

Author Contributions

Conceptualization, M.S. and B.H.; methodology, M.S.; software, M.S. and B.H.; writing—original draft preparation, M.S. and B.H.; supervision, M.S. Both authors have read and agreed to the published version of the manuscript.

Funding

The research of Bilal Hadjadji was funded by La Région Bretagne grant number 970.

Institutional Review Board Statement

Not applicable.

Informed Consent Statement

Not applicable.

Data Availability Statement

Publicly available datasets were analyzed in this study. This data can be found here: in the R package “fds” at https://CRAN.R-project.org/package=fds.

Conflicts of Interest

The authors declare no conflict of interest.

References

  1. Ramsay, J.O.; Silverman, B.W. Functional Data Analysis; Wiley Online Library: New York, NY, USA, 2006. [Google Scholar]
  2. Srivastava, A.; Klassen, E.P. Functional and Shape Data Analysis; Springer: New York, NY, USA, 2016. [Google Scholar] [CrossRef] [Green Version]
  3. Bosq, D. Linear Processes in Function Spaces:Theory and Applications; Lecture Notes in Statistics; Springer: New York, NY, USA, 2000; Volume 149, pp. xiv+283. [Google Scholar] [CrossRef]
  4. Horváth, L.; Kokoszka, P. Inference for Functional Data with Applications; Springer: New York, NY, USA, 2012; Volume 200. [Google Scholar]
  5. Granger, C.W.J. Investigating Causal Relations by Econometric Models and Cross-spectral Methods. Econometrica 1969, 37, 424–438. [Google Scholar] [CrossRef]
  6. Saumard, M. Linear causality in the sense of Granger with stationary functional time series. In Functional Statistics and Related Fields; Aneiros, G., Bongiorno, E.G., Cao, R., Vieu, P., Eds.; Springer International Publishing: Cham, Switzerland, 2017; pp. 225–231. [Google Scholar]
  7. Elmezouar, Z.C. Functional Causality between Oil Prices and GDP Based on Big Data. Comput. Mater. Contin. 2020, 63, 593–604. [Google Scholar] [CrossRef]
  8. Sancetta, A. Intraday End-of-Day Volume Prediction. J. Financ. Econom. 2019, nbz019. [Google Scholar] [CrossRef]
  9. Wiener, N. The theory of prediction. Mod. Math. Eng. 1956, 1, 125–139. [Google Scholar]
  10. Gourieroux, C.; Monfort, A. Time Series and Dynamic Models; Cambridge University Press: Cambridge, MA, USA, 1997; Volume 3. [Google Scholar]
  11. Dufour, J.M.; Taamouti, A. Short and long run causality measures: Theory and inference. J. Econom. 2010, 154, 42–58. [Google Scholar] [CrossRef] [Green Version]
  12. Geweke, J. Measurement of linear dependence and feedback between multiple time series. J. Am. Stat. Assoc. 1982, 77, 304–313. [Google Scholar] [CrossRef]
  13. Taamouti, A.; Bouezmarni, T.; El Ghouch, A. Nonparametric estimation and inference for conditional density based Granger causality measures. J. Econom. 2014, 180, 251–264. [Google Scholar] [CrossRef] [Green Version]
  14. Pearl, J.; Verma, T.S. A theory of inferred causation. Stud. Log. Found. Math. 1995, 134, 789–811. [Google Scholar]
  15. Hörmann, S.; Kokoszka, P. Weakly dependent functional data. Ann. Stat. 2010, 38, 1845–1884. [Google Scholar] [CrossRef] [Green Version]
  16. Zhang, X.; Shao, X. Two sample inference for the second-order property of temporally dependent functional data. Bernoulli 2015, 21, 909–929. [Google Scholar] [CrossRef]
  17. Hörmann, S.; Kidziński, Ł.; Hallin, M. Dynamic functional principal components. J. R. Stat. Soc. Ser. B Stat. Methodol. 2015, 77, 319–348. [Google Scholar] [CrossRef]
  18. Aue, A.; Norinho, D.D.; Hörmann, S. On the prediction of stationary functional time series. J. Am. Stat. Assoc. 2015, 110, 378–392. [Google Scholar] [CrossRef] [Green Version]
  19. Hsing, T.; Eubank, R. Theoretical Foundations of Functional Data Analysis, with an Introduction to Linear Operators; John Wiley & Sons: West Sussex, UK, 2015. [Google Scholar]
  20. Ramsay, J.O.; Wickham, H.; Graves, S.; Hooker, G. fda: Functional Data Analysis. R Package Version 2.4.7. 2017. Available online: http://CRAN.R-project.org/package=fda (accessed on 7 June 2021).
  21. Damon, J.; Guillas, S. far: Modelization for Functional AutoRegressive Processes. R Package Version 0.6-5. 2015. Available online: https://mran.microsoft.com/snapshot/2015-11-17/web/packages/far/index.html (accessed on 7 June 2021).
  22. Shang, H.L.; Hyndman, R.J. fds: Functional Data Sets. R Package Version 1.7. 2013. Available online: https://cran.r-project.org/package=fds (accessed on 7 June 2021).
  23. Magnano, L.; Boland, J.; Hyndman, R. Generation of symthetic sequences of halfhourly temperature. Environmetrics 2008, 19, 818–835. [Google Scholar] [CrossRef]
  24. Shen, Q.; Faraway, J. An F test for linear models with functional responses. Stat. Sin. 2004, 14, 1239–1257. [Google Scholar]
  25. Patilea, V.; Sánchez-Sellero, C.; Saumard, M. Testing the predictor effect on a functional response. J. Am. Stat. Assoc. 2016, 111, 1684–1695. [Google Scholar] [CrossRef]
Figure 1. Monthly sea surface temperatures.
Figure 1. Monthly sea surface temperatures.
Signals 02 00022 g001
Figure 2. Monthly sea surface temperatures as functional observations by year.
Figure 2. Monthly sea surface temperatures as functional observations by year.
Signals 02 00022 g002
Figure 3. One trajectory.
Figure 3. One trajectory.
Signals 02 00022 g003
Figure 4. One trajectory on the same time domain.
Figure 4. One trajectory on the same time domain.
Signals 02 00022 g004
Figure 5. The trajectory of two functional time series with a causal relation.
Figure 5. The trajectory of two functional time series with a causal relation.
Signals 02 00022 g005
Figure 6. Electricity demand in Adelaide for Thursday.
Figure 6. Electricity demand in Adelaide for Thursday.
Signals 02 00022 g006
Figure 7. Temperature in Adelaide for Thursday.
Figure 7. Temperature in Adelaide for Thursday.
Signals 02 00022 g007
Table 1. Six scenario for the simulations of ρ .
Table 1. Six scenario for the simulations of ρ .
Scenario ρ Dim X and Y
Null 1 0.45 0.00 0.00 0.00 0.00 0.00 0.3 0.00 0.00 0.00 0.00 0.0 0.34 0.00 0.00 0.00 0.0 0.00 0.45 0.00 0.00 0.00 0.00 0.00 0.40 3, 2
1 0.45 0.00 0.00 0.002 0.001 0.00 0.3 0.00 0.001 0.002 0.00 0.0 0.34 0.00 0.00 0.00 0.0 0.00 0.45 0.00 0.00 0.00 0.00 0.00 0.40 3, 2
2 0.45 0.00 0.00 0.02 0.01 0.00 0.3 0.00 0.01 0.02 0.00 0.0 0.34 0.00 0.00 0.00 0.0 0.00 0.45 0.00 0.00 0.00 0.00 0.00 0.40 3, 2
3 0.45 0.00 0.00 0.50 0.00 0.3 0.00 0.00 0.00 0.0 0.34 0.00 0.00 0.0 0.00 0.45 3, 1
4 0.15 0.00 0.00 0.40 0.00 0.10 0.00 0.20 0.00 0.00 0.10 0.20 0.00 0.00 0.00 0.45 3, 1
5 0.25 0.00 0.00 0.40 0.00 0.10 0.00 0.00 0.00 0.0 0.10 0.00 0.00 0.00 0.00 0.45 3, 1
Table 2. Nominal Level 0.05.
Table 2. Nominal Level 0.05.
Fcausality TestDynamicFPCA TestClassical Test
ModelNK Optimalnd p
123123456
11000.0470.0570.060.0740.5370.2370.0430.0380.0140.009
2000.0760.0620.0590.0680.5230.2290.050.0340.0110.008
21000.0540.0540.060.0680.5370.2430.0580.0380.0160.011
2000.0780.0640.0570.0610.5140.2160.0570.0360.020.012
31000.0520.0590.0540.0630.540.2570.0520.0390.0220.012
2000.0990.0610.060.0630.5320.2440.0610.040.0190.011
41000.0410.0480.0720.0020.5380.2170.0620.1020.090.086
2000.0550.0550.0710.0010.5390.2360.070.1010.0880.083
Table 3. Power on five different models.
Table 3. Power on five different models.
Fcausality TestDynamicFPCA TestClassical Test
ModelNK nd p
123456123123456
11000.7610.9180.8650.7350.4890.2140.0690.1530.0040.5520.2310.0730.10.090.086
2000.8910.9980.9890.9730.9140.820.0960.2710.0030.5580.2660.0810.1070.0830.091
21000.7790.9240.8880.7560.5090.2420.180.9250.7410.5410.260.0740.1090.0910.093
2000.8950.9960.9920.9720.9150.8260.2870.9990.990.5640.3140.0820.1260.0930.09
31000.7330.9070.8570.750.4870.2410.9880.9870.980.6650.2230.3710.4340.4720.487
2000.8580.990.9890.9570.90.7880.9970.9990.9990.6680.3830.4190.4530.4950.495
41000.6960.6470.5180.3440.1330.06210.99910.950.8120.6290.7920.7930.779
2000.9490.9390.9170.7790.5070.3031110.9930.9890.9630.9820.9750.967
51000.6620.7270.5660.3680.150.0710.9710.960.930.6770.1240.2930.3850.4240.458
2000.8860.9540.9160.7930.5390.3210.9960.9970.9940.6530.2320.330.4220.4550.478
Table 4. F-causality tests between temperature and electricity demand with an optimal parameter.
Table 4. F-causality tests between temperature and electricity demand with an optimal parameter.
K OptimalMondayTuesdayWednesdayThursdayFridaySaturdaySunday
Monday1111111
TrueFalseFalseFalseFalseFalseTrue
Tuesday1111111
FalseFalseFalseFalseFalseFalseFalse
Wednesday1111111
FalseFalseFalseFalseFalseFalseFalse
Thursday1111111
FalseFalseFalseTrueTrueTrueFalse
Friday1111111
FalseFalseFalseFalseTrueTrueFalse
Saturday1111111
FalseFalseFalseFalseFalseTrueFalse
Sunday1111111
TrueFalseFalseFalseFalseFalseTrue
Table 5. Dynamic FPCA test between temperature and electricity demand.We highligth the diagonal in red.
Table 5. Dynamic FPCA test between temperature and electricity demand.We highligth the diagonal in red.
MondayTuesdayWednesdayThursdayFridaySaturdaySunday
Monday95%61%13%30%65%96%44%
99%99%99%99%99%99%99%
99%99%99%99%99%99%99%
Tuesday96%95%84%33%66%88%18%
99%99%99%99%99%99%99%
99%99%99%99%99%99%99%
Wednesday58%54%98%82%39%92%51%
99%99%99%99%99%99%99%
99%99%99%99%99%99%99%
Thursday39%20%77%99%58%88%82%
99%99%99%99%99%99%99%
99%99%99%99%99%99%99%
Friday54%73%94%6%98%63%99%
99%99%99%99%99%99%99%
99%99%99%99%99%99%99%
Saturday54%85%96%73%88%97%99%
99%99%99%99%99%99%99%
99%99%99%99%99%99%99%
Sunday54%65%61%86%63%94%89%
99%99%99%99%99%99%99%
99%99%99%99%99%99%99%
Table 6. Classical tests between temperature and electricity demands. We highligth the diagonal in red.
Table 6. Classical tests between temperature and electricity demands. We highligth the diagonal in red.
p = 3 MondayTuesdayWednesdayThursdayFridaySaturdaySunday
Monday 3.88 × 10 15 < 2.2 × 10 16 7.757 × 10 10 1.964 × 10 7 0.035750.58180.516
Tuesday0.0028< 2.2 × 10 16 < 2.2 × 10 16 1.1527 × 10 12 0.0030140.34270.188
Wednesday0.03830.001607< 2.2 × 10 16 < 2.2 × 10 16 0.00029520.97290.691
Thursday0.620.78310.5706< 2.2 × 10 16 < 2.2 × 10 16 4.6 × 10 12 0.172
Friday0.1070.31030.40360.03976< 2.2 × 10 16 < 2.2 × 10 16 0.0221
Saturday0.0320.29310.11280.02072 3.066 × 10 12 < 2.2 × 10 16 5.83 × 10 6
Sunday 1.5 × 10 10 6.873 × 10 5 0.27070.19510.01001 1.027 × 10 5 7.88 × 10 07
Publisher’s Note: MDPI stays neutral with regard to jurisdictional claims in published maps and institutional affiliations.

Share and Cite

MDPI and ACS Style

Saumard, M.; Hadjadji, B. Dynamic Functional Principal Components for Testing Causality. Signals 2021, 2, 353-365. https://0-doi-org.brum.beds.ac.uk/10.3390/signals2020022

AMA Style

Saumard M, Hadjadji B. Dynamic Functional Principal Components for Testing Causality. Signals. 2021; 2(2):353-365. https://0-doi-org.brum.beds.ac.uk/10.3390/signals2020022

Chicago/Turabian Style

Saumard, Matthieu, and Bilal Hadjadji. 2021. "Dynamic Functional Principal Components for Testing Causality" Signals 2, no. 2: 353-365. https://0-doi-org.brum.beds.ac.uk/10.3390/signals2020022

Article Metrics

Back to TopTop