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 |
coordx |
A numeric ( |
coordy |
A numeric vector giving 1-dimension of
spatial coordinates; |
coordt |
A numeric vector giving 1-dimension of
temporal coordinates. Optional argument, the default is |
coordx_dyn |
A list of |
distance |
String; the name of the spatial distance. The default
is |
grid |
Logical; if |
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