Learn R Programming

CondCopulas (version 0.2.0)

simpA.NP: Nonparametric testing of the simplifying assumption

Description

This function tests the ``simplifying assumption'' that a conditional copula $$C_{1,2|3}(u_1, u_2 | X_3 = x_3)$$ does not depend on the value of the conditioning variable \(x_3\) in a nonparametric setting, where the conditional copula is estimated by kernel smoothing.

Usage

simpA.NP(
  X1,
  X2,
  X3,
  testStat,
  typeBoot = "bootNP",
  h,
  nBootstrap = 100,
  kernel.name = "Epanechnikov",
  truncVal = NULL,
  numericalInt = list(kind = "legendre", nGrid = 10)
)

Value

a list containing

  • true_stat: the value of the test statistic computed on the whole sample

  • vect_statB: a vector of length nBootstrap containing the bootstrapped test statistics.

  • p_val: the p-value of the test.

Arguments

X1

vector of n observations of the first conditioned variable

X2

vector of n observations of the second conditioned variable

X3

vector of n observations of the conditioning variable

testStat

name of the test statistic to be used. Possible values are

  • T1_CvM_Cs3: Equation (3) of (Derumigny & Fermanian, 2017) with the simplified copula estimated by Equation (6) and the weight \(w(u_1, u_2, u_3) = \hat{F}_1(u_1) \hat{F}_2(u_2) \hat{F}_3(u_3)\).

  • T1_CvM_Cs4: Equation (3) of (Derumigny & Fermanian, 2017) with the simplified copula estimated by Equation (7) and the weight \(w(u_1, u_2, u_3) = \hat{F}_1(u_1) \hat{F}_2(u_2) \hat{F}_3(u_3)\).

  • T1_KS_Cs3: Equation (4) of (Derumigny & Fermanian, 2017) with the simplified copula estimated by Equation (6).

  • T1_KS_Cs4: Equation (4) of (Derumigny & Fermanian, 2017) with the simplified copula estimated by Equation (7).

  • tilde_T0_CvM: Equation (10) of (Derumigny & Fermanian, 2017).

  • tilde_T0_KS: Equation (9) of (Derumigny & Fermanian, 2017).

  • I_chi: Equation (13) of (Derumigny & Fermanian, 2017).

  • I_2n: Equation (15) of (Derumigny & Fermanian, 2017).

typeBoot

the type of bootstrap to be used (see Derumigny and Fermanian, 2017, p.165). Possible values are

  • boot.NP: usual (Efron's) non-parametric bootstrap

  • boot.pseudoInd: pseudo-independent bootstrap

  • boot.pseudoInd.sameX3: pseudo-independent bootstrap without resampling on \(X_3\)

  • boot.pseudoNP: pseudo-non-parametric bootstrap

  • boot.cond: conditional bootstrap

h

the bandwidth used for kernel smoothing

nBootstrap

number of bootstrap replications

kernel.name

the name of the kernel

truncVal

the value of truncation for the integral, i.e. the integrals are computed from truncVal to 1-truncVal instead of from 0 to 1. Note that truncVal must be in the interval \([0, 0.5)\), i.e. \(0\) is allowed but not \(0.5\).

The default is truncVal = NULL, which actually means that truncVal = h if h < 0.5 and truncVal = 0 else.

numericalInt

parameters to be given to statmod::gauss.quad, including the number of quadrature points and the type of interpolation.

References

Derumigny, A., & Fermanian, J. D. (2017). About tests of the “simplifying” assumption for conditional copulas. Dependence Modeling, 5(1), 154-197. tools:::Rd_expr_doi("10.1515/demo-2017-0011")

See Also

Other tests of the simplifying assumption:

  • 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

  • the counterparts of these tests in the discrete conditioning setting: bCond.simpA.CKT (test based on conditional Kendall's tau) bCond.simpA.param (test assuming a parametric form for the conditional copula)

The non-parametric measures of non-simplifyingness measures_nonsimplifyingness_NP.

Examples

Run this code
# We simulate from a conditional copula
set.seed(1)
N = 500
Z = rnorm(n = N, mean = 5, sd = 2)
conditionalTau = -0.9 + 1.8 * pnorm(Z, mean = 5, sd = 2)
simCopula = VineCopula::BiCopSim(N=N , family = 1,
    par = VineCopula::BiCopTau2Par(1 , conditionalTau ))
X1 = qnorm(simCopula[,1], mean = Z)
X2 = qnorm(simCopula[,2], mean = - Z)

result <- simpA.NP(
   X1 = X1, X2 = X2, X3 = Z,
   testStat = "I_chi", typeBoot = "boot.pseudoInd",
   h = 0.03, kernel.name = "Epanechnikov", nBootstrap = 10)

# In practice, it is recommended to use at least nBootstrap = 100
# with nBootstrap = 200 being a good choice.

print(result$p_val)

set.seed(1)
N = 500
Z = rnorm(n = N, mean = 5, sd = 2)
conditionalTau = 0.8
simCopula = VineCopula::BiCopSim(N=N , family = 1,
    par = VineCopula::BiCopTau2Par(1 , conditionalTau ))
X1 = qnorm(simCopula[,1], mean = Z)
X2 = qnorm(simCopula[,2], mean = - Z)

result <- simpA.NP(
   X1 = X1, X2 = X2, X3 = Z,
   testStat = "I_chi", typeBoot = "boot.pseudoInd",
   h = 0.08, kernel.name = "Epanechnikov", nBootstrap = 10)
print(result$p_val)

Run the code above in your browser using DataLab