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 |
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 |
verbose |
control the text output of the procedure.
If |
methodTree |
method for constructing the tree
Only used if |
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 |
methodPvalue |
method for computing the p-value
|
nBootstrap |
number of bootstrap replications
(Only used if |
Value
a list with the following components
-
p.value
the estimated p-value. -
stat
the test statistic. -
treeCKT
the estimated tree ifmatrixInd
is not provided. -
vec_statB
the vector of bootstrapped statistics ifmethodPvalue
is notcovMatrix
.
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:
-
simpA.NP
in a nonparametric setting -
simpA.param
in a (semi)parametric setting, where the conditional copula belongs to a parametric family, but the conditional margins are estimated arbitrarily through kernel smoothing -
simpA.kendallReg
: test based on the constancy of conditional Kendall's tau
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)