Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

MatrixDistance

Matrix distance


Description

Calculates Distances between covariance matrices.

Usage

MatrixDistance(cov.x, cov.y, distance, ...)

## Default S3 method:
MatrixDistance(cov.x, cov.y, distance = c("OverlapDist", "RiemannDist"), ...)

## S3 method for class 'list'
MatrixDistance(
  cov.x,
  cov.y = NULL,
  distance = c("OverlapDist", "RiemannDist"),
  ...,
  parallel = FALSE
)

Arguments

cov.x

Single covariance matrix or list of covariance matrices. If single matrix is suplied, it is compared to cov.y. If list is suplied and no cov.y is suplied, all matrices are compared. If cov.y is suplied, all matrices in list are compared to it.

cov.y

First argument is compared to cov.y. Optional if cov.x is a list.

distance

distance function for use in calculation. Currently supports "Riemann" and "Overlap".

...

aditional arguments passed to other methods

parallel

if TRUE and a list is passed, computations are done in parallel. Some foreach backend must be registered, like doParallel or doMC.

Value

If cov.x and cov.y are passed, returns distance between them.

If is a list cov.x and cov.y are passed, same as above, but for all matrices in cov.x.

If only a list is passed to cov.x, a matrix of Distances is returned

Author(s)

Diogo Melo

See Also

Examples

c1 <- RandomMatrix(10)
c2 <- RandomMatrix(10)
c3 <- RandomMatrix(10)
MatrixDistance(c1, c2, "OverlapDist")
MatrixDistance(c1, c2, "RiemannDist")
## Not run: 
MatrixDistance(list(c1, c2, c3), distance = "OverlapDist")


c4 <- RandomMatrix(10)
MatrixDistance(list(c1, c2, c3), c4)

## End(Not run)

evolqg

Tools for Evolutionary Quantitative Genetics

v0.2-8
MIT + file LICENSE
Authors
Ana Paula Assis, Diogo Melo, Edgar Zanella, Fabio Andrade Machado, Guilherme Garcia
Initial release
2020-11-14

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.