View source: R/BRISC_correlation.R
BRISC_correlation | R Documentation |
The function BRISC_correlation
creates correlated data (known structure) using Nearest Neighbor
Gaussian Processes (NNGP). BRISC_correlation
uses the sparse Cholesky representation of Vecchia’s
likelihood developed in Datta et al., 2016. Some code blocks are borrowed from the R package: spNNGP:
Spatial Regression Models for Large Datasets using Nearest Neighbor Gaussian Processes
https://CRAN.R-project.org/package=spNNGP .
BRISC_correlation(coords, sim, sigma.sq = 1, tau.sq = 0, phi = 1, nu = 1.5, n.neighbors = NULL, n_omp = 1, cov.model = "exponential", search.type = "tree", stabilization = NULL, verbose = TRUE, tol = 12)
coords |
an n x 2 matrix of the observation coordinates in R^2 (e.g., easting and northing). |
sim |
an n x k matrix of the k many n x 1 vectors from which the correlated data are calculated (see Details below). |
sigma.sq |
value of sigma square. Default value is 1. |
tau.sq |
value of tau square. Default value is 0.1. |
phi |
value of phi. Default value is 1. |
nu |
value of nu, only required for matern covariance model. Default value is 1.5. |
n.neighbors |
number of neighbors used in the NNGP. Default value is max(100, n -1). We suggest a high value of
|
n_omp |
number of threads to be used, value can be more than 1 if source code is compiled with OpenMP support. Default is 1. |
cov.model |
keyword that specifies the covariance function to be used in modelling the spatial dependence structure
among the observations. Supported keywords are: |
search.type |
keyword that specifies type of nearest neighbor search algorithm to be used. Supported keywords are:
|
stabilization |
when we use a very smooth covarince model (lower values of phi for spherical and Gaussian
covariance and low phi and high nu for Matern covarinace) in absence of a non-negligble nugget, the correlation process may fail
due to computational instability. If |
verbose |
if |
tol |
the input observation coordinates are rounded to this many places after the decimal. The default value is 12. |
Denote g be the input sim
. Let Σ be the precision matrix associated with the covariance model determined by the cov.model and model parameters. Then BRISC_correlation
calculates h, where h is given as follows:
S ^{-0.5} h = g
where, S ^{-0.5} is a sparse approximation of the cholesky factor Σ ^{-0.5} of the precision matrix Σ ^{-1}, obtained from NNGP.
A list comprising of the following:
coords |
the matrix |
n.neighbors |
the used value of |
cov.model |
the used covariance model. |
Theta |
parameters of covarinace model; accounts for |
input.data |
the matrix |
output.data |
the output matrix h in Details. |
time |
time (in seconds) required after preprocessing data in R, |
Arkajyoti Saha arkajyotisaha93@gmail.com,
Abhirup Datta abhidatta@jhu.edu
Datta, A., S. Banerjee, A.O. Finley, and A.E. Gelfand. (2016) Hierarchical Nearest-Neighbor Gaussian process models for large geostatistical datasets. Journal of the American Statistical Association, 111:800-812.
Andrew Finley, Abhirup Datta and Sudipto Banerjee (2017). spNNGP: Spatial Regression Models for Large Datasets using Nearest Neighbor Gaussian Processes. R package version 0.1.1. https://CRAN.R-project.org/package=spNNGP
set.seed(1) n <- 1000 coords <- cbind(runif(n,0,1), runif(n,0,1)) sigma.sq = 1 phi = 1 set.seed(1) sim <- matrix(rnorm(3*n),n, 3) correlation_result <- BRISC_correlation(coords, sigma.sq = sigma.sq, phi = phi, sim = sim)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.