Skip to contents

The \(n - 1\)-denominator covariance matrix, as stats::cov() computes it, extended to case weights when a cwt command is active. tda_corr is its correlation counterpart.

Usage

tda_cov(..., options = list(), dir = tempfile("tda"))

Arguments

...

a data frame, a matrix, or vectors.

options

a named list of further TDA options, passed through.

dir

working directory.

Value

An object carrying matrix, the covariance matrix with the variables' names on both dimensions.

Examples

set.seed(26)
d <- data.frame(x = rnorm(40), y = rnorm(40))
d$y <- d$y + 0.6 * d$x
tda_cov(d)$matrix
#>           x         y
#> x 1.2041370 0.7894007
#> y 0.7894007 1.5212078
cov(d)  # matches
#>           x         y
#> x 1.2041370 0.7894007
#> y 0.7894007 1.5212078