data: A d-dimensional vector (a single spatial realisation) or a (nxd)-matrix (n iid spatial realisations) or a (dxd)-matrix (a single spatial realisation on regular grid) or an (dxdxn)-array (n iid spatial realisations on regular grid) or a (txd)-matrix (a single spatial-temporal realisation) or an (txdxn)-array (n iid spatial-temporal realisations) or or an (dxdxt)-array (a single spatial-temporal realisation on regular grid) or an (dxdxtxn)-array (n iid spatial-temporal realisations on regular grid). See GeoFit for details.
coordx: A numeric (dx2)-matrix or (dx3)-matrix Coordinates on a sphere for a fixed radius radius
are passed in lon/lat format expressed in decimal degrees.
coordy: A numeric vector giving 1-dimension of spatial coordinates; Optional argument, the default is NULL.
coordz: A numeric vector giving 1-dimension of spatial coordinates; Optional argument, the default is NULL.
coordt: A numeric vector assigning 1-dimension of temporal coordinates. Optional argument, the default is NULL then a spatial random field is expected.
coordx_dyn: A list of m numeric (dx2)-matrices containing dynamical (in time) spatial coordinates. Optional argument, the default is NULL
cloud: Logical; if TRUE the semivariogram cloud is computed, otherwise if FALSE (the default) the empirical (binned) semivariogram is returned.
distance: String; the name of the spatial distance. The default is Eucl, the euclidean distance. See the Section Details of GeoFit.
grid: Logical; if FALSE (the default) the data are interpreted as spatial or spatial-temporal realisations on a set of non-equispaced spatial sites.
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 : variogram.
bivariate: Logical; if FALSE (the default) the data are interpreted as univariate spatial or spatial-temporal realisations. Otherwise they are intrepreted as a a realization from a bivariate field.
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
γ^(h)=0.5xi,xj∈N(h)∑(Z(xi)−Z(xj))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.
Returns
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 cloud=FALSE. Otherwise if cloud=TRUE all the spatial pairwise distances;
bint: Adjacent intervals of grouped temporal distances if cloud=FALSE. Otherwise if cloud=TRUE all the temporal pairwise distances;
cloud: If the variogram cloud is returned (TRUE) or the empirical variogram (FALSE);
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(TRUE).
variograms: The empirical spatial variogram;
variogramst: The empirical spatial-temporal variogram;
variogramt: The empirical temporal variogram;
type: The type of estimated variogram
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.
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 =0sill =1nugget =0scale =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,pch=20)###################################################################### 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 functionparam=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)