crossDist {SpatioTemporal} | R Documentation |
Computed the Euclidian distance matrix between to sets of points.
crossDist(coord1, coord2 = coord1)
coord1, coord2 |
Matrices with the coordinates of locations, between which distances are to be computed. |
A dim(coord1)[1]
-by-dim(coord2)[1]
distance matrix.
Johan Lindstrom
Other covariance functions: evalCovFuns
,
makeSigmaB
, makeSigmaNu
,
namesCovFuns
, parsCovFuns
,
updateCovf
Other basic linear algebra: blockMult
,
makeCholBlock
, norm2
,
sumLogDiag
##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)