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 d-dimensional vector (a single spatial realisation) or a (n \times d)-matrix (n iid spatial realisations) or a (d \times d)-matrix (a single spatial realisation on regular grid) or an (d \times d \times n)-array (n iid spatial realisations on regular grid) or a (t \times d)-matrix (a single spatial-temporal realisation) or an (t \times d \times n )-array (n iid spatial-temporal realisations) or or an (d \times d \times t \times n )-array (a single spatial-temporal realisation on regular grid) or an (d \times d \times t \times n )-array (n iid spatial-temporal realisations on regular grid). See GeoFit for details.

coordx

A numeric (d \times 2)-matrix (where d is the number of spatial sites) assigning 2-dimensions of spatial coordinates or a numeric d-dimensional vector assigning 1-dimension of spatial coordinates. Coordinates on a sphere for a fixed radius radius are passed in lon/lat format expressed in decimal degrees.

coordy

A numeric vector assigning 1-dimension of spatial coordinates; coordy is interpreted only if coordx is a numeric vector or grid=TRUE otherwise it will be ignored. Optional argument, the default is NULL then coordx is expected to be numeric a (d \times 2)-matrix.

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 (d_t \times 2)-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

\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 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

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

GeoFit

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)
      

[Package GeoModels version 2.0.4 Index]