Learn R Programming

npcp (version 0.1-0)

cpTestCn: Test for change-point detection based on the empirical copula

Description

Nonparametric test for change-point detection particularly sensitive to changes in the copula of multivariate continuous observations. The observations can be serially independent or dependent (strongly mixing). Approximate p-values for the test statistic are obtained by means of a multiplier approach. Details can be found in first reference.

Usage

cpTestCn(x, method = c("seq", "nonseq"), b = 1,
         weights = c("parzen", "bartlett"), m = 5,
         L.method=c("max","median","mean","min"),
         N = 1000, init.seq = NULL)

Arguments

x
a data matrix whose rows are multivariate continuous observations.
method
a string specifying the simulation method for generating multiplier replicates of the test statistic; can be either "seq" (the 'check' approach in the first reference) or "nonseq" (the 'hat' approach in the first
b
strictly positive integer specifying the value of the bandwidth parameter determining the serial dependence when generating dependent multiplier sequences using the 'moving average approach'; see Section 6.1 of the second reference. The defaul
weights
a string specifying the kernel for creating the weights used in the generation of dependent multiplier sequences within the 'moving average approach'; see Section 6.1 of the second reference.
m
a strictly positive integer specifying the number of points of the uniform grid on $(0,1)^d$ (where $d$ is ncol(x)) involved in the estimation of the bandwidth parameter; see Section 5 of the third reference. The number of points
L.method
a string specifying how the parameter $L$ involved in the estimation of the bandwidth parameter is computed; see Section 5 of the second reference.
N
number of multiplier replications.
init.seq
a sequence of independent standard normal variates of length N * (nrow(x) + 2 * (b - 1)) used to generate dependent multiplier sequences.

Value

  • An object of class htest which is a list, some of the components of which are
  • statisticvalue of the test statistic.
  • p.valuecorresponding approximate p-value.
  • cvmthe values of the nrow(x)-1 intermediate Cramé{e}r-von Mises change-point statistics; the test statistic is defined as the maximum of those.
  • bthe value of parameter b.

Details

The approximate p-value is computed as $$(0.5 +\sum_{i=1}^N\mathbf{1}_{{S_i\ge S}})/(N+1),$$ where $S$ and $S_i$ denote the test statistic and a multiplier replication, respectively. This ensures that the approximate p-value is a number strictly between 0 and 1, which is sometimes necessary for further treatments.

References

A. Bü{u}cher, I. Kojadinovic, T. Rohmer and J. Segers (2014), Detecting changes in cross-sectional dependence in multivariate time series, http://arxiv.org/abs/1206.2557.

A. Bü{u}cher and I. Kojadinovic (2014), A dependent multiplier bootstrap for the sequential empirical copula process under strong mixing, http://arxiv.org/abs/1306.3930.

See Also

cpTestRho() for a related test based on Spearman's rho, cpTestFn() for a related test based on the multivariate empirical c.d.f., bOptEmpProc() for the function used to estimate b from x if b = NULL.

Examples

Run this code
require(copula)
n <- 100
k <- 50 ## the true change-point
u <- rCopula(k,gumbelCopula(1.5))
v <- rCopula(n-k,gumbelCopula(3))
x <- rbind(u,v)
cp <- cpTestCn(x)
cp
## estimated change-point
which(cp$cvm == max(cp$cvm))

Run the code above in your browser using DataLab