nsCrossdist {BayesNSGP} | R Documentation |
Calculate coordinate-specific cross-distance matrices
Description
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.
Usage
nsCrossdist(coords, Pcoords, scale_factor = NULL, isotropic = FALSE)
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 ( |
Value
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. |
Examples
# Generate some coordinates
coords <- cbind(runif(100),runif(100))
Pcoords <- cbind(runif(200),runif(200))
# Calculate distances
Xdist_list <- nsCrossdist(coords, Pcoords)