Description Usage Arguments Details Value Author(s) References See Also Examples
Apply Monte Carlo permutation on the data values over different locations, and compute the variogram estimates for each permutation. The pointwise variogram envelope is taken based on quantiles of variogram estimates at each distance binning.
1 2 3 4 5 6 7 8 9 | ## S3 method for class 'gstatVariogram'
envelope(vario, data, locations = coordinates(data),
formula = NULL, cluster = FALSE, n.cluster = NULL,
nsim = 999, conf.level = 0.95, save.sim = FALSE, ...)
## S3 method for class 'variogram'
envelope(vario, data, locations = data$coords,
trend = NULL, cluster = FALSE, n.cluster = NULL,
nsim = 999, conf.level = 0.95, save.sim = FALSE, ...)
|
vario |
variogram of class |
data |
an object of class |
locations |
matrix. Contains x-coordinates in the first column and y-coordinates in the second column. |
formula |
only works with |
trend |
only works with |
cluster |
logical. If |
n.cluster |
integer. The number of clusters used in the permutation. Only used when |
nsim |
integer. The number of permutations conducted to compute the envelope. The default is 999. |
conf.level |
confidence level of the envelope. The default is 0.95. |
save.sim |
logical. If |
... |
any other arguments that will be passed to variogram computation using either |
There are two possible permutation methods implemented. If cluster = FALSE
, complete spatial randomness is assumed and values are permuted over all locations. If cluster = TRUE
, spatial dependence at small scales is assumed and and values are permuted only within clusters which are determined using kmeans clustering over spatial locations. When the interest is about the existence of spatial dependence at small scales, cluster = TRUE
is preferred to acheive a higher statistical power.
A list with the following elements:
data |
contains a list of all permutated data, only exists if |
variogram |
the original variogram estimates and estimates from each of the permutations |
upper |
upper quantile of the variogram estimates according to the confidence level |
lower |
lower quantile of the variogram estimates according to the confidence level |
data.values |
the values used for variogram estimation, namely the residuals after removing covariates' effect |
variogram0 |
the original variogram supplied via |
Craig Wang, Reinhard Furrer
Diggle, P.J., Ribeiro, P.J. (2007), Model-Based Geostatistics, Springer Series in Statistics. Springer.
Wang, C., Furrer, R. (2018) Monte Carlo Permutation Tests for Assessing Spatial Dependence at Difference Scales. Nonparametric Statistics. (Submitted)
envplot
to plot an empirical variogram based on the data and its envelope
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 | ## Not run:
library(sp)
data(meuse)
## for gstat variogram
library(gstat)
data(meuse)
coordinates(meuse) = ~x+y
vario0 <- gstat::variogram(log(zinc)~1, meuse)
varioEnv <- envelope(vario0, data = meuse,
formula = log(zinc)~1, nsim = 499, cluster = TRUE, n.cluster = 10)
## for geoR variog
library(geoR)
data(meuse)
meuse <- as.geodata(meuse, coords.col = 1:2, data.col = 6, covar.col = 3:5)
meuse$data <- log(meuse$data)
vario0 <- variog(meuse,max.dist=1500)
varioEnv <- envelope(vario0, data = meuse,
trend = trend.spatial(~lead, meuse), nsim = 499)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.