GeoVariogram {GeoModels} | R Documentation |
Empirical semi-variogram estimation
Description
The function returns an empirical estimate of the semi-variogram for spatio (temporal) and bivariate random fields.
Usage
GeoVariogram(data, coordx, coordy=NULL, coordt=NULL,
coordx_dyn=NULL,cloud=FALSE, distance="Eucl",
grid=FALSE, maxdist=NULL,neighb=NULL,
maxtime=NULL, numbins=NULL,
radius=6371, type='variogram',bivariate=FALSE)
Arguments
data |
A |
coordx |
A numeric ( |
coordy |
A numeric vector assigning 1-dimension of
spatial coordinates; |
coordt |
A numeric vector assigning 1-dimension of
temporal coordinates. Optional argument, the default is |
coordx_dyn |
A list of |
cloud |
Logical; if |
distance |
String; the name of the spatial distance. The default
is |
grid |
Logical; if |
maxdist |
A numeric value denoting the spatial maximum distance, see the Section Details. |
neighb |
Numeric; an optional positive integer indicating the order of neighborhood. See the Section Details for more information. |
maxtime |
A numeric value denoting the temporal maximum distance, see the Section Details. |
numbins |
A numeric value denoting the numbers of bins, see the Section Details. |
radius |
Numeric; a value indicating the radius of the sphere when using the great circle distance. Default value is the radius of the earth in Km (i.e. 6371) |
type |
A String denoting the type of semivariogram. The option
available is : |
bivariate |
Logical; if |
Details
We briefly report the definitions of semi-variogram used for the spatial case. It can be easily extended to the space-time or spatial bivariate case. In the case of a spatial Gaussian random field the sample semivariogram estimator is defined by
\hat{\gamma}(h) = 0.5 \sum_{x_i, x_j \in N(h)} (Z(x_i) - Z(x_j))^2 / |N(h)|
where N(h)
is the set of all the sample pairs whose distances fall into a tolerance region with size h
(equispaced intervalls are considered).
The numbins
parameter indicates the number of adjacent
intervals to consider in order to grouped distances with which to
compute the (weighted) lest squares.
The maxdist
parameter indicates the maximum spatial distance below which
the shorter distances will be considered in the calculation of
the semivariogram.
The maxdist
parameter can be coupled with the neighb
parameter. This is useful when handling large dataset.
The maxtime
parameter indicates the maximum temporal distance below which
the shorter distances will be considered in the calculation of
the spatio-temoral semivariogram.
Value
Returns an object of class Variogram
.
An object of class Variogram
is a list containing
at most the following components:
bins |
Adjacent intervals of grouped spatial distances if
|
bint |
Adjacent intervals of grouped temporal distances if
|
cloud |
If the variogram cloud is returned ( |
centers |
The centers of the spatial bins; |
distance |
The type of spatial distance; |
lenbins |
The number of pairs in each spatial bin; |
lenbinst |
The number of pairs in each spatial-temporal bin; |
lenbint |
The number of pairs in each temporal bin; |
maxdist |
The maximum spatial distance used for the calculation of the variogram. If no spatial distance is specified then it is NULL; |
maxtime |
The maximum temporal distance used for the calculation of the variogram. If no temporal distance is specified then it is NULL; |
spacetime_dyn |
If the space-time variogram is obtained using dynamical coordinates
then it is( |
variograms |
The empirical spatial variogram; |
variogramst |
The empirical spatial-temporal variogram; |
variogramt |
The empirical temporal variogram; |
type |
The type of estimated variogram |
Author(s)
Moreno Bevilacqua, moreno.bevilacqua89@gmail.com,https://sites.google.com/view/moreno-bevilacqua/home, Víctor Morales Oñate, victor.morales@uv.cl, https://sites.google.com/site/moralesonatevictor/, Christian", Caamaño-Carrillo, chcaaman@ubiobio.cl,https://www.researchgate.net/profile/Christian-Caamano
References
Cressie, N. A. C. (1993) Statistics for Spatial Data. New York: Wiley.
Gaetan, C. and Guyon, X. (2010) Spatial Statistics and Modelling. Spring Verlang, New York.
See Also
Examples
library(GeoModels)
################################################################
###
### Example 1. Empirical estimation of the semi-variogram from a
### spatial Gaussian random field with exponential correlation.
###
###############################################################
set.seed(514)
# Set the coordinates of the sites:
x = runif(200, 0, 1)
y = runif(200, 0, 1)
coords = cbind(x,y)
# Set the model's parameters:
corrmodel = "Exponential"
mean = 0
sill = 1
nugget = 0
scale = 0.3/3
# Simulation of the spatial Gaussian random field:
data = GeoSim(coordx=coords, corrmodel=corrmodel, param=list(mean=mean,
sill=sill, nugget=nugget, scale=scale))$data
# Empirical spatial semi-variogram estimation:
vario = GeoVariogram(coordx=coords,data=data,maxdist=0.6)
plot(vario,pch=20,ylim=c(0,1),ylab="Semivariogram",xlab="Distance")
################################################################
###
### Example 2. Empirical estimation of the variogram from a
### spatio-temporal Gaussian random fields with Gneiting
### correlation function.
###
###############################################################
set.seed(331)
# Define the temporal sequence:
# Set the coordinates of the sites:
x = runif(200, 0, 1)
y = runif(200, 0, 1)
coords = cbind(x,y)
times = seq(1,10,1)
# Simulation of a spatio-temporal Gaussian random field:
data = GeoSim(coordx=coords, coordt=times, corrmodel="gneiting",
param=list(mean=0,scale_s=0.08,scale_t=0.4,sill=1,
nugget=0,power_s=1,power_t=1,sep=0.5))$data
# Empirical spatio-temporal semi-variogram estimation:
vario_st = GeoVariogram(data=data, coordx=coords, coordt=times, maxtime=7,maxdist=0.5)
plot(vario_st)
################################################################
###
### Example 3. Empirical estimation of the (cross) semivariograms
### from a bivariate Gaussian random fields with Matern
### correlation function.
###
###############################################################
# Simulation of a bivariate spatial Gaussian random field:
set.seed(293)
# Define the spatial-coordinates of the points:
x = runif(400, 0, 1)
y = runif(400, 0, 1)
coords=cbind(x,y)
# Simulation of a bivariate Gaussian Random field
# with matern (cross) covariance function
param=list(mean_1=0,mean_2=0,scale_1=0.1/3,scale_2=0.15/3,scale_12=0.15/3,
sill_1=1,sill_2=1,nugget_1=0,nugget_2=0,
smooth_1=0.5,smooth_12=0.5,smooth_2=0.5,pcol=0.3)
data = GeoSim(coordx=coords, corrmodel="Bi_matern", param=param)$data
# Empirical semi-(cross)variogram estimation:
biv_vario=GeoVariogram(data,coordx=coords, bivariate=TRUE,maxdist=0.5)
plot(biv_vario,pch=20)