GeoOutlier {GeoModels}R Documentation

Spatio (temporal) outliers detection

Description

Given a set of spatio (temporal) locations and data, the procedure select the spatial or spatiotemporal ouliers using a specific algorithm.

Usage

GeoOutlier(data, coordx, coordy=NULL, coordt=NULL, coordx_dyn=NULL, 
             distance="Eucl", grid=FALSE,  neighb=10,alpha=0.001,
             method="Z-Median", radius=6371, bivariate=FALSE,X=NULL)

Arguments

data

An optional dd-dimensional vector (a single spatial realisation) or a (d×dd \times d)-matrix (a single spatial realisation on regular grid) or a (t×dt \times d)-matrix (a single spatial-temporal realisation) or an (d×d×t×nd \times d \times t \times n )-array (a single spatial-temporal realisation on regular grid).

coordx

A numeric (d×2d \times 2)-matrix (where d is the number of spatial sites) giving 2-dimensions of spatial coordinates or a numeric dd-dimensional vector giving 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 giving 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×2d \times 2)-matrix.

coordt

A numeric vector giving 1-dimension of temporal coordinates. Optional argument, the default is NULL then a spatial RF is expected.

coordx_dyn

A list of mm numeric (dt×2d_t \times 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.

grid

Logical; if FALSE (the default) the data are interpreted as spatial or spatial-temporal realisations on a set of non-equispaced spatial sites (irregular grid).

neighb

Numeric; an optional positive integer indicating the order of neighborhoodused for Z-Median algorithm.

alpha

Numeric; a numeric value between 0 and 1 used for Z-Median algorithm.

method

String; The name of the algorithm for detecting spatial ouliers. Default is Z-median proposed in Chen et al. (2008)

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

If TRUE then data is considered as spatial bivariate data.

X

Numeric; an optional Matrix of spatio (temporal) covariates.

Value

Return a matrix or a list containing the dected spatial or spatio-temporal outliers

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

Chen D, Lu C, Kou Y, Chen F (2008) On detecting spatial outliers. Geoinformatica 12:455–475

Bevilacqua M., Caamaño C., Arellano-Valle R. B., Camilo Gomez C. (2022) A class of random fields with two-piece marginal distributions for modeling point-referenced data with spatial outliers. Test 10.1007/s11749-021-00797-5

Examples


library(GeoModels)
set.seed(1428)
NN = 1500
coords = cbind(runif(NN),runif(NN))
###
scale=0.5/3
corrmodel = "Matern"; 

param = list(mean=0,sill=1,nugget=0,scale=scale,smooth=0.5,skew=0)
data = GeoSim(coordx = coords,corrmodel = corrmodel,
                  model = "TwoPieceGaussian",param = param)$data

K=15         #parameter for outliers detection alghoritm
alpha=0.005  #parameter for outliers detection alghoritm
outlier=GeoOutlier(data=data, coordx = coords,neighb=K,alpha=alpha)
quilt.plot(coords,data)
for (i in 1:nrow(outlier))  plotrix::draw.circle(outlier[i,1], outlier[i,2],radius=0.02,lwd=2) 
nrow(outlier) # number of outliers

param = list(mean=0,sill=1,nugget=0.4,scale=scale,smooth=0.5)
data = GeoSim(coordx = coords,corrmodel = corrmodel,
                  model = "Gaussian",param = param)$data

K=15         #parameter for outliers detection alghoritm
alpha=0.005  #parameter for outliers detection alghoritm
outlier=GeoOutlier(data=data, coordx = coords,neighb=K,alpha=alpha)
quilt.plot(coords,data)
for (i in 1:nrow(outlier))  plotrix::draw.circle(outlier[i,1], outlier[i,2],radius=0.02,lwd=2)
nrow(outlier) # number of outliers

[Package GeoModels version 2.0.4 Index]