bCond.simpA.CKT {CondCopulas}R Documentation

Function for testing the simplifying assumption with data-driven box-type conditioning events

Description

This function takes in parameter the matrix of (observations) of the conditioned variables and either matrixInd, a matrix of indicator variables describing which events occur for which observations

Usage

bCond.simpA.CKT(
  XI,
  XJ = NULL,
  matrixInd = NULL,
  minCut = 0,
  minProb = 0.01,
  minSize = minProb * nrow(XI),
  nPoints_xJ = 10,
  type.quantile = 7,
  verbose = 2,
  methodTree = "doSplit",
  propTree = 0.5,
  methodPvalue = "bootNP",
  nBootstrap = 100
)

Arguments

XI

matrix of size n*p of observations of the conditioned variables.

XJ

matrix of size n*(d-p) containing observations of the conditioning vector.

matrixInd

a matrix of indexes of size (n, N.boxes) describing for each observation i to which box ( = event) it belongs.

If it is NULL, then a tree will be estimated to provide relevant boxes (by using bCond.treeCKT()) and then converting to a matrixInd by treeCKT2matrixInd().

minCut

minimum difference in probabilities that is necessary to cut.

minProb

minimum probability of being in one of the node.

minSize

minimum number of observations in each node. This is an alternative to minProb and has priority over it.

nPoints_xJ

number of points in the grid that are considered when choosing the point for splitting the tree.

type.quantile

way of computing the quantiles, see stats::quantile().

verbose

control the text output of the procedure. If verbose = 0, suppress all output. If verbose = 2, the progress of the computation is printed during the computation.

methodTree

method for constructing the tree

  • doSplit some part of the data is used for constructing the tree and the other part for constructing the test statistic using the boxes defined by the estimated tree. The share of the data used for construction the tree is controlled by the parameter propTree.

  • noSplit all of the data is used for both the tree and the test statistic on it. Note that p-values obtained by this method have an upward bias due to the lack of independence between these two steps.

Only used if matrixInd is not provided.

propTree

share of observations used to build the tree (the rest of the observations are used for the computation of the p-value). Only used if matrixInd is not provided.

methodPvalue

method for computing the p-value

  • covMatrix by computation of the covariance matrix of the random vector (\tau_{i,k|X_J \in A_j}, 1\leq,i,k\leq p, 1\leq j \leq m).

  • bootNP by the usual non-parametric bootstrap

  • bootInd by the independent bootstrap

nBootstrap

number of bootstrap replications (Only used if methodPvalue is not covMatrix).

Value

a list with the following components

Author(s)

Alexis Derumigny, Jean-David Fermanian and Aleksey Min

References

Derumigny, A., Fermanian, J. D., & Min, A. (2022). Testing for equality between conditional copulas given discretized conditioning events. Canadian Journal of Statistics. doi:10.1002/cjs.11742

Derumigny, A., & Fermanian, J. D. (2022) Conditional empirical copula processes and generalized dependence measures Electronic Journal of Statistics, 16(2), 5692-5719. doi:10.1214/22-EJS2075

See Also

bCond.simpA.param for a test of this simplifying assumption in a parametric framework.

bCond.treeCKT provides the binary tree that is used in this function (if matrixInd is not provided).

Tests of the simplifying assumption for conditional copulas with a continuous conditioning variable:

Examples

set.seed(1)
n = 200
XJ = MASS::mvrnorm(n = n, mu = c(3,3), Sigma = rbind(c(1, 0.2), c(0.2, 1)))
XI = matrix(nrow = n, ncol = 2)
high_XJ1 = which(XJ[,1] > 4)
XI[high_XJ1, ]  = MASS::mvrnorm(n = length(high_XJ1), mu = c(10,10),
                                Sigma = rbind(c(1, 0.8), c(0.8, 1)))
XI[-high_XJ1, ] = MASS::mvrnorm(n = n - length(high_XJ1), mu = c(8,8),
                                Sigma = rbind(c(1, -0.2), c(-0.2, 1)))

result = bCond.simpA.CKT(XI = XI, XJ = XJ, minSize = 10, verbose = 2,
                         methodTree = "doSplit", nBootstrap = 4)
print(result$p.value)
result2 = bCond.simpA.CKT(XI = XI, XJ = XJ, minSize = 10, verbose = 2,
                          methodTree = "noSplit", nBootstrap = 4)
print(result2$p.value)



[Package CondCopulas version 0.1.3 Index]