Computed the Euclidian distance matrix between to sets of points.
crossDist(coord1, coord2 = coord1)
Matrices with the coordinates of locations, between which distances are to be computed.
A dim(coord1)[1]
-by-dim(coord2)[1]
distance
matrix.
Other basic linear algebra: blockMult
,
dotProd
, invCholBlock
,
makeCholBlock
, norm2
,
solveTriBlock
, sumLog
,
sumLogDiag
Other covariance functions: evalCovFuns
,
makeSigmaB
, makeSigmaNu
,
namesCovFuns
, parsCovFuns
,
updateCovf
# NOT RUN {
##First create some random locations
x <- rnorm(5)
y <- rnorm(5)
##compute distance matrix
D <- crossDist( cbind(x,y) )
##or distance between different locations
X <- matrix(rnorm(6),3,2)
Y <- rbind(X, matrix(rnorm(8),4,2))
Dcross <- crossDist(X, Y)
##or distances between coordinates in R3
C1 <- matrix(rnorm(9),3,3)
C2 <- matrix(rnorm(12),4,3)
Dcross.R3 <- crossDist(C1, C2)
# }
# NOT RUN {
# }
Run the code above in your browser using DataLab