GeoNeighIndex function

Spatial or spatiotemporal near neighbour indices.

Spatial or spatiotemporal near neighbour indices.

The function returns the indices associated with a given spatial (temporal) neighbour and/or distance UTF-8

GeoNeighIndex(coordx,coordy=NULL,coordz=NULL, coordt=NULL,coordx_dyn=NULL,distance="Eucl",neighb=4,maxdist=NULL, maxtime=1,radius=6371,bivariate=FALSE)

Arguments

  • coordx: A numeric (dx2d x 2)-matrix or (dx3d x 3)-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 mm numeric (dx2d x 2)-matrices containing dynamical (in time) spatial coordinates. Optional argument, the default is NULL

  • distance: String; the name of the spatial distance. The default is Eucl, the euclidean distance. See the Section Details of GeoFit.

  • neighb: Numeric; an optional (vector of) positive integer indicating the order of neighborhood. See the Section Details for more information.

  • maxdist: A numeric value denoting the spatial distance Details .

  • maxtime: A numeric value denoting the temporal distance 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)

  • 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

The function returns the spatial or spatiotemporal indices of the pairs tha are neighboords of a certain order and/or with a certain fixed distance

Returns

Returns a list containing the following components:

  • colidx: First vector of indices

  • rowidx: Second vector of indices

  • lags: Vector of spatial distances

  • lagt: Vector of temporal distances

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

Examples

require(GeoModels) NN = 400 coords = cbind(runif(NN),runif(NN)) scale=0.5/3 param = list(mean=0,sill=1,nugget=0,scale=0.5/3,smooth=0.5) corrmodel = "Matern"; param = list(mean=0,sill=1,nugget=0,scale=scale,smooth=0.5) set.seed(951) data = GeoSim(coordx = coords,corrmodel = corrmodel, model = "Gaussian",param = param)$data sel=GeoNeighIndex(coordx=coords,neighb=5) data1=data[sel$colidx]; data2=data[sel$rowidx] ## plotting pairs that are neighboord of order 5 plot(data1,data2,xlab="",ylab="",main="h-scatterplot, neighb=5")
  • Maintainer: Moreno Bevilacqua
  • License: GPL (>= 3)
  • Last published: 2025-01-14