dists.2frames {calibrator}R Documentation

Distance between two points

Description

Distance between points specified by rows of two matrices, according to a positive definite matrix. If not specified, the second matrix used is the first.

Usage

dists.2frames(a, b=NULL, A=NULL, A.lower=NULL, test.for.symmetry=TRUE)

Arguments

a

First dataframe whose rows are the points

b

Second dataframe whose rows are the points; if NULL, use a

A

Positive definite matrix; if NULL, a value for A.lower is needed. If a value for A is supplied, use a clear but possibly slower method

A.lower

The lower triangular Cholesky decomposition of A (only needed if A is NULL).

If a value for A.lower is specified, this means that a relatively opaque but possibly faster method will be used. The time saving ought to be negligible unless nrow(a) (or nrow(b) if supplied), is huge. Note that this option does not test for symmetry of matrix A

test.for.symmetry

Boolean, with default TRUE meaning to calculate all element arrays (elegantly), and FALSE meaning to calculate only the upper triangular elements (using loops), which ought to be faster. The value of this argument should not affect the returned value, up to numerical accuracy

Author(s)

Robin K. S. Hankin

References

See Also

dists.2frames

Examples

data(toys)

dists.2frames(a=D2.toy,A=diag(2))

A <- diag(2) + matrix(0.2,2,2)
A.lower <- t(chol(A))
jj.1 <- dists.2frames(a=D2.toy, A=A, test=TRUE)
jj.2 <- dists.2frames(a=D2.toy, A=A, test=FALSE)

jj.3 <- dists.2frames(a=D2.toy, A.lower=A.lower, test=FALSE)
jj.4 <- dists.2frames(a=D2.toy, A.lower=A.lower, test=TRUE)



[Package calibrator version 1.2-8 Index]