dist4cov {frechet}R Documentation

Distance between covariance matrices

Description

Distance computation between two covariance matrices

Usage

dist4cov(A = NULL, B = NULL, optns = list())

Arguments

A

an p by p matrix

B

an p by p matrix

optns

A list of options control parameters specified by list(name=value). See ‘Details’.

Details

Available control options are

metric

Metric type choice, "frobenius", "power", "log_cholesky" and "cholesky" - default: "frobenius", which corresponds to the power metric with alpha equal to 1.

alpha

The power parameter for the power metric, which can be any non-negative number. Default is 1 which corresponds to Frobenius metric.

Value

A list containing the following fields:

dist

the distance between covariance matrices A and B.

optns

A list containing the optns parameters utilized.

References

Examples

# M input as array
m <- 5 # dimension of covariance matrices
M <- array(0,c(m,m,2))
for (i in 1:2) {
 y0 <- rnorm(m)
 aux <- diag(m) + y0 %*% t(y0)
 M[,,i] <- aux
}
A <- M[,,1]
B <- M[,,2]
frobDist <- dist4cov(A=A, B=B, optns=list(metric="frobenius"))

[Package frechet version 0.3.0 Index]