Title: | Distance Covariance and Correlation for Time Series Analysis |
---|---|
Description: | Computing and plotting the distance covariance and correlation function of a univariate or a multivariate time series. Both versions of biased and unbiased estimators of distance covariance and correlation are provided. Test statistics for testing pairwise independence are also implemented. Some data sets are also included. References include: a) Edelmann Dominic, Fokianos Konstantinos and Pitsillou Maria (2019). 'An Updated Literature Review of Distance Correlation and Its Applications to Time Series'. International Statistical Review, 87(2): 237--262. <doi:10.1111/insr.12294>. b) Fokianos Konstantinos and Pitsillou Maria (2018). 'Testing independence for multivariate time series via the auto-distance correlation matrix'. Biometrika, 105(2): 337--352. <doi:10.1093/biomet/asx082>. c) Fokianos Konstantinos and Pitsillou Maria (2017). 'Consistent testing for pairwise dependence in time series'. Technometrics, 59(2): 262--270. <doi:10.1080/00401706.2016.1156024>. d) Pitsillou Maria and Fokianos Konstantinos (2016). 'dCovTS: Distance Covariance/Correlation for Time Series'. R Journal, 8(2):324-340. <doi:10.32614/RJ-2016-049>. |
Authors: | Michail Tsagris [aut, cre], Maria Pitsillou [aut, cph], Konstantinos Fokianos [aut] |
Maintainer: | Michail Tsagris <[email protected]> |
License: | GPL (>= 2) |
Version: | 1.4 |
Built: | 2024-12-21 06:27:55 UTC |
Source: | CRAN |
Computing and plotting the distance covariance and correlation function of a univariate or a multivariate time series. Both versions of biased and unbiased estimators of distance covariance and correlation are provided. Test statistics for testing pairwise independence are also implemented. Some data sets are also included.
Package: | dCovTS |
Type: | Package |
Version: | 1.4 |
Date: | 2023-09-28 |
License: | GPL(>=2) |
Disclaimer: Dr Maria Pitsillou is the actual creator of this package. Dr Tsagris is the current maintainer.
Improvements: We have modified the codes to run faster, we included the packages Rfast and Rfast2 for fast computations and the "dcov" package that allows for extremely fast computations of the distance correlation/covariance with univariate data.
Michail Tsagris, Maria Pitsillou and Konstantinos Fokianos.
Edelmann, D, K. Fokianos. and M. Pitsillou. (2019). An Updated Literature Review of Distance Correlation and Its Applications to Time Series. International Statistical Review, 87, 237-262.
Fokianos, K. and M. Pitsillou. (2018). Testing independence for multivariate time series via the auto-distance correlation matrix. Biometrika, 105, 337-352.
Fokianos, K. and M. Pitsillou. (2017). Consistent testing for pairwise dependence in time series. Technometrics, 159, 262-3270.
Dehling, H. and T. Mikosch. (1994). Random quadratic forms and the bootstrap for U-statistics. Journal of Multivariate Analysis 51, 392-413.
Hong, Y. (1999). Hypothesis testing in time series via the empirical characteristic function: A generalized spectral density approach. Journal of the American Statistical Association, 94, 1201-1220.
Hong, Y. (1996). Consistent testing for serial correlation of unknown form. Econometrica, 64, 837-864.
Huo, X. and G. J. Szekely. (2016). Fast Computing for Distance Covariance. Technometrics, 58, 435-447.
Leucht, A. and M. H. Neumann (2013). Dependent wild bootstrap for degenerate U- and V- statistics. Journal of Multivariate Analysis, 117, 257-280.
Pitsillou, M. and K. Fokianos. (2016). dCovTS: Distance Covariance/Correlation for Time Series. R Journal, 8, 324-340.
Politis, N. P., J. P. Romano and M. Wolf (1999). Subsampling. New York: Springer.
Shao, X. (2010). The dependent wild bootstrap. Journal of the American Statistical Association, 105, 218-235.
Shumway, R. H. and D. S. Stoffer (2011). Time Series Analysis and Its Applications With R Examples. New York: Springer. Third Edition.
Szekely, G. J. and M. L. Rizzo (2014). Partial distance correlation with methods for dissimilarities. The Annals of Statistics, 42, 2382-2412.
Szekely, G. J., M. L. Rizzo and N. K. Bakirov (2007). Measuring and testing dependence by correlation of distances. The Annals of Statistics, 35, 2769-2794, .
Tsay, R. S. (2014). Multivariate Time Series Analysis with R and Financial Applications. Hoboken, NJ: Wiley.
Tsay, R. S. (2010). Analysis of Financial Time Series. Hoboken, NJ: Wiley. Third edition.
Zhou, Z. (2012). Measuring nonlinear dependence in time series, a distance correlation approach. Journal of Time Series Analysis, 33, 438-457.
Computes the auto-distance correlation function of a univariate time series. It also computes the bias-corrected estimator of (squared) auto-distance correlation.
ADCF(x, MaxLag = 15, unbiased = FALSE)
ADCF(x, MaxLag = 15, unbiased = FALSE)
x |
A numeric vector or univariate time series. |
MaxLag |
Maximum lag order at which to calculate the |
unbiased |
Logical value. If unbiased = TRUE, the bias-corrected estimator of squared auto-distance correlation is returned. Default value is FALSE. |
Distance covariance and correlation firstly introduced by Szekely et al. (2007) are new measures of dependence between two random vectors. Zhou (2012) extended this measure to univariate time series framework.
For a univariate time series, ADCF
computes the auto-distance correlation function, ,
between
and
, whereas
ADCV
computes the auto-distance covariance function
between them, denoted by . Formal definition of
and
can be found in Zhou (2012)
and Fokianos and Pitsillou (2017). The empirical auto-distance correlation function,
, is computed as the
positive square root of
for and zero otherwise, where
is a function of the double
centered Euclidean distance matrices of the sample
and its lagged sample
(see
ADCV
for more details). Theoretical properties of this measure can be found in Fokianos and Pitsillou (2017).
If unbiased = TRUE, ADCF
computes the bias-corrected estimator of the squared auto-distance correlation,
, based on the unbiased estimator of auto-distance covariance function,
.
The definition of
relies on the U-centered matrices proposed by Szekely and Rizzo (2014)
(see
ADCV
for a brief description).
mADCF
computes the auto-distance correlation function of a multivariate time series.
Returns a vector, whose length is determined by MaxLag
, and contains the biased estimator of ADCF
or the bias-corrected estimator of squared ADCF
.
Based on the definition of ADCF
, one can observe that
,
and so results based on negative lags are omitted.
Maria Pitsillou, Michail Tsagris and Konstantinos Fokianos.
Edelmann, D, K. Fokianos. and M. Pitsillou. (2019). An Updated Literature Review of Distance Correlation and Its Applications to Time Series. International Statistical Review, 87, 237-262.
Fokianos K. and M. Pitsillou (2017). Consistent testing for pairwise dependence in time series. Technometrics, 159(2), 262-3270.
Huo, X. and G. J. Szekely. (2016). Fast Computing for Distance Covariance. Technometrics, 58, 435-447.
Pitsillou M. and Fokianos K. (2016). dCovTS: Distance Covariance/Correlation for Time Series. R Journal, 8, 324-340.
Szekely, G. J. and M. L. Rizzo (2014). Partial distance correlation with methods for dissimilarities. The Annals of Statistics, 42, 2382-2412.
Szekely, G. J. and M. L. Rizzo and N. K. Bakirov (2007). Measuring and testing dependence by correlation of distances. The Annals of Statistics, 35, 2769-2794.
Zhou, Z. (2012). Measuring nonlinear dependence in time series, a distance correlation approach. Journal of Time Series Analysis 33, 438-457.
x <- rnorm(100) ADCF(x) ADCF(ldeaths, 18) ADCF(mdeaths, unbiased = TRUE)
x <- rnorm(100) ADCF(x) ADCF(ldeaths, 18) ADCF(mdeaths, unbiased = TRUE)
The function plots the estimated auto-distance correlation function obtained by ADCF
and provides confindence intervals by employing three bootstrap based methods.
ADCFplot(x, MaxLag = 15, alpha = 0.05, b = 499, bootMethod = c("Wild Bootstrap", "Subsampling", "Independent Bootstrap"), ylim = NULL, main = NULL)
ADCFplot(x, MaxLag = 15, alpha = 0.05, b = 499, bootMethod = c("Wild Bootstrap", "Subsampling", "Independent Bootstrap"), ylim = NULL, main = NULL)
x |
A numeric vector or univariate time series. |
MaxLag |
The maximum lag order at which to plot |
alpha |
The significance level used to construct the |
b |
The number of bootstrap replications for constructing the |
bootMethod |
A character string indicating the method to use for obtaining the |
ylim |
A numeric vector of length 2 indicating the |
main |
The title of the plot. |
Fokianos and Pitsillou (2018) showed that the sample auto-distance covariance function ADCV
(and thus ADCF
) can be expressed as a V-statistic of order two, which under the null hypothesis
of independence is degenerate. Thus, constructing a plot analogous to the traditional autocorrelation plot where
the confidence intervals are obtained simultaneously, turns to be a complicated task. To overcome this issue, the
% confidence intervals shown in the plot (dotted blue horizontal line) are computed simultaneously
via Monte Carlo simulation, and in particular via the independent wild bootstrap approach
(Dehling and Mikosch, 1994; Shao, 2010; Leucht and Neumann, 2013). The reader is referred to Fokianos and
Pitsillou (2018) for the steps followed.
mADCFplot
returns an analogous plot of the estimated
auto-distance correlation function for a multivariate time series.
One can also compute the pairwise % critical values via the subsampling approach suggested by
Zhou (2012, Section 5.1).That is, the critical values are obtained at each lag separately. The block size of the
procedure is based on the minimum volatility method proposed by Politis et al. (1999, Section 9.4.2). In addition,
the function provides the ordinary independent bootstrap methodology to derive simultaneous
% critical values.
A plot of the estimated ADCF
values. It also returns a list including:
ADCF |
The sample auto-distance correlation function for all lags specified by |
bootMethod |
The method followed for computing the |
critical.value |
The critical value shown in the plot. |
When the critical values are obtained via the Subsampling methodology, the function returns a plot that starts from lag 1.
The function plots only the biased estimator of ADCF.
Maria Pitsillou, Michail Tsagris and Konstantinos Fokianos.
Dehling, H. and T. Mikosch (1994). Random quadratic forms and the bootstrap for U-statistics. Journal of Multivariate Analysis, 51, 392-413.
Dominic, E, K. Fokianos and M. Pitsillou Maria (2019). An Updated Literature Review of Distance Correlation and Its Applications to Time Series. International Statistical Review, 87, 237-262.
Fokianos K. and Pitsillou M. (2018). Testing independence for multivariate time series via the auto-distance correlation matrix. Biometrika, 105, 337-352.
Leucht, A. and M. H. Neumann (2013). Dependent wild bootstrap for degenerate U- and V- statistics. Journal of Multivariate Analysis, 117, 257-280.
Pitsillou M. and Fokianos K. (2016). dCovTS: Distance Covariance/Correlation for Time Series. R Journal, 8, 324-340.
Politis, N. P., J. P. Romano and M. Wolf (1999). Subsampling. New York: Springer.
Shao, X. (2010). The dependent wild bootstrap. Journal of the American Statistical Association, 105, 218-235.
Zhou, Z. (2012). Measuring nonlinear dependence in time series, a distance correlation approach. Journal of Time Series Analysis, 33, 438-457.
### x <- rnorm(200) ### ADCFplot(x, bootMethod = "Subs")
### x <- rnorm(200) ### ADCFplot(x, bootMethod = "Subs")
Computes the auto-distance covariance function of a univariate time series. It also computes the unbiased estimator of squared auto-distance covariance.
ADCV(x, MaxLag = 15, unbiased = FALSE)
ADCV(x, MaxLag = 15, unbiased = FALSE)
x |
A numeric vector or univariate time series. |
MaxLag |
The maximum lag order at which to calculate the |
unbiased |
A logical value. If unbiased = TRUE, the unbiased estimator of squared auto-distance covariance is returned. Default value is FALSE. |
Szekely et al. (2007) proposed distance covariance function between two random vectors. Zhou (2012) extended this measure of dependence to a time series framework by calling it auto-distance covariance function.
ADCV
computes the sample auto-distance covariance function,
, between
and
. Formal
definition of
can be found in Zhou (2012) and Fokianos and
Pitsillou (2017).
The empirical auto-distance covariance function, ,
is the non-negative square root defined by
and , for
,
where
and
are Euclidean distances with elements
given by
with ,
,
,
.
is given analogously based on
, where
.
and
are independent if and only if
.
See Fokianos and Pitsillou (2017) for more information on theoretical
properties of
including consistency.
If unbiased = TRUE, ADCV
returns the unbiased estimator of
squared auto-distance covariance function,
, proposed by Szekely and Rizzo (2014).
In the context of time series data, this is given by
for , where
is the
element of the so-called U-centered matrix
, defined by
with zero diagonal.
mADCV
gives the auto-distance covariance function of a
multivariate time series.
A vector whose length is determined by MaxLag
and contains the biased
estimator of ADCV
or the unbiased estimator of squared ADCV
.
Based on the definition of , we observe that
, and thus results based on negative
lags are omitted.
Maria Pitsillou, Michail Tsagris and Konstantinos Fokianos.
Dominic, E, K. Fokianos and M. Pitsillou Maria (2019). An Updated Literature Review of Distance Correlation and Its Applications to Time Series. International Statistical Review, 87, 237-262. .
Fokianos K. and M. Pitsillou (2017). Consistent testing for pairwise dependence in time series. Technometrics, 159(2), 262-3270.
Huo, X. and G. J. Szekely. (2016). Fast Computing for Distance Covariance. Technometrics, 58, 435-447.
Pitsillou M. and Fokianos K. (2016). dCovTS: Distance Covariance/Correlation for Time Series. R Journal, 8, 324-340.
Szekely, G. J. and M. L. Rizzo (2014). Partial distance correlation with methods for dissimilarities. The Annals of Statistics 42, 2382-2412.
Szekely, G. J., M. L. Rizzo and N. K. Bakirov (2007). Measuring and testing dependence by correlation of distances. The Annals of Statistics 35, 2769-2794.
Zhou, Z. (2012). Measuring nonlinear dependence in time series, a distance correlation approach. Journal of Time Series Analysis 33, 438-457.
x <- rnorm(500) ADCV(x, 18) ADCV(BJsales, 25)
x <- rnorm(500) ADCV(x, 18) ADCV(BJsales, 25)
The monthly returns of the stocks of International Business Machines (IBM) and the S&P 500 composite index from January 1926 to December 2011.
ibmSp500
ibmSp500
A data frame with 1,032 observations on the following 3 variables.
date
a numeric vector
ibm
a numeric vector
sp
a numeric vector
The data is a combination of two datasets:
The first 612 observations are in Tsay (2010).
The rest 420 observations are in Tsay (2014).
Tsay, R. S. (2010). Analysis of Financial Time Series. Hoboken, NJ: Wiley. Third edition.
Tsay, R. S. (2014). Multivariate Time Series Analysis with R and Financial Applications. Hoboken, NJ: Wiley.
### attach(ibmSp500) ### series <- tail(ibmSp500[, 2:3], 400) ### lseries <- log(series + 1) ### mADCFplot(lseries, MaxLag = 12) ### mADCFplot(lseries^2, MaxLag = 12)
### attach(ibmSp500) ### series <- tail(ibmSp500[, 2:3], 400) ### lseries <- log(series + 1) ### mADCFplot(lseries, MaxLag = 12) ### mADCFplot(lseries^2, MaxLag = 12)
Computes several kernel functions(truncated, Bartlett, Daniell, QS, Parzen). These kernels are for constructing test statistics for testing pairwise independence.
kernelFun(type, z)
kernelFun(type, z)
type |
A character string which indicates the name of the smoothing kernel.
|
z |
A real number. |
kernelFun
computes several kernel functions including truncated,
Bartlett, Daniell, QS and Parzen.
The exact definition of each of the above functions are given below:
Truncated
Bartlett
Daniell
QS
Parzen
All these kernel functions are mainly used to smooth the generalized spectral density function, firstly introduced by Hong (1999). Assumptions and theoretical properties of these functions can be found in Hong (1996;1999) and Fokianos and Pitsillou (2017).
A value that lies in the interval .
Maria Pitsillou and Konstantinos Fokianos.
Edelmann, D, K. Fokianos. and M. Pitsillou. (2019). An Updated Literature Review of Distance Correlation and Its Applications to Time Series. International Statistical Review, 87, 237-262.
Fokianos K. and M. Pitsillou (2017). Consistent testing for pairwise dependence in time series. Technometrics, 159, 262-3270.
Pitsillou M. and Fokianos K. (2016). dCovTS: Distance Covariance/Correlation for Time Series. R Journal, 8, 324-340.
Hong, Y. (1996). Consistent testing for serial correlation of unknown form. Econometrica, 64, 837-864.
Hong, Y. (1999). Hypothesis testing in time series via the empirical characteristic function: A generalized spectral density approach. Journal of the American Statistical Association, 94, 1201-1220.
k1 <- kernelFun( "bartlett", z = 1/3 ) k2 <- kernelFun( "bar", z = 1/5 ) k3 <- kernelFun( "dan", z = 0.5 )
k1 <- kernelFun( "bartlett", z = 1/3 ) k2 <- kernelFun( "bar", z = 1/5 ) k3 <- kernelFun( "dan", z = 0.5 )
Computes the auto-distance correlation matrix of a multivariate time series.
mADCF(x, lags, unbiased = FALSE, output = TRUE)
mADCF(x, lags, unbiased = FALSE, output = TRUE)
x |
Multivariate time series. |
lags |
The lag order at which to calculate the |
unbiased |
A logical value. If unbiased = TRUE, the individual elements of auto-distance correlation matrix correspond to the bias-corrected estimators of squared auto-distance correlation functions. Default value is FALSE. |
output |
A logical value. If output=FALSE, no output is given. Default value is TRUE. |
If is a multivariate time series
of dimension
, then
mADCF
computes the sample auto-distance
correlation matrix, , of
. It is defined by
where is the biased estimator of the so-called pairwise
auto-distance correlation function between
and
given by the positive square root of
for and zero otherwise.
is the
element of the corresponding
mADCV
matrix at lag .
Formal definition and more details can be found in Fokianos and Pitsillou (2017).
If unbiased = TRUE, mADCF
returns a matrix that contains the
bias-corrected estimators of squared pairwise
auto-distance correlation functions.
If lags
is a single number then the function will return a matrix.
If lags
is a vector of many values the function will return an array.
For either case, the matrix (matrices) will contain either the biased
estimators of the pairwise auto-distance correlation functions or the
bias-corrected estimators of squared pairwise auto-distance correlation
functions at lag, , determined by the argument
lags
.
Maria Pitsillou, Michail Tsagris and Konstantinos Fokianos.
Edelmann, D, K. Fokianos. and M. Pitsillou. (2019). An Updated Literature Review of Distance Correlation and Its Applications to Time Series. International Statistical Review, 87, 237-262.
Fokianos K. and Pitsillou M. (2018). Testing independence for multivariate time series via the auto-distance correlation matrix. Biometrika, 105, 337-352.
Huo, X. and G. J. Szekely. (2016). Fast Computing for Distance Covariance. Technometrics, 58, 435-447.
Pitsillou M. and Fokianos K. (2016). dCovTS: Distance Covariance/Correlation for Time Series. R Journal, 8, 324-340.
x <- matrix( rnorm(200), ncol = 2 ) mADCF(x, 2) mADCF(x, -2) mADCF(x, lags = 4, unbiased = TRUE)
x <- matrix( rnorm(200), ncol = 2 ) mADCF(x, 2) mADCF(x, -2) mADCF(x, lags = 4, unbiased = TRUE)
The function computes and plots the estimator of the auto-distance correlation
matrix mADCF
.
mADCFplot(x, MaxLag = 15, alpha = 0.05, b = 499, bootMethod = c("Wild Bootstrap", "Independent Bootstrap"), ylim = NULL)
mADCFplot(x, MaxLag = 15, alpha = 0.05, b = 499, bootMethod = c("Wild Bootstrap", "Independent Bootstrap"), ylim = NULL)
x |
A multivariate time series. |
MaxLag |
The maximum lag order at which to plot |
alpha |
The significance level used to construct the |
b |
The number of bootstrap replications for constructing the |
bootMethod |
A character string indicating the method to use for obtaining the
|
ylim |
A numeric vector of length 2 indicating the |
The % confidence intervals shown in the plot
(dotted blue horizontal line) are computed simultaneously based
on the independent wild bootstrap approach (Dehling and Mikosch,
1994; Shao, 2010; Leucht and Neumann, 2013), since the
elements of
mADCV
(and thus mADCF
) can be
expressed as degenerate V-statistics of order 2.
More details can be found in Fokianos and Pitsillou (2017).
In addition, mADCFplot
provides the option of independent
bootstrap to compute the simultaneous
% critical values.
A plot of the estimated mADCF
matrices. The function also
returns a list including
matrices |
Sample distance correlation matrices starting from lag 0. |
bootMethod |
The method followed for computing the |
critical.value |
The critical value shown in the plot. |
The function plots only the biased estimator of ADCF matrix.
Maria Pitsillou and Konstantinos Fokianos.
Edelmann, D, K. Fokianos. and M. Pitsillou. (2019). An Updated Literature Review of Distance Correlation and Its Applications to Time Series. International Statistical Review, 87, 237-262.
Dehling, H. and T. Mikosch (1994). Random quadratic forms and the bootstrap for U-statistics. Journal of Multivariate Analysis, 51, 392-413.
Fokianos K. and Pitsillou M. (2018). Testing independence for multivariate time series via the auto-distance correlation matrix. Biometrika, 105, 337-352.
Fokianos K. and M. Pitsillou (2017). Consistent testing for pairwise dependence in time series. Technometrics, 159, 262-3270.
Huo, X. and G. J. Szekely. (2016). Fast Computing for Distance Covariance. Technometrics, 58, 435-447.
Leucht, A. and M. H. Neumann (2013). Dependent wild bootstrap for degenerate U- and V- statistics. Journal of Multivariate Analysis, 117, 257-280.
Pitsillou M. and Fokianos K. (2016). dCovTS: Distance Covariance/Correlation for Time Series. R Journal, 8, 324-340.
Shao, X. (2010). The dependent wild bootstrap. Journal of the American Statistical Association, 105, 218-235.
### x <- matrix( rnorm(200), ncol = 2 ) ### mADCFplot(x, 12, ylim = c(0, 0.5) ) ### mADCFplot(x, 12, b = 100)
### x <- matrix( rnorm(200), ncol = 2 ) ### mADCFplot(x, 12, ylim = c(0, 0.5) ) ### mADCFplot(x, 12, b = 100)
A multivariate test of independence based on auto-distance correlation matrix proposed by Fokianos and Pitsillou (2017).
mADCFtest(x, type = c("truncated", "bartlett", "daniell", "QS", "parzen"), p, b = 0, parallel = FALSE, bootMethod = c("Wild Bootstrap", "Independent Bootstrap"))
mADCFtest(x, type = c("truncated", "bartlett", "daniell", "QS", "parzen"), p, b = 0, parallel = FALSE, bootMethod = c("Wild Bootstrap", "Independent Bootstrap"))
x |
multivariate time series. |
type |
A character string which indicates the smoothing kernel. Possible choices are 'truncated' (the default), 'bartlett', 'daniell', 'QS', 'parzen'. |
p |
The bandwidth, whose choice is determined by |
b |
The number of bootstrap replicates of the test statistic. It is a positive integer. If b=0 (the default), then no p-value is returned. |
parallel |
A logical value. By default, parallel=FALSE. If parallel=TRUE, bootstrap computation is distributed to multiple cores, which typically is the maximum number of available CPUs and is detecting directly from the function. |
bootMethod |
A character string indicating the method to use for obtaining the empirical p-value of the test. Possible choices are "Wild Bootstrap" (the default) and "Independent Bootstrap". |
mADCFtest
performs a test of multivariate independence. In particular, the function computes a test statistic
for testing whether the data are independent and identically distributed (i.i.d). The p-value of the test is obtained via
resampling method. Possible choices are the independent wild bootstrap (Dehling and Mikosch, 1994; Shao, 2010; Leucht and Neumann, 2013)
and the independent bootstrap, with b
replicates. The observed statistic is given by
where with
denoting the dimension of the
multivariate time series and
is obtained from the elements of the corresponding matrix
mADCV
.
denotes the complex conjugate matrix of
obtained from
mADCV
, and
denotes the trace of a matrix
.
is a kernel function computed by
kernelFun
and p
is a bandwidth or lag order whose choice is further discussed in Fokianos and Pitsillou (2017).
Under the null hypothesis of independence and some further assumptions about the kernel function , the standardized
version of the test statistic follows
asymptotically and it is consistent. More details of the asymptotic properties
of the statistic can be found in Fokianos and Pitsillou (2017).
mADCVtest
performs the same test based on the auto-distance covariance matrix mADCV
.
An object of class htest
which is a list containing:
method |
The description of the test. |
statistic |
The observed value of the test statistic. |
replicates |
The bootstrap replicates of the test statistic (if |
p.value |
The p-value of the test (if |
bootMethod |
The method followed for computing the p-value of the test. |
data.name |
A description of the data (data name, kernel type, |
The computation of the test statistic is only based on the biased estimator of auto-distance covariance matrix.
Maria Pitsillou, Michail Tsagris and Konstantinos Fokianos.
Edelmann, D, K. Fokianos. and M. Pitsillou. (2019). An Updated Literature Review of Distance Correlation and Its Applications to Time Series. International Statistical Review, 87, 237-262.
Dehling, H. and T. Mikosch (1994). Random quadratic forms and the bootstrap for U-statistics. Journal of Multivariate Analysis, 51, 392-413.
Fokianos K. and Pitsillou M. (2018). Testing independence for multivariate time series via the auto-distance correlation matrix. Biometrika, 105, 337-352.
Fokianos K. and M. Pitsillou (2017). Consistent testing for pairwise dependence in time series. Technometrics, 159, 262-3270.
Huo, X. and G. J. Szekely. (2016). Fast Computing for Distance Covariance. Technometrics, 58, 435-447.
Leucht, A. and M. H. Neumann (2013). Dependent wild bootstrap for degenerate U- and V- statistics. Journal of Multivariate Analysis, 117, 257-280.
Pitsillou M. and Fokianos K. (2016). dCovTS: Distance Covariance/Correlation for Time Series. R Journal, 8, 324-340.
Shao, X. (2010). The dependent wild bootstrap. Journal of the American Statistical Association, 105, 218-235.
x <- matrix( rnorm(200), ncol = 2 ) n <- length(x) c <- 3 lambda <- 0.1 p <- ceiling(c * n^lambda) mF <- mADCFtest(x, type = "truncated", p = p, b = 500, parallel = FALSE)
x <- matrix( rnorm(200), ncol = 2 ) n <- length(x) c <- 3 lambda <- 0.1 p <- ceiling(c * n^lambda) mF <- mADCFtest(x, type = "truncated", p = p, b = 500, parallel = FALSE)
Computes the sample auto-distance covariance matrices of a multivariate time series.
mADCV(x, lags, unbiased = FALSE, output = TRUE)
mADCV(x, lags, unbiased = FALSE, output = TRUE)
x |
Multivariate time series. |
lags |
The lag order at which to calculate the |
unbiased |
A logical value. If unbiased = TRUE, the individual elements of auto-distance covariance matrix correspond to the unbiased estimators of squared auto-distance covariance functions. Default value is FALSE. |
output |
A logical value. If output=FALSE, no output is given. Default value is TRUE. |
Suppose that is a multivariate
time series of dimension
.
Then,
mADCV
computes the sample auto-distance
covariance matrix,
,
of
given by
where denotes the biased estimator of the pairwise
auto-distance covariance function between
and
. The definition of
is
given analogously as in the univariate
case (see
ADCV
). Formal definitions and theoretical properties of
auto-distance covariance matrix can be
found in Fokianos and Pitsillou (2018).
If unbiased = TRUE, mADCV
computes the matrix,
, whose elements correspond to the unbiased estimators
of squared pairwise auto-distance covariance functions, namely
The definition of is defined analogously as
explained in the univariate case
(see
ADCV
).
If lags
is a single number then the function will return a matrix.
If lags
is a vector of many values the function will return an array.
For either case, the matrix (matrices) will contain either the biased estimators
of the pairwise auto-distance covariance functions or the unbiased estimators
of squared pairwise auto-distance covariance functions at lag, ,
determined by the argument
lags
.
Maria Pitsillou, Michail Tsagris and Konstantinos Fokianos.
Edelmann, D, K. Fokianos. and M. Pitsillou. (2019). An Updated Literature Review of Distance Correlation and Its Applications to Time Series. International Statistical Review, 87, 237-262.
Fokianos K. and Pitsillou M. (2018). Testing independence for multivariate time series via the auto-distance correlation matrix. Biometrika, 105, 337-352.
Huo, X. and G. J. Szekely. (2016). Fast Computing for Distance Covariance. Technometrics, 58, 435-447.
Pitsillou M. and Fokianos K. (2016). dCovTS: Distance Covariance/Correlation for Time Series. R Journal, 8, 324-340.
x <- matrix( rnorm(200), ncol = 2 ) mADCV(x, lags = 1) mADCV(x, lags = 15) y <- as.ts(swiss) mADCV(y, 15) mADCV(y, 15, unbiased = TRUE)
x <- matrix( rnorm(200), ncol = 2 ) mADCV(x, lags = 1) mADCV(x, lags = 15) y <- as.ts(swiss) mADCV(y, 15) mADCV(y, 15, unbiased = TRUE)
A test of independence based on auto-distance covariance matrix in multivariate time series proposed by Fokianos a nd Pitsillou (2017).
mADCVtest(x, type = c("truncated", "bartlett", "daniell", "QS", "parzen"), p, b = 0, parallel = FALSE, bootMethod = c("Wild Bootstrap", "Independent Bootstrap"))
mADCVtest(x, type = c("truncated", "bartlett", "daniell", "QS", "parzen"), p, b = 0, parallel = FALSE, bootMethod = c("Wild Bootstrap", "Independent Bootstrap"))
x |
Multivariate time series. |
type |
A character string which indicates the smoothing kernel. Possible choices are 'truncated' (the default), 'bartlett', 'daniell', 'QS', 'parzen'. |
p |
The bandwidth, whose choice is determined by |
b |
The number of bootstrap replicates of the test statistic. It is a positive integer. If b=0 (the default), then no p-value is returned. |
parallel |
A logical value. By default, parallel=FALSE. If parallel=TRUE, bootstrap computation is distributed to multiple cores, which typically is the maximum number of available CPUs and is detecting directly from the function. |
bootMethod |
A character string indicating the method to use for obtaining the empirical p-value of the test. Possible choices are "Wild Bootstrap" (the default) and "Independent Bootstrap". |
mADCVtest
tests whether the vector series are independent and identically distributed (i.i.d). The p-value
of the test is obtained via resampling scheme. Possible choices are the independent wild bootstrap (Dehling and Mikosch, 1994; Shao, 2010;
Leucht and Neumann, 2013) and independent bootstrap, with b
replicates. The observed statistic is
where denotes the complex conjugate matrix of
obtained from
mADCV
, and
denotes the trace of a matrix
, which is the sum of the diagonal elements of
.
is a kernel function computed by
kernelFun
and p
is a bandwidth or lag order whose choice is further discussed
in Fokianos and Pitsillou (2017).
Under the null hypothesis of independence and some further assumptions about the kernel function , the standardized
version of the test statistic follows
asymptotically and it is consistent. More details of the asymptotic properties
of the statistic can be found in Fokianos and Pitsillou (2017).
mADCFtest
performs the same test based on the distance correlation matrix mADCF
.
An object of class htest
which is a list including:
method |
The description of the test. |
statistic |
The observed value of the test statistic. |
replicates |
Bootstrap replicates of the test statistic (if |
p.value |
The p-value of the test (if |
bootMethod |
The method followed for computing the p-value of the test. |
data.name |
The description of the data (data name, kernel type, |
The computation of the test statistic is only based on the biased estimator of auto-distance covariance matrix.
Maria Pitsillou, Michail Tsagris and Konstantinos Fokianos.
Edelmann, D, K. Fokianos. and M. Pitsillou. (2019). An Updated Literature Review of Distance Correlation and Its Applications to Time Series. International Statistical Review, 87, 237-262.
Dehling, H. and T. Mikosch (1994). Random quadratic forms and the bootstrap for U-statistics. Journal of Multivariate Analysis, 51, 392-413.
Fokianos K. and Pitsillou M. (2018). Testing independence for multivariate time series via the auto-distance correlation matrix. Biometrika, 105, 337-352.
Fokianos K. and M. Pitsillou (2017). Consistent testing for pairwise dependence in time series. Technometrics, 159, 262-3270.
Huo, X. and G. J. Szekely. (2016). Fast Computing for Distance Covariance. Technometrics, 58, 435-447.
Leucht, A. and M. H. Neumann (2013). Dependent wild bootstrap for degenerate U- and V- statistics. Journal of Multivariate Analysis, 117, 257-280.
Pitsillou M. and Fokianos K. (2016). dCovTS: Distance Covariance/Correlation for Time Series. R Journal, 8, 324-340.
Shao, X. (2010). The dependent wild bootstrap. Journal of the American Statistical Association, 105, 218-235.
x <- matrix( rnorm(200), ncol = 2 ) n <- length(x) c <- 3 lambda <- 0.1 p <- ceiling(c * n^lambda) mF <- mADCVtest(x, type = "bar", p = p, b = 500, parallel = FALSE)
x <- matrix( rnorm(200), ncol = 2 ) n <- length(x) c <- 3 lambda <- 0.1 p <- ceiling(c * n^lambda) mF <- mADCVtest(x, type = "bar", p = p, b = 500, parallel = FALSE)
Cardiovascular mortality data measured daily in Los Angeles County over the 10 year period 1970-1979. Temperature series and pollutant particulate series corresponding to mortality data are also given.
MortTempPart
MortTempPart
A data frame with 508 observations on the following 3 variables.
cmort
A numeric vector.
tempr
A numeric vector.
part
A numeric vector.
Shumway R. H. and D. S. Stoffer (2011). Time Series Analysis and Its Applications With R Examples. New York: Springer. Third Edition.
### mADCFplot(MortTempPart[1:100, ], MaxLag = 10)
### mADCFplot(MortTempPart[1:100, ], MaxLag = 10)
A test of pairwise independence for univariate time series.
UnivTest(x, type = c("truncated", "bartlett", "daniell", "QS", "parzen"), testType = c("covariance", "correlation"), p, b = 0, parallel = FALSE, bootMethod = c("Wild Bootstrap", "Independent Bootstrap"))
UnivTest(x, type = c("truncated", "bartlett", "daniell", "QS", "parzen"), testType = c("covariance", "correlation"), p, b = 0, parallel = FALSE, bootMethod = c("Wild Bootstrap", "Independent Bootstrap"))
x |
A numeric vector or univariate time series. |
type |
A character string which indicates the smoothing kernel. Possible choices are 'truncated' (the default), 'bartlett', 'daniell', 'QS', 'parzen'. |
testType |
A character string indicating the type of the test to be used. Allowed values are 'covariance' (default) for using the distance covariance function and 'correlation' for using the distance correlation function. |
p |
The bandwidth, whose choice is determined by |
b |
The number of bootstrap replicates of the test statistic. It is a positive integer. If b=0 (the default), then no p-value is returned. |
parallel |
A logical value. By default, parallel=FALSE. If parallel=TRUE, bootstrap computation is distributed to multiple cores, which typically is the maximum number of available CPUs and is detecting directly from the function. |
bootMethod |
A character string indicating the method to use for obtaining the empirical p-value of the test. Possible choices are "Wild Bootstrap" (the default) and "Independent Bootstrap". |
UnivTest
performs a test on the null hypothesis of independence in
univariate time series. The p-value of the test is obtained via resampling
method. Possible choices are the independent wild bootstrap
(Dehling and Mikosch, 1994; Shao, 2010; Leucht and Neumann, 2013)
(default option) and the ordinary independent bootstrap, with b
replicates. If typeTest
= 'covariance' then, the observed statistic is
otherwise
where is a kernel function computed by
kernelFun
and p
is a bandwidth or lag order whose choice is further discussed in
Fokianos and Pitsillou (2017).
Under the null hypothesis of independence and some further assumptions about
the kernel function , the standardizedversion of the test
statistic follows
asymptotically and it is consistent.
More details of the asymptotic properties of the statistic can be found in
Fokianos and Pitsillou (2017).
An object of class htest
which is a list including:
method |
The description of the test. |
statistic |
The observed value of the test statistic. |
replicates |
Bootstrap replicates of the test statistic (if |
p.value |
The p-value of the test (if |
bootMethod |
The method followed for computing the p-value of the test. |
data.name |
Description of data (the data name, kernel type, |
The observed statistics of the tests are only based on the biased estimators of distance covariance and correlation functions.
Maria Pitsillou, Michail Tsagris and Konstantinos Fokianos.
Dehling, H. and T. Mikosch (1994). Random quadratic forms and the bootstrap for U-statistics. Journal of Multivariate Analysis, 51, 392-413.
Fokianos K. and M. Pitsillou (2017). Consistent testing for pairwise dependence in time series. Technometrics, 159(2), 262-3270.
Huo, X. and G. J. Szekely. (2016). Fast Computing for Distance Covariance. Technometrics, 58, 435-447.
Leucht, A. and M. H. Neumann (2013). Dependent wild bootstrap for degenerate U- and V- statistics. Journal of Multivariate Analysis, 117, 257-280.
Pitsillou M. and Fokianos K. (2016). dCovTS: Distance Covariance/Correlation for Time Series. R Journal, 8, 324-340.
Shao, X. (2010). The dependent wild bootstrap. Journal of the American Statistical Association, 105, 218-235.
dat <- tail(ibmSp500[, 2], 100) n2 <- length(dat) c2 <- 3 lambda2 <- 0.1 p2 <- ceiling(c2 * n2^lambda2) testCov <- UnivTest(dat, type = "par", testType = "covariance", p = p2, b = 500, parallel = FALSE) testCor <- UnivTest(dat, type = "par", testType = "correlation", p = p2, b = 500, parallel = FALSE)
dat <- tail(ibmSp500[, 2], 100) n2 <- length(dat) c2 <- 3 lambda2 <- 0.1 p2 <- ceiling(c2 * n2^lambda2) testCov <- UnivTest(dat, type = "par", testType = "covariance", p = p2, b = 500, parallel = FALSE) testCor <- UnivTest(dat, type = "par", testType = "correlation", p = p2, b = 500, parallel = FALSE)