dependence: Dependence Measures

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

Description

Calculation of pairwise monotone and supremum dependence, monotone/supremum dependence ratio, and proportion of pairwise NAs.

Usage

1
dependence(mat, cont = NULL, sc.order = 0)

Arguments

mat

k-column matrix with n observations of a k-dimensional random vector (NA values are allowed).

cont

vector of column numbers to consider/coerce as continuous random variables (optional).

sc.order

order of subcopula approximation (continuous random variables). If 0 (default) then maximum order m = n is used. Often m = 50 is a good recommended value, higher values demand more computing time.

Details

Each of the random variables in the k-dimensional random vector under consideration may be of any kind (discrete, continuous, or mixed). NA values are allowed.

Value

A 3-dimensional array k\times k\times 4 with pairwise monotone and supremum dependence, monotone/supremum dependence ratio, and proportion of pairwise NAs.

Note

NA values are allowed.

Author(s)

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

References

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

subcopem, subcopemc

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
V <- runif(300)  # Continuous Uniform(0,1)
W <- V*(1-V)     # Continuous transform of V
# X given V=v as continuous Uniform(0,v)
X <- mapply(runif, rep(1, length(V)), rep(0, length(V)), V)
Y <- 1*(0.2 < X)*(X < 0.6)  # Discrete transform of X
Z <- X*(0.1 < X)*(X < 0.9) + 1*(X >= 0.9)  # Mixed transform of X
V[1:10] <- NA  # Introducing some NAs
W[3:12] <- NA  # Introducing some NAs
Y[5:25] <- NA  # Introducing some NAs
vector5D <- cbind(V, W, X, Y, Z)  # Matrix of 5-variate observations
# Monotone and supremum dependence, ratio and proportion of NAs:
(deparray <- dependence(vector5D, cont = c(1, 2, 3), 30))
# Pearson's correlations:
cor(vector5D, method = "pearson", use = "pairwise.complete.obs")
# Spearman's correlations:
cor(vector5D, method = "spearman", use = "pairwise.complete.obs") 
# Kendall's correlations:
cor(vector5D, method = "kendall", use = "pairwise.complete.obs")   
pairs(vector5D)  # Matrix of pairwise scatterplots

Example output

, , depMon

             V            W         X         Y         Z
V 1.000000e+00 5.551115e-17 0.5793103 0.3314482 0.5934364
W 5.551115e-17 1.000000e+00 0.1993817 0.2788336 0.1948633
X 5.793103e-01 1.993817e-01 1.0000000 0.6923077 1.0000000
Y 3.314482e-01 2.788336e-01 0.6923077 1.0000000 0.6923077
Z 5.934364e-01 1.948633e-01 1.0000000 0.6923077 1.0000000

, , depSup

          V         W         X         Y         Z
V 1.0000000 0.4975887 0.5793103 0.3782435 0.5976219
W 0.4975887 1.0000000 0.3428300 0.2907383 0.3535315
X 0.5793103 0.3428300 1.0000000 0.8461538 1.0000000
Y 0.3782435 0.2907383 0.8461538 1.0000000 0.8461538
Z 0.5976219 0.3535315 1.0000000 0.8461538 1.0000000

, , depMonSupRatio

             V            W         X         Y         Z
V           NA 1.115603e-16 1.0000000 0.8762826 0.9929964
W 1.115603e-16           NA 0.5815760 0.9590533 0.5511906
X 1.000000e+00 5.815760e-01        NA 0.8181818 1.0000000
Y 8.762826e-01 9.590533e-01 0.8181818        NA 0.8181818
Z 9.929964e-01 5.511906e-01 1.0000000 0.8181818        NA

, , propNAs

           V          W          X          Y          Z
V 0.03333333 0.04000000 0.03333333 0.08333333 0.03333333
W 0.04000000 0.03333333 0.03333333 0.07666667 0.03333333
X 0.03333333 0.03333333 0.00000000 0.07000000 0.00000000
Y 0.08333333 0.07666667 0.07000000 0.07000000 0.07000000
Z 0.03333333 0.03333333 0.00000000 0.07000000 0.00000000

            V           W           X         Y           Z
V  1.00000000 -0.02039053  0.65523740 0.3257470  0.64817063
W -0.02039053  1.00000000 -0.05186098 0.2627769 -0.03627899
X  0.65523740 -0.05186098  1.00000000 0.3773029  0.99508160
Y  0.32574699  0.26277695  0.37730288 1.0000000  0.40501302
Z  0.64817063 -0.03627899  0.99508160 0.4050130  1.00000000
            V           W         X         Y          Z
V  1.00000000 -0.05189709 0.6660512 0.3213498 0.64400036
W -0.05189709  1.00000000 0.1255936 0.2619985 0.09528037
X  0.66605122  0.12559360 1.0000000 0.5860006 0.98348116
Y  0.32134981  0.26199853 0.5860006 1.0000000 0.59608940
Z  0.64400036  0.09528037 0.9834812 0.5960894 1.00000000
           V           W          X         Y         Z
V  1.0000000 -0.06102400 0.50211192 0.2628576 0.4978540
W -0.0610240  1.00000000 0.09390288 0.2143067 0.0695476
X  0.5021119  0.09390288 1.00000000 0.4793242 0.9478015
Y  0.2628576  0.21430670 0.47932419 1.0000000 0.5061731
Z  0.4978540  0.06954760 0.94780154 0.5061731 1.0000000

subcopem2D documentation built on May 2, 2019, 2:46 p.m.