Type: | Package |
Title: | Tests of Independence Between Innovations of Generalized Error Models |
Version: | 0.1.6 |
Description: | Computation of test statistics of independence between (continuous) innovations of time series. They can be used with stochastic volatility models and Hidden Markov Models (HMM). This improves the results in Duchesne, Ghoudi & Remillard (2012) <doi:10.1002/cjs.11141>. |
Depends: | R (≥ 3.5.0), stats |
Imports: | ggplot2, MixedIndTests |
License: | GPL-2 | GPL-3 [expanded from: GPL (≥ 2)] |
Encoding: | UTF-8 |
RoxygenNote: | 7.3.2 |
NeedsCompilation: | yes |
Packaged: | 2025-01-31 14:09:07 UTC; 49009427 |
Author: | Kilani Ghoudi [aut, ctb, cph], Bouchra R. Nasri [aut, ctb, cph], Bruno N Remillard [aut, cre, cph], Pierre Duchesne [aut, ctb, cph] |
Maintainer: | Bruno N Remillard <bruno.remillard@hec.ca> |
Repository: | CRAN |
Date/Publication: | 2025-01-31 14:30:04 UTC |
Cross-correlogram
Description
This function, used in crosscor_2series and crosscor_3series plots the graphs of the cross-correlation statistics.
Usage
CrossCorrelogram(object, comb, rot = 0)
Arguments
object |
List of the output (statistics, pvalues) from crosscor_2series and crosscor_3series |
comb |
Name (string) of series, e.g., comb="(x,y)" |
rot |
Rotation of labels (default=0) |
Value
Output |
No values are returned; only the graph is printed |
References
Duchesne, Ghoudi & Remillard (2012). On Testing for independence between the innovations of several time series. CJS, vol. 40, 447-479.
Examples
#Romano-Siegel's example #
data(romano_ex)
outr = crosscor_3series(romano_ex$x,romano_ex$y,romano_ex$z,5,2)
CrossCorrelogram(outr$out123,"{x,y,z}",rot=90)
Cross-correlations for testing independence between the innovations of 2 series of same length
Description
This function computes the cross-correlations between x(t) and y(t-l), for l=-lag,.., lag, and also the combination (Wald's type) of these statistics.
Usage
crosscor_2series(x, y, lag, graph = TRUE)
Arguments
x |
Pseudo-observations (or residuals) of first series |
y |
Pseudo-observations (or residuals) of second series |
lag |
Maximum number of lags around 0 |
graph |
Set to TRUE for a correlogram for all possible lags. |
Value
stat |
Cross-correlations for all lags |
LB |
Sum of squares of cross-correlations |
pvalue |
P-value of LB |
subsets |
c(-lag:lag) |
n |
length of the time series |
References
Duchesne, Ghoudi & Remillard (2012). On Testing for independence between the innovations of several time series. CJS, vol. 40, 447-479.
Examples
data(gas)
outr <-crosscor_2series(gas$xres,gas$yres,3)
Cross-correlations statistics for testing independence between the innovations of 3 series of same length
Description
This function computes the cross-correlations for all lags = -lag2, .. lag2, for all pairs, and for pair of lags = (-lag3,-lag3),...(lag3,lag3) for the three series.
Usage
crosscor_3series(x, y, z, lag2, lag3)
Arguments
x |
Pseudo-observations (or residuals) of first series. |
y |
Pseudo-observations (or residuals) of second series. |
z |
Pseudo-observations (or residuals) of third series. |
lag2 |
Maximum number of lags around 0 for pairs of series. |
lag3 |
Maximum number of lags around 0 for the three series. |
Value
stat |
Cross-correlations for all lags and for all subsets |
H |
Sum of squares of cross-correlations for all subsets |
pvalue |
P-value of stat for all subsets and H |
n |
length of the time series |
References
Duchesne, Ghoudi & Remillard (2012). On Testing for independence between the innovations of several time series. CJS, vol. 40, 447-479.
Examples
# Romano-Siegel's example #
data(romano_ex)
outr = crosscor_3series(romano_ex$x,romano_ex$y,romano_ex$z,5,2)
Cross-dependences for testing independence between the innovations of 2 series of same length
Description
This function computes the cross-dependence between x(t) and y(t-l), for Spearman, van der Waerden and Savage dependence measures, for l=-lag,.., lag, and also the combination (Wald's type) of these statistics.
Usage
crossdep_2series(x, y, lag, graph = TRUE)
Arguments
x |
Pseudo-observations (or residuals) of first series |
y |
Pseudo-observations (or residuals) of second series |
lag |
Maximum number of lags around 0 |
graph |
Set to TRUE for a correlogram for all possible lags. |
Value
stat |
Cross-dependences for all lags |
H |
Sum of squares of cross-dependences |
pvalue |
P-value of H |
subsets |
c(-lag:lag) |
n |
length of the time series |
References
Duchesne, Ghoudi & Remillard (2012). On Testing for independence between the innovations of several time series. CJS, vol. 40, 447-479.
Nasri & Remillard (2024). Tests of independence and randomness for arbitrary data using copula-based covariances. JMVA, vol. 201, 105273.
Examples
data(gas)
outr <-crossdep_2series(gas$xres,gas$yres,3)
Cross-dependence statistics for testing independence between the innovations of 3 series of same length
Description
This function computes the cross-dependence for Spearman, van der Waerden and Savage dependence measures, for all lags = -lag2, .. lag2, for all pairs, and for pair of lags = (-lag3,-lag3),...(lag3,lag3) for the three series.
Usage
crossdep_3series(x, y, z, lag2, lag3)
Arguments
x |
Pseudo-observations (or residuals) of first series. |
y |
Pseudo-observations (or residuals) of second series. |
z |
Pseudo-observations (or residuals) of third series. |
lag2 |
Maximum number of lags around 0 for pairs of series. |
lag3 |
Maximum number of lags around 0 for the three series. |
Value
stat |
Cross-dependences for all lags and for all subsets |
H |
Sum of squares of cross-correlations for all subsets |
pvalue |
P-value of LB for all subsets and H |
n |
length of the time series |
References
Duchesne, Ghoudi & Remillard (2012). On Testing for independence between the innovations of several time series. CJS, vol. 40, 447-479.
Nasri & Remillard (2024). Tests of independence and randomness for arbitrary data using copula-based covariances. JMVA, vol. 201, 105273.
Examples
#Romano-Siegel's example #
data(romano_ex)
outr = crossdep_3series(romano_ex$x,romano_ex$y,romano_ex$z,5,2)
CrossCorrelogram(outr$spearman$out123,"Savage for {1,2,3}",rot=90)
Cramer-von Mises Moebius statistics for testing independence between the innovations of 2 series of same length
Description
This function computes the Cramer-von Mises statistics between x(t) and y(t-l), for l=-lag,.., lag, and also the combinations of the p-values of these statistics.
Usage
cvm_2series(x, y, lag, graph = TRUE)
Arguments
x |
Pseudo-observations (or residuals) of first series |
y |
Pseudo-observations (or residuals) of second series |
lag |
Maximum number of lags around 0 |
graph |
Set to TRUE for a dependogram for all possible lags. |
Value
cvm |
Cramer-von Mises statistics for all lags |
Wstat |
Sum of (unbiased) Cramer-von Mises statistics |
Fstat |
Combination of p-values of the Cramer-von Mises statistics |
pvalue |
List of p-values for the cvm, Wstat, and Fstat |
References
Duchesne, Ghoudi & Remillard (2012). On Testing for independence between the innovations of several time series. CJS, vol. 40, 447-479.
Examples
data(gas)
out <-cvm_2series(gas$xres,gas$yres,3)
Cramer-von Mises Moebius statistics for testing independence between the innovations of 3 series of same length
Description
This function computes the Cramer-von Mises statistics between x(t), y(t-l2), z(t-l3), for l2=-lag2,.., lag2, l3=-lag3,.., lag3,and also the combinations of these statistics.
Usage
cvm_3series(x, y, z, lag2, lag3)
Arguments
x |
Pseudo-observations (or residuals) of first series. |
y |
Pseudo-observations (or residuals) of second series. |
z |
Pseudo-observations (or residuals) of third series. |
lag2 |
Maximum number of lags around 0 for pairs of series. |
lag3 |
Maximum number of lags around 0 for the three series. |
Value
cvm |
Cramer-von Mises statistics for all lags and for all subsets |
Wstat |
Sum of (unbiased) Cramer-von Mises statistics for all subsets |
Fstat |
Combination of p-values of the Cramer-von Mises statistics |
pvalue |
List of p-values for the cvm, Wstat, and Fstat |
References
Duchesne, Ghoudi & Remillard (2012). On Testing for independence between the innovations of several time series. CJS, vol. 40, 447-479.
Examples
set.seed(1)
x0 = rnorm(100); y = rnorm(100); z = rnorm(100);
Dependogram for Cramer-von Mises statistics
Description
This function, used in cvm_2series and cvm_3series draws the P-values of the Moebius Cramer-von Mises statistics.
Usage
dependogram(object, stat, rot = 0)
Arguments
object |
List of the output (statistics, pvalues) from cvm_2series and cvmr_3series |
stat |
Name (string) of statistics to be used |
rot |
Rotation of labels (default=0) |
Value
Output |
No values are returned; only the graph is printed |
References
Duchesne, Ghoudi & Remillard (2012). On Testing for independence between the innovations of several time series. CJS, vol. 40, 447-479.
Examples
#Romano-Siegel's example #
data(romano_ex)
out = cvm_3series(romano_ex$x,romano_ex$y,romano_ex$z,5,2)
dependogram(out$out123,"{x,y,z}",rot=90)
Standardized residuals of weekly log-returns of gas and oil prices in Canada from 2008 to end of February 2011
Description
Data frame containg xres (standardized residuals of gas prices from a ARMA(2,2) model) and yres (standardized residuals of oil prices from a ARMA(1,1)-GARCH(1,1) model).
Usage
data(gas)
Format
Residuals
Examples
data(gas)
plot(gas$xres)
Simulated values of a Romano & Siegel example
Description
Data frame containing 100 values of x,y,z generated as follows: x0 = rnorm(100); y = rnorm(100); z = rnorm(100); x = abs(x0)*sign(y*z). All pairs are independent but the three series are not.
Usage
data(romano_ex)
Format
dataframe
Examples
data(romano_ex)
plot(romano_ex$x)