Learn R Programming

edmcr (version 0.2.0)

edm2gram: Linear Matrix Operator

Description

edm2gram Linear transformation of a Euclidean Distance Matrix to a Gram Matrix

Usage

edm2gram(D)

Arguments

D

A Euclidean Distance Matrix

Value

G A Gram Matrix, where G = XX', and X is an nxp matrix containing the point configuration.

Details

While we specify that the input should be a Euclidean Distance Matrix (as this results in a Gram Matrix) the domain of edm2gram is the set of all real symmetric matrices. This function is particularly useful as it has the following property:

$$edm2gram(D_{n}^{-}) = B_{n}^{+}$$

where \(D_{n}^{-}\) is the space of symmetric, hollow matrices, negative definite on the space spanned by \(x'e = 0\) and \(B_{n}^{+}\) is the space of centered positive definite matrices.

We can combine these two properties with a well known result: If D is a real symmetric matrix with 0 diagonal (call this matrix pre-EDM), then D is a Euclidean Distance Matrix iff D is negative semi-definite on \(D_{n}^{-}\).

Using this result, combined with the properties of edm2gram we therefore have that D is an EDM iff D is pre-EDM and \(edm2gram{D}\) is positive semi-definite.

Examples

Run this code
# NOT RUN {
 
XY <- cbind(runif(100,0,1),runif(100,0,1))
D <- dist(XY)
edm2gram(as.matrix(D))

# }

Run the code above in your browser using DataLab