allCorrelations {MatrixCorrelation}R Documentation

All correlations

Description

Compare all correlation measures in the package (or a subset)

Usage

allCorrelations(
  X1,
  X2,
  ncomp1,
  ncomp2,
  methods = c("SMI", "RV", "RV2", "RVadj", "PSI", "r1", "r2", "r3", "r4", "GCD"),
  digits = 3,
  plot = TRUE,
  xlab = "",
  ylab = "",
  ...
)

Arguments

X1

first matrix to be compared (data.frames are also accepted).

X2

second matrix to be compared (data.frames are also accepted).

ncomp1

maximum number of subspace components from the first matrix.

ncomp2

maximum number of subspace components from the second matrix.

methods

character vector containing a subset of the supported methods: "SMI", "RV", "RV2", "RVadj", "PSI", "r1", "r2", "r3", "r4", "GCD".

digits

number of digits for numerical output.

plot

logical indicating if plotting should be performed (default = TRUE).

xlab

optional x axis label.

ylab

optional y axis label.

...

additional arguments for SMI or plot.

Details

For each of the coefficients a single scalar is computed to describe the similarity between the two input matrices. Note that some methods requires setting one or two numbers of components.

Value

A single value measuring the similarity of two matrices.

Author(s)

Kristian Hovde Liland

References

See Also

SMI, RV (RV2/RVadj), r1 (r2/r3/r4/GCD).

Examples

X1  <- scale( matrix( rnorm(100*300), 100,300), scale = FALSE)
usv <- svd(X1)
# Remove third principal component from X1 to produce X2
X2  <- usv$u[,-3] %*% diag(usv$d[-3]) %*% t(usv$v[,-3])

allCorrelations(X1,X2, ncomp1 = 5,ncomp2 = 5)


[Package MatrixCorrelation version 0.10.0 Index]