R/pdcor.R

Defines functions pdcov pdcor

Documented in pdcor pdcov

## pdcor.R
##
##

pdcor <- function(x, y, z) {
    if (!inherits(x, "dist")) x <- dist(x)
    if (!inherits(y, "dist")) y <- dist(y)
    if (!inherits(z, "dist")) z <- dist(z)
    x <- as.matrix(x)
    y <- as.matrix(y)
    z <- as.matrix(z)
    partial_dcor(x, y, z)["pdcor"]
}

pdcov <- function(x, y, z) {
    if (!inherits(x, "dist")) x <- dist(x)
    if (!inherits(y, "dist")) y <- dist(y)
    if (!inherits(z, "dist")) z <- dist(z)
    x <- as.matrix(x)
    y <- as.matrix(y)
    z <- as.matrix(z)
    partial_dcov(x, y, z)
}

Try the energy package in your browser

Any scripts or data that you put into this service are public.

energy documentation built on Feb. 22, 2021, 5:08 p.m.