pacotest: Testing for the Partial Copula and the Simplifying Assumption...

Description Arguments Details Value Author(s) References See Also Examples

View source: R/pacotest.R

Description

The function can be used to test for the partial copula and the simplifying assumption for a bivariate conditional copula using different tests. Two different test types, the Constant Conditional Correlation (CCC) test and the Vectorial Independence (VI) test are implemented. For all tests different options can be set by generating a pacotest options list using the pacotestset function.

Arguments

U

A (n x 2) matrix of [0,1] data (probability integral transforms), which are the arguments of the conditional copula of (Y,Z)|W for which the simplifying assumption should be tested. The first column is given by the conditional distribution function of Y|W evaluated at the observed values of Y and W. Analogously, the second column is defined as the conditional distribution function of Z|W evaluated at the observed values of Z and W. If the probability integral transforms are obtained from the partial vine copula (PVC), i.e., partial probability integral transforms (PPITs) are used, the function can be used to test for (j-1)-th order partial copulas.

W

A (n x K) matrix of observed values for the vector of random variables on which the conditioning is done.

pacotestOptions

A options list generated by the pacotestset function or the test type as a string, i.e., CCC or VI.

Details

Applying a test with default options (cf. pacotestset) and with known (i.e., not estimated) PITs (probability integral transforms) in U.

1
out = pacotest(U,W,'CCC')
1
out = pacotest(U,W,'VI')

Applying a test with options specified in pacotestOptions

1
out = pacotest(U,W,pacotestOptions)

Note that when calling pacotest(U,W,'CCC'), the default options for the CCC test are used (cf. pacotestset), but the two parameters withEstUncert = FALSE and estUncertWithRanks = FALSE are altered. In contrast when calling pacotestOptions = pacotestset('CCC'), the two parameters are set to withEstUncert = TRUE and estUncertWithRanks = TRUE. For the CCC test, under the default setting, it is assumed that estimated PPITs are provided and the test statistic is computed under consideration of estimation uncertainty of the probability integral transforms, i.e., withEstUncert = TRUE and estUncertWithRanks = TRUE. To apply pacotest with withEstUncert = TRUE, three additional inputs have to be provided (data, svcmDataFrame and cPitData).

In the vine copula context, PPITs are usually estimated and not known. Therefore, in the vine copula context it is recommended to use the functions pacotestRvineSeq or pacotestRvineSingleCopula instead of pacotest. These functions automatically pass through the additional arguments data, svcmDataFrame, cPitData to the function pacotest and the CCC test can be applied in its default setting with consideration of estimation uncertainty of the probability integral transforms, i.e., withEstUncert = TRUE and estUncertWithRanks = TRUE.

Value

A list which can, depending on the chosen test, consist of the following elements:

pValue

The p-value of the test.

testStat

The value of the test statistic.

decisionTree

The decision tree used to partition the support Lambda0 of the conditioning variable W. It is provided as a list consisting of three nodes (CentralNode, LeftNode and RightNode) represented as lists and the variable LeavesForFinalComparison. Each node consists of the Variable used to perform the split, the corresponding Quantile and Threshold.

S

The bootstrapped values of the test statistic (only for the test type VI).

Author(s)

Malte S. Kurz

References

Kurz, M. S. and F. Spanhel (2017), "Testing the simplifying assumption in high-dimensional vine copulas", ArXiv e-prints https://arxiv.org/abs/1706.02338.

Spanhel, F. and M. S. Kurz (2019), "Simplified vine copula models: Approximations based on the simplifying assumption", Electronic Journal of Statistics 13 (1), 1254-1291.

Spanhel, F. and M. S. Kurz (2016), "The partial copula: Properties and associated dependence measures", Statistics & Probability Letters 119, pp. 76-83.

See Also

pacotest-package, pacotestset, pacotestRvineSeq, pacotestRvineSingleCopula

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
#####################
# Generate an options list, e.g., the constant conditional correlation (CCC)
# test with default options. We use known PITs and don't estimate the parameters
# in the lower trees of the vine copulas and therefore additionally alter the
# two parameters withEstUncert and estUncertWithRanks to FALSE.
pacotestOptions=pacotestset(testType='CCC', withEstUncert = FALSE, estUncertWithRanks = FALSE)

#####################
# Use the specified options to test for the simplifying assumption

##### Example 1: Non-simplified three-dim. C-Vine #####
# Simulate from a three-dimensional C-Vine copula with C_12 and C_13
# being product copulas and C_23|1 being a Frank copula with
# functional parameter theta(x_{1}) = (4x_{1}-2)^3
N = 500
X = matrix(runif(3*N),N,3)
theta = (4*X[,1]-2)^3

etheta = expm1(-theta);
X[,3] = -1/theta*log(1+etheta/(exp(-theta*X[,2])*(1/X[,3]-1)+1));

Result = pacotest(X[,c(2,3)],X[,1],pacotestOptions)
Result$pValue

##### Example 2: Non-simplified three-dim. C-Vine #####
# Simulate from a three-dimensional C-Vine copula with C_12 and C_13
# being product copulas and C_23|1 being a Frank copula with
# functional parameter theta(x_{1}) = 12 + 8*sin(0.4(3x_{1}+2)^2)
X = matrix(runif(3*N),N,3)
theta = 12 + 8*sin(0.4*(3*X[,1]+2)^2)

etheta = expm1(-theta);
X[,3] = -1/theta*log(1+etheta/(exp(-theta*X[,2])*(1/X[,3]-1)+1));

Result = pacotest(X[,c(2,3)],X[,1],pacotestOptions)
Result$pValue

##### Example 3: Simplified three-dim. C-Vine #####
# Simulate from a three-dimensional C-Vine copula with C_12 and C_13
# being Clayton copulas with parameter theta and C_23|1 being a Clayton copula with
# functional parameter theta(x_{1}) = theta / (1+theta)
W = matrix(runif(3*N),N,3)
X = matrix(NA,N,3)
theta = 2

X[,1] = W[,1]
X[,2] = (W[,1]^(-theta)*(W[,2]^((-theta)/(1+theta))-1)+1)^(-1/theta);
theta_23_1 = theta /(1+theta)
X[,3] = (W[,2]^(-theta_23_1)*(W[,3]^((-theta_23_1)/(1+theta_23_1))-1)+1)^(-1/theta_23_1);
X[,3] = (W[,1]^(-theta)*(X[,3]^((-theta)/(1+theta))-1)+1)^(-1/theta);

# Get pseudo-observations from the conditional copula C_23|1
U = matrix(NA,N,2)
U[,1] = (X[,1]^theta*(X[,2]^(-theta)-1)+1)^(-(1+theta)/theta);
U[,2] = (X[,1]^theta*(X[,3]^(-theta)-1)+1)^(-(1+theta)/theta);
Result = pacotest(U,X[,1],pacotestOptions)
Result$pValue

pacotest documentation built on Jan. 13, 2021, 7:50 p.m.