| Title: | Fast and Light-Weight Partial Distance Correlation |
|---|---|
| Description: | Fast and memory-less computation of the partial distance correlation for vectors and matrices. Permutation-based and asymptotic hypothesis testing for zero partial distance correlation are also performed. References include: Szekely G. J. and Rizzo M. L. (2014). "Partial distance correlation with methods for dissimilarities". The Annals Statistics, 42(6): 2382--2412. <doi:10.1214/14-AOS1255>. Shen C., Panda S. and Vogelstein J. T. (2022). "The Chi-Square Test of Distance Correlation". Journal of Computational and Graphical Statistics, 31(1): 254--262. <doi:10.1080/10618600.2021.1938585>. Szekely G. J. and Rizzo M. L. (2023). "The Energy of Data and Distance Correlation". Chapman and Hall/CRC. <ISBN:9781482242744>. Kontemeniotis N., Vargiakakis R. and Tsagris M. (2025). On independence testing using the (partial) distance correlation. <doi:10.48550/arXiv.2506.15659>. |
| Authors: | Michail Tsagris [aut, cre], Nikolaos Kontemeniotis [aut] |
| Maintainer: | Michail Tsagris <[email protected]> |
| License: | GPL (>= 2) |
| Version: | 1.3 |
| Built: | 2026-05-25 07:13:30 UTC |
| Source: | https://github.com/cran/pdcor |
Fast and memory-less computation of the partial distance correlation for vectors and matrices. Permutation-based and asymptotic hypothesis testing for zero partial distance correlation are also performed.
| Package: | pdcor | |
| Type: | Package | |
| Version: | 1.3 | |
| Date: | 2026-03-25 | |
| License: | GPL-2 |
Michail Tsagris [email protected].
Michail Tsagris [email protected] and Nikolaos Kontemeniotis [email protected].
Hypothesis testing for many partial distance correlations.
mpdcor.test(y, x, z, R = 500)mpdcor.test(y, x, z, R = 500)
y |
A numerical vector. |
x |
A numerical matrix. |
z |
A numerical vector. |
R |
The number of permutations to implement. If R = 1, the the asymptotic p-value is returned only. |
Hypothesis testing between y and each column of x, conditional on z is performed.
A matrix with three columns: the unbiased partial distance correlation, the permutation based p-value and the asymptotic p-value as proposed by Shen, Panda and Vogelstein (2022).
Michail Tsagris.
R implementation and documentation: Michail Tsagris [email protected].
Szekely G. J. and Rizzo M. L. (2014). Partial Distance Correlation with Methods for Dissimilarities. The Annals of Statistics, 42(6): 2382–2412.
Shen C., Panda S. and Vogelstein J. T. (2022). The Chi-Square Test of Distance Correlation. Journal of Computational and Graphical Statistics, 31(1): 254–262.
Szekely G. J. and Rizzo M. L. (2023). The Energy of Data and Distance Correlation. Chapman and Hall/CRC.
Tsagris M. and Papadakis M. (2025). Fast and light-weight energy statistics using the R package Rfast. https://arxiv.org/abs/2501.02849
Kontemeniotis N., Vargiakakis R. and Tsagris M. (2025). On independence testing using the (partial) distance correlation. https://arxiv.org/abs/2506.15659v1
y <- iris[, 1] x <- matrix( rnorm(150 * 10), ncol = 10 ) z <- iris[, 2] mpdcor.test(y, x, z)y <- iris[, 1] x <- matrix( rnorm(150 * 10), ncol = 10 ) z <- iris[, 2] mpdcor.test(y, x, z)
Hypothesis testing for the partial distance correlation.
pdcor.test(x, y, z, type = 1, R = 500)pdcor.test(x, y, z, type = 1, R = 500)
x |
A numerical vector or matrix. |
y |
A numerical vector or matrix. |
z |
A numerical vector or matrix. |
type |
In case that all x, y, and z are vectors the user may select the type = 2 which is even faster, but at the expense of requiring more memory. |
R |
The number of permutations to implement. If R = 1, the the asymptotic p-value is returned only. |
Hypothesis testing using the unbiased partial distance correlation between x and y conditioning on z is computed. Note: currently, ony two cases are supported, all x, y, and z are vectors or they are all matrices with the same dimensions.
A vector with the unbiased partial distance correlation, the permutation based p-value and the asymptotic p-value as proposed by Shen, Panda and Vogelstein (2022).
Michail Tsagris and Nikolaos Kontemeniotis .
R implementation and documentation: Michail Tsagris [email protected] and Nikolaos Kontemeniotis [email protected].
Szekely G. J. and Rizzo M. L. (2014). Partial Distance Correlation with Methods for Dissimilarities. The Annals of Statistics, 42(6): 2382–2412.
Shen C., Panda S. and Vogelstein J. T. (2022). The Chi-Square Test of Distance Correlation. Journal of Computational and Graphical Statistics, 31(1): 254–262.
Szekely G. J. and Rizzo M. L. (2023). The Energy of Data and Distance Correlation. Chapman and Hall/CRC.
Tsagris M. and Papadakis M. (2025). Fast and light-weight energy statistics using the R package Rfast. https://arxiv.org/abs/2501.02849
Kontemeniotis N., Vargiakakis R. and Tsagris M. (2025). On independence testing using the (partial) distance correlation. https://arxiv.org/abs/2506.15659v1
x <- iris[, 1] y <- iris[, 2] z <- iris[, 3] pdcor.test(x, y, z)x <- iris[, 1] y <- iris[, 2] z <- iris[, 3] pdcor.test(x, y, z)
Many partial distance correlations.
mpdcor(y, x, z)mpdcor(y, x, z)
y |
A numerical vector. |
x |
A numerical matrix. |
z |
A numerical vector. |
This computes the unbiased pdcor between y and each column of x, conditional on the vector z.
A vector with many unbiased partial distance correlations.
Michail Tsagris.
R implementation and documentation: Michail Tsagris [email protected].
Szekely G. J. and Rizzo M. L. (2014). Partial Distance Correlation with Methods for Dissimilarities. The Annals of Statistics, 42(6): 2382–2412.
Szekely G. J. and Rizzo M. L. (2023). The Energy of Data and Distance Correlation. Chapman and Hall/CRC.
Tsagris M. and Papadakis M. (2025). Fast and light-weight energy statistics using the R package Rfast. https://arxiv.org/abs/2501.02849
Kontemeniotis N., Vargiakakis R. and Tsagris M. (2025). On independence testing using the (partial) distance correlation. https://arxiv.org/abs/2506.15659v1
y <- iris[, 1] x <- matrix( rnorm(150 * 10), ncol = 10 ) z <- iris[, 2] mpdcor(y, x, z) pdcor(y, x[, 1], z)y <- iris[, 1] x <- matrix( rnorm(150 * 10), ncol = 10 ) z <- iris[, 2] mpdcor(y, x, z) pdcor(y, x[, 1], z)
Partial distance correlation.
pdcor(x, y, z)pdcor(x, y, z)
x |
A numerical vector or matrix. |
y |
A numerical vector or matrix. |
z |
A numerical vector or matrix. |
The unbiased partial distance correlation between x and y conditioning on z is computed. Note: currently, ony two cases are supported, all x, y, and z are vectors or they are all matrices with the same dimensions.
The unbiased partial distance correlation.
Michail Tsagris.
R implementation and documentation: Michail Tsagris [email protected].
Szekely G. J. and Rizzo M. L. (2014). Partial Distance Correlation with Methods for Dissimilarities. The Annals of Statistics, 42(6): 2382–2412.
Szekely G. J. and Rizzo M. L. (2023). The Energy of Data and Distance Correlation. Chapman and Hall/CRC.
Tsagris M. and Papadakis M. (2025). Fast and light-weight energy statistics using the R package Rfast. https://arxiv.org/abs/2501.02849
Kontemeniotis N., Vargiakakis R. and Tsagris M. (2025). On independence testing using the (partial) distance correlation. https://arxiv.org/abs/2506.15659v1
x <- iris[, 1] y <- iris[, 2] z <- iris[, 3] pdcor(x, y, z)x <- iris[, 1] y <- iris[, 2] z <- iris[, 3] pdcor(x, y, z)