cpTestRho(x, method = c("mult", "asym.var"),
statistic = c("pairwise", "global"),
b = 1, weights = c("parzen", "bartlett"),
N = 1000, init.seq = NULL)"mult" (the multiplier approach 'tilde' in the first
reference) or "asym.var" (the approach based on the
e"pairwise" (the statistic $S_{n,3}$ in the first
reference) or "global" (the statistic $S_{n,1}$
in the first reference).N * (nrow(x) + 2 * (b - 1)) used to generate dependent
multiplier sequences.class htest which is a list,
some of the components of which arenrow(x)-1 intermediate
change-point statistics; the test statistic is defined as
the maximum of those.b.method == "mult", 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. When method == "asym.var", the approximate p-value is computed
from the estimated asymptotic null distribution, which involves the
Kolmogorov distribution. The latter is dealt with reusing code from
the ks.test() function; credit to RCore.
A. B
cpTestFn() for a related test based on the multivariate
empirical c.d.f., cpTestCn() for a related test based on
the empirical copula.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 <- cpTestRho(x)
cp
## estimated change-point
which(cp$rho == max(cp$rho))Run the code above in your browser using DataLab