R/pdcor.R

Defines functions pdcov pdcor

Documented in pdcor pdcov

## pdcor.R
##
##

pdcor <- function(x, y, z) {
    if (!(class(x) == "dist")) x <- dist(x)
    if (!(class(y) == "dist")) y <- dist(y)
    if (!(class(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 (!(class(x) == "dist")) x <- dist(x)
    if (!(class(y) == "dist")) y <- dist(y)
    if (!(class(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 May 28, 2018, 1:04 a.m.