Title: | Directed Dependence Coefficient |
---|---|
Description: | Directed Dependence Coefficient (didec) is a measure of directed dependence. Multivariate Feature Ordering by Conditional Independence (MFOCI) is a variable selection algorithm based on didec. Hierarchical Variable Clustering (VarClustPartition) is a variable clustering method based on didec. For more information, see the paper by Ansari and Fuchs (2024, <doi:10.48550/arXiv.2212.01621>), and the paper by Fuchs and Wang (2024, <doi:10.1016/j.ijar.2024.109185>). |
Authors: | Yuping Wang [aut, cre], Sebastian Fuchs [aut], Jonathan Ansari [aut] |
Maintainer: | Yuping Wang <[email protected]> |
License: | MIT + file LICENSE |
Version: | 0.1.0 |
Built: | 2025-03-03 04:50:08 UTC |
Source: | https://github.com/cran/didec |
A data set of bioclimatic variables for locations homogeneously distributed over the global landmass from CHELSA("Climatologies at high resolution for the earth’s land surface areas").
bioclimatic
bioclimatic
An object of class data.frame
with 1862 rows and 14 columns.
D.N. Karger, O. Conrad, J. Böhner, T. Kawohl, H. Kreft, R.W. Soria-Auza, N.E. Zimmermann, H.P. Linder, M. Kessler, Climatologies at high resolution for the Earth's land surface areas, Sci. Data 4(1), 2017.
head(bioclimatic)
head(bioclimatic)
The directed dependence coefficient (didec
) estimates the degree of directed dependence of a random vector Y on a random vector X, based on an i.i.d. sample of (X,Y).
didec(X, Y, perm = FALSE, perm.method = c("decreasing"))
didec(X, Y, perm = FALSE, perm.method = c("decreasing"))
X |
A numeric matrix or data.frame/data.table. Contains the predictor vector X. |
Y |
A numeric matrix or data.frame/data.table. Contains the response vector Y. |
perm |
A logical. If |
perm.method |
An optional character string specifying a method for permuting the response variables. This must be one of the strings |
The directed dependence coefficient (didec) is an extension of Azadkia & Chatterjee's measure of directed dependence (Azadkia & Chatterjee, 2021) to a vector of response variables introduced in (Ansari & Fuchs, 2023).
Its calculation is based on the function codec
which estimates Azadkia & Chatterjee’s measure of directed dependence and is provided in the R package FOCI
.
By definition, didec
is invariant with respect to permutations of the variables within the predictor vector X. Invariance with respect to permutations within the response vector Y is achieved by computing the arithmetic mean over all possible (or chosen) permutations.
In addition to the option "full"
of running all permutations of
, less computationally intensive options are also available (here,
denotes the number of response variables): a random selection of
permutations
"sample"
, cyclic permutations such as ,
either
"increasing"
or "decreasing"
.
Note that when the number of variables is large, choosing
"full"
may result in long computation times.
The degree of directed dependence of the random vector Y on the random vector X.
Yuping Wang, Sebastian Fuchs, Jonathan Ansari
M. Azadkia, S. Chatterjee, A simple measure of conditional dependence, Ann. Stat. 49 (6), 2021.
J. Ansari, S. Fuchs, A simple extension of Azadkia & Chatterjee's rank correlation to multi-response vectors, Available at https://arxiv.org/abs/2212.01621, 2024.
A variable selection algorithm based on the directed dependence coefficient (didec
).
mfoci( X, Y, pre.selected = NULL, perm = FALSE, perm.method = c("decreasing"), autostop = TRUE )
mfoci( X, Y, pre.selected = NULL, perm = FALSE, perm.method = c("decreasing"), autostop = TRUE )
X |
A numeric matrix or data.frame/data.table. Contains the predictor vector X. |
Y |
A numeric matrix or data.frame/data.table. Contains the response vector Y. |
pre.selected |
An integer vector for indexing pre-selected predictor variables from X. |
perm |
A logical. If |
perm.method |
An optional character string specifying a method in |
autostop |
A logical. If |
mfoci
is a forward feature selection algorithm for multiple-outcome data that employs the directed dependence coefficient (didec
) at each step.
mfoci
is proved to be consistent in the sense that the subset of predictor variables selected via mfoci
is sufficient with high probability.
If autostop == TRUE
the algorithm stops at the first non-increasing value of didec
, thereby selecting a subset of variables.
Otherwise, all predictor variables are ordered according to their predictive strength measured by didec
.
A data.frame listing the selected variables.
Sebastian Fuchs, Jonathan Ansari, Yuping Wang
J. Ansari, S. Fuchs, A simple extension of Azadkia & Chatterjee's rank correlation to multi-response vectors, Available at https://arxiv.org/abs/2212.01621, 2024.
library(didec) data("bioclimatic") X <- bioclimatic[, c(9:12)] Y <- bioclimatic[, c(1,8)] mfoci(X, Y, pre.selected = c(1, 3))
library(didec) data("bioclimatic") X <- bioclimatic[, c(9:12)] Y <- bioclimatic[, c(1,8)] mfoci(X, Y, pre.selected = c(1, 3))
VarClustPartition
is a hierarchical variable clustering algorithm based on the directed dependence coefficient (didec
) or a concordance measure (Kendall tau or Spearman's footrule) according to a pre-selected number of clusters or an optimality criterion (Adiam&Msplit or Silhouette coefficient).
VarClustPartition( X, dist.method = c("PD"), linkage = FALSE, link.method = c("complete"), part.method = c("optimal"), criterion = c("Adiam&Msplit"), num.cluster = NULL, plot = FALSE )
VarClustPartition( X, dist.method = c("PD"), linkage = FALSE, link.method = c("complete"), part.method = c("optimal"), criterion = c("Adiam&Msplit"), num.cluster = NULL, plot = FALSE )
X |
A numeric matrix or data.frame/data.table. Contains the variables to be clustered. |
dist.method |
An optional character string computing a distance function for clustering. This must be one of the strings |
linkage |
A logical. If |
link.method |
An optional character string selecting a linkage method. This must be one of the strings |
part.method |
An optional character string selecting a partitioning method. This must be one of the strings |
criterion |
An optional character string selecting a criterion for the optimal partition, if |
num.cluster |
An integer value for the selected number of clusters, if |
plot |
A logical. If |
VarClustPartition
performs a hierarchical variable clustering based on the directed dependence coefficient (didec
) and provides a partition of the set of variables.
If dist.method =="PD"
or dist.method =="MPD"
, the clustering is performed using didec
either as a directed ("PD") or as a symmetric ("MPD") dependence coefficient.
If dist.method =="kendall"
or dist.method =="footrule"
, clustering is performed using either multivariate Kendall's tau ("kendall") or multivariate Spearman's footrule ("footrule").
Instead of using one of the above-mentioned four multivariate measures for the clustering, the option linkage == TRUE
enables the use of bivariate linkage methods,
including complete linkage (link.method == "complete"
), average linkage (link.method == "average"
) and single linkage (link.method == "single"
).
Note that the multivariate distance methods are computationally demanding because higher-dimensional dependencies are included in the calculation, in contrast to linkage methods which only incorporate pairwise dependencies.
A pre-selected number of clusters num.cluster
can be realized with the option part.method == "selected"
.
Otherwise (part.method == "optimal"
), the number of clusters is determined by maximizing the intra-cluster similarity (similarity within the same cluster) and minimizing the inter-cluster similarity (similarity among the clusters). Two optimality criteria are available:
"Adiam&Msplit"
: Adiam measures the intra-cluster similarity and Msplit measures the inter-cluster similarity.
"Silhouette"
: A mixed coefficient incorporating the intra-cluster similarity and the inter-cluster similarity. The optimal number of clusters corresponds to the maximum Silhouette coefficient.
A list containing a dendrogram without colored branches (dendrogram), an integer value determining the number of clusters after partitioning (num.cluster), and a list containing the clusters after partitioning (clusters).
Yuping Wang, Sebastian Fuchs
S. Fuchs, Y. Wang, Hierarchical variable clustering based on the predictive strength between random vectors, Int. J. Approx. Reason. 170, Article ID 109185, 2024.
P. Hansen, B. Jaumard, Cluster analysis and mathematical programming, Math. Program. 79 (1) 191–215, 1997.
L. Kaufman, Finding Groups in Data, John Wiley & Sons, 1990.
library(didec) n <- 50 X1 <- rnorm(n,0,1) X2 <- X1 X3 <- rnorm(n,0,1) X4 <- X3 + X2 X <- data.frame(X1=X1,X2=X2,X3=X3,X4=X4) vcp <- VarClustPartition(X, dist.method = c("PD"), part.method = c("optimal"), criterion = c("Silhouette"), plot = TRUE) vcp$clusters data("bioclimatic") X <- bioclimatic[c(2:4,9)] vcp1 <- VarClustPartition(X, linkage = TRUE, link.method = c("complete"), dist.method = "PD", part.method = "optimal", criterion = "Silhouette", plot = TRUE) vcp1$clusters vcp2 <- VarClustPartition(X, linkage = TRUE, link.method = c("complete"), dist.method = "footrule", part.method = "optimal", criterion = "Adiam&Msplit", plot = TRUE) vcp2$clusters
library(didec) n <- 50 X1 <- rnorm(n,0,1) X2 <- X1 X3 <- rnorm(n,0,1) X4 <- X3 + X2 X <- data.frame(X1=X1,X2=X2,X3=X3,X4=X4) vcp <- VarClustPartition(X, dist.method = c("PD"), part.method = c("optimal"), criterion = c("Silhouette"), plot = TRUE) vcp$clusters data("bioclimatic") X <- bioclimatic[c(2:4,9)] vcp1 <- VarClustPartition(X, linkage = TRUE, link.method = c("complete"), dist.method = "PD", part.method = "optimal", criterion = "Silhouette", plot = TRUE) vcp1$clusters vcp2 <- VarClustPartition(X, linkage = TRUE, link.method = c("complete"), dist.method = "footrule", part.method = "optimal", criterion = "Adiam&Msplit", plot = TRUE) vcp2$clusters