subcopem {subcopem2D}R Documentation

Bivariate Empirical Subcopula

Description

Calculation of bivariate empirical subcopula matrix, induced partitions, standardized bivariate sample, and dependence measures for a given bivariate sample.

Usage

subcopem(mat.xy, display = FALSE)

Arguments

mat.xy

2-column matrix with bivariate observations of a random vector (X,Y)(X,Y).

display

logical value indicating if graphs and dependence measures should be displayed.

Details

Each of the random variables XX and YY may be of any kind (discrete, continuous, or mixed). NA values are not allowed.

Value

A list containing the following components:

depMon

monotone standardized supremum distance in [1,1].[-1,1].

depMonNonSTD

monotone non-standardized supremum distance [min,value,max].[min,value,max].

depSup

standardized supremum distance in [0,1].[0,1].

depSupNonSTD

non-standardized supremum distance [min,value,max].[min,value,max].

matrix

matrix with empirical subcopula values.

part1

vector with partition induced by first variable XX.

part2

vector with partition induced by second variable YY.

sample.size

numeric value of sample size.

std.sample

2-column matrix with the standardized bivariate sample.

sample

2-column matrix with the original bivariate sample of (X,Y)(X,Y).

If display = TRUE then the values of depMon, depMonNonSTD, depSup, and depSupNonSTD will be displayed, and the following graphs will be generated: marginal histograms of XX and YY, scatterplots of the original and the standardized bivariate sample, contour and image bivariate graphs of the empirical subcopula.

Note

If both XX and YY are continuous random variables it is faster and better to use subcopemc.

Author(s)

Arturo Erdely https://sites.google.com/site/arturoerdely

References

Durante, F. and Sempi, C. (2016) Principles of Copula Theory. Taylor and Francis Group, Boca Raton.

Erdely, A. (2017) A subcopula based dependence measure. Kybernetika 53(2), 231-243. DOI: 10.14736/kyb-2017-2-0231

Nelsen, R.B. (2006) An Introduction to Copulas. Springer, New York.

See Also

subcopemc

Examples

## Example 1: Discrete-discrete Poisson positive dependence
n <- 1000  # sample size
X <- rpois(n, 5)  # Poisson(parameter = 5)
p <- 2  # another parameter
Y <- mapply(rpois, rep(1, n), 1 + p*X)  # creating dependence
XY <- cbind(X, Y)  # 2-column matrix with bivariate sample
cor(XY, method = "pearson")[1, 2]   # Pearson's correlation
cor(XY, method = "spearman")[1, 2]  # Spearman's correlation
cor(XY, method = "kendall")[1, 2]  # Kendall's correlation
SC <- subcopem(XY, display = TRUE)
str(SC)

## Example 2: Continuous-discrete non-monotone dependence
n <- 1000      # sample size
X <- rnorm(n)                  # Normal(0,1)
Y <- 2*(X > 1) - 1*(X > -1)    # Discrete({-1, 0, 1})
XY <- cbind(X, Y)  # 2-column matrix with bivariate sample
cor(XY, method = "pearson")[1, 2]   # Pearson's correlation
cor(XY, method = "spearman")[1, 2]  # Spearman's correlation
cor(XY, method = "kendall")[1, 2]  # Kendall's correlation
SC <- subcopem(XY, display = TRUE)
str(SC)

[Package subcopem2D version 1.3 Index]