Nonparametric test of equality between two copulas

Share:

Description

This function performs the nonparametric test of equality between two copulas proposed by Remillard and Scaillet (2009). The test is based on the Cramer-von-Mises statistic between the two empirical copulas. An approximate p-value is returned.

Usage

1
TwoCop(x, y, Nsim=100, paired=FALSE, alpha=0.95)

Arguments

x

n by d matrix containing the first dataset.

y

m by d matrix containing the second dataset.

Nsim

Number of iterations used in the approximation of the p-value.

paired

FALSE (default) means that x and y are from two independent populations, TRUE indicates paired data.

alpha

Level of the calculated VaR. Default is 0.95.

Details

Details of the method can be found in Remillard and Scaillet (2009).

Value

A list of the following objects:

cvm

Value of the Cramer-von Mises test statistic.

pvalue

pvalue based on the multiplier Monte Carlo method with Nsim iterations.

cvmsim

Simulated values of the Cramer-von Mises statistic.

VaR

alpha quantile of the simulated Cramer-von Mises statistics.

Author(s)

Bruno Remillard and Jean-Francois Plante

References

Remillard, B. & Scaillet, O. (2009) Testing for equality between two copulas. Journal of Multivariate Analysis, 100, 377-386.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
# Simulating a bivariate normal (copula = independence)

  X=matrix(rnorm(100),ncol=2)

# Simulating a bivriate exponential distribution with a Clayton copula

  v=runif(50)
  theta=1
  x<-1/(1/runif(50)/v^(theta+1))^(1/(theta+1))
  u<-(x^(-theta)-v^(-theta)+1)^(-1/theta)
  Y=cbind(-log(1-u),-log(1-v))
  
# Testing equality of the copulas

  TwoCop(X,Y)$pvalue

Want to suggest features or report bugs for rdrr.io? Use the GitHub issue tracker.