corFamily: Marginal correlation matrix

Description Usage Arguments Details Value Note Author(s)

Description

Various workhorse functions to compute the marginal (or unconditional) correlations (and cross-correlation) estimates efficiently. They are (almost) equivalent implementations of cor in Rcpp, RcppArmadillo, and RcppEigen.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
corRcpp(X)

xcorRcpp(X, Y)

corArma(X)

xcorArma(X, Y)

corEigen(X)

xcorEigen(X, Y)

Arguments

X

A numeric matrix.

Y

A numeric matrix of compatible dimension with the X, i.e. nrow(X) equals nrow(Y).

Details

Functions almost like cor. For the xcorXX functions, the i'th and j'th entry of the output matrix is the correlation between X[i, ] and X[j, ]. Likewise, for the xcorXX functions, the i'th and j'th entry of the output is the correlation between X[i, ] and Y[j, ].

Value

The corXX family returns a numeric correlation matrix of size ncol(X) times ncol(X).

The xcorXX family returns a numeric cross-correlation matrix of size ncol(X) times ncol(Y).

Note

NAs in X or Y will yield NAs in the correlation matrix. This also includes the diagonal unlike the behavior of cor.

Author(s)

Anders Ellern Bilgrau <anders.ellern.bilgrau (at) gmail.com>


AEBilgrau/correlateR documentation built on Nov. 15, 2019, 9:21 a.m.