nsCrossdist calculates coordinate-specific cross distances in x, y,
and x-y for use in the nonstationary cross-correlation calculation. This
function is useful for calculating posterior predictions.
A list of distances matrices, with the following components:
dist1_sq
M x N matrix; contains values of pairwise squared cross-
distances in the x-coordinate.
dist2_sq
M x N matrix; contains values of pairwise squared cross-
distances in the y-coordinate.
dist12
M x N matrix; contains values of pairwise signed cross-
distances between the x- and y-coordinates.
scale_factor
Value of the scale factor used to rescale distances.
Arguments
coords
N x 2 matrix; contains x-y coordinates of station (observed)
locations.
Pcoords
M x 2 matrix; contains x-y coordinates of prediction
locations.
scale_factor
Scalar; optional argument for re-scaling the distances.
isotropic
Logical; indicates whether distances should be calculated
using Euclidean distance (isotropic = TRUE) or using the anisotropic
formulation (isotropic = FALSE).