Learn R Programming

Kcop (version 1.0.0)

KcopTest: Nonparametric smooth test for equality of copulas

Description

This functions performs the nonparametric smooth test to compare simultaneously K(K>1) copulas. See 'Details' below for further information.

Usage

KcopTest(Kdata, dn = 3, paired = FALSE)

Value

A list with three elements: the p-value of the test, the value of the test statistic and the selected rank of copulas coefficients (number of terms involved in the test statistic)

Arguments

Kdata

A list of the K dataframe or matrix

dn

Number of copulas coefficients considered

paired

A logical indicating whether to consider the datas as paired

Author

Yves Ismael Ngounou Bakam

Details

Recall that we have K multivariate populations of arbitrary sizes, possibly paired with unknow associated copulas C_1,...,C_K respectively. KcopTest performs the following hypothesis H0: C_1=C_2=...=C_K against H1: C_l differs from C_m (l different from m and l,m in 1:K). The test is based on copulas cross-moments founded on Legendre polynomials that he called copulas coefficients. See the paper at the following HAL weblink: https://hal.archives-ouvertes.fr/hal-03475324v2

Examples

Run this code
## simulation of 5 three-dimensional populations of different sizes
Packages <- c("copula","gtools","dplyr", "orthopolynom", "stats")
lapply(Packages, library, character.only = TRUE) # if necessary
set.seed(2022)
dat1<-rCopula(50, copula = gumbelCopula(param=6,dim = 2))
dat2<-rCopula(60, copula = claytonCopula(param=0.4,dim = 2))
dat3<-rCopula(55, copula = claytonCopula(param=0.4,dim = 2))
## Form a list of data
Kdata<-list(data1=dat1,data2=dat2,data3=dat3)
## Applying the test
KcopTest(Kdata = Kdata)

Run the code above in your browser using DataLab