CrossCovarianceAG10: Multivariate non-separable cross-covariance function on...

Description Usage Arguments Details Value Author(s) References Examples

View source: R/RcppExports.R

Description

This function implements the cross-covariance function used in Peruzzi and Dunson (2021), which is derived from eq. 7 in Apanasovich and Genton (2010).

Usage

1
2
CrossCovarianceAG10(coords1, mv1, coords2, mv2, 
                    ai1, ai2, phi_i, thetamv, Dmat)

Arguments

coords1

matrix with spatial coordinates

mv1

integer vector with variable IDs. The length must match the number of rows in coords1

coords2

matrix with spatial coordinates

mv2

integer vector with variable IDs. The length must match the number of rows in coords2

ai1

q-dimensional vector

ai2

q-dimensional vector

phi_i

q-dimensional vector

thetamv

for bivariate data (q=2), this is a scalar. For q>2, this is a vector with elements α, β, φ.

Dmat

symmetric matrix of dimension (q, q) with zeroes on the diagonal and whose (i,j) element is δ_{i,j}.

Details

Suppose we have q variables. For h>0 and Δ > 0 define:

C(h, Δ) = \frac{ \exp \{ -φ \|h \| / \exp \{β \log(1+α Δ)/2 \} \} }{ \exp \{ β \log(1 + α Δ) \} }

and for j=1, …, q, define C_j(h) = \exp \{ -φ_j \|h \| \}.

Then the cross-covariance between the ith margin of a q-variate process w(\cdot) at spatial location s and the jth margin at location s' is built as follows. For i = j as

Cov(w(s, ξ_i), w(s', ξ_j)) = σ_{i1}^2 C(h, 0) + σ_{i2}^2 C_i(h) ,

whereas if i \neq j it is defined as

Cov(w(s, ξ_i), w(s', ξ_j)) = σ_{i1} σ_{i2} C(h, δ_{ij}),

where ξ_i and ξ_j are the latent locations of margin i and j in the domain of variables and δ_{ij} = \| ξ_i - ξ_j \| is their distance in such domain.

Value

The cross-covariance matrix for all pairwise locations.

Author(s)

Michele Peruzzi michele.peruzzi@duke.edu

References

Apanasovich, T. V. and Genton, M. G. (2010) Cross-covariance functions for multivariate random fields based on latent dimensions. Biometrika, 97:15-30. doi: 10.1093/biomet/asp078

Peruzzi, M. and Dunson, D. B. (2021) Spatial Multivariate Trees for Big Data Bayesian Regression. https://arxiv.org/abs/2012.00943

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
library(magrittr)
library(dplyr)
library(spamtree)

SS <- 10
xlocs <- seq(0.0, 1, length.out=SS)
coords <- expand.grid(xlocs, xlocs)
c1 <- coords %>% mutate(mv_id=1)
c2 <- coords %>% mutate(mv_id=2)

coords <- bind_rows(c1, c2)
coords_q <- coords %>% dplyr::select(-mv_id)
cx <- coords_q %>% as.matrix()
mv_id <- coords$mv_id

ai1 <- c(1, 1.5)
ai2 <- c(.1, .51)
phi_i <- c(1, 2)
thetamv <- 5

q <- 2
Dmat <- matrix(0, q, q)
Dmat[2,1] <- 1
Dmat[upper.tri(Dmat)] <- Dmat[lower.tri(Dmat)]

CC <- CrossCovarianceAG10(cx, mv_id, cx, mv_id, ai1, ai2, phi_i, thetamv, Dmat)

spamtree documentation built on June 9, 2021, 9:08 a.m.