calculateU_ns: Calculate the (sparse) matrix U

Description Usage Arguments Value

Description

calculateU_ns calculates the (sparse) matrix U (i.e., the Cholesky of the inverse covariance matrix) using a nonstationary covariance function. The output only contains non-zero values and is stored as three vectors: (1) the row indices, (2) the column indices, and (3) the non-zero values. NOTE: this code assumes the all inputs correspond to the ORDERED locations.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
calculateU_ns(
  dist1_3d,
  dist2_3d,
  dist12_3d,
  Sigma11,
  Sigma22,
  Sigma12,
  log_sigma_vec,
  log_tau_vec,
  nu,
  nID,
  cond_on_y,
  N,
  k,
  d,
  M = 0
)

Arguments

dist1_3d

N x (k+1) x (k+1) array of distances in the x-coordinate direction.

dist2_3d

N x (k+1) x (k+1) array of distances in the y-coordinate direction.

dist12_3d

N x (k+1) x (k+1) array of cross-distances.

Sigma11

N-vector; 1-1 element of the Sigma() process.

Sigma22

N-vector; 2-2 element of the Sigma() process.

Sigma12

N-vector; 1-2 element of the Sigma() process.

log_sigma_vec

N-vector; process standard deviation values.

log_tau_vec

N-vector; nugget standard deviation values.

nu

Scalar; Matern smoothness parameter.

nID

N x k matrix of (ordered) neighbor indices.

cond_on_y

A matrix indicating whether the conditioning set for each (ordered) location is on the latent process (y, 1) or the observed values (z, 0). Calculated in sgvSetup.

N

Scalar; number of data measurements.

k

Scalar; number of nearest neighbors.

d

Scalar; dimension of the spatial domain.

M

Scalar; number of prediction sites.

Value

Returns a sparse matrix representation of the Cholesky of the precision matrix for a fixed set of covariance parameters.


BayesNSGP documentation built on Jan. 9, 2022, 9:07 a.m.