Description Usage Arguments Details Value Author(s) References Examples
This function implements the cross-covariance function used in Peruzzi and Dunson (2021), which is derived from eq. 7 in Apanasovich and Genton (2010).
1 2 | CrossCovarianceAG10(coords1, mv1, coords2, mv2,
ai1, ai2, phi_i, thetamv, Dmat)
|
coords1 |
matrix with spatial coordinates |
mv1 |
integer vector with variable IDs. The length must match the number of rows in |
coords2 |
matrix with spatial coordinates |
mv2 |
integer vector with variable IDs. The length must match the number of rows in |
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}. |
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.
The cross-covariance matrix for all pairwise locations.
Michele Peruzzi michele.peruzzi@duke.edu
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
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)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.