Package 'IndGenErrors'

Title: Tests of Independence Between Innovations of Generalized Error Models
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>.
Authors: 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 <[email protected]>
License: GPL (>= 2)
Version: 0.1.4
Built: 2024-12-11 06:54:51 UTC
Source: CRAN

Help Index


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 series3.

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

LB

Cross-correlations 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.

Examples

# Romano-Siegel's example #
data(romano_ex)
outr = crosscor_3series(romano_ex$x,romano_ex$y,romano_ex$z,5,2)

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.


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.


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)