gof_mc: Polygons Spatial Association Test - Global Envelope

View source: R/mc_test.R

gof_mcR Documentation

Polygons Spatial Association Test - Global Envelope

Description

A Monte Carlo test to verify if two sets of polygons are associated based in a global envelope of the functions K_{12}(d) and L_{12}(d) using different test statistics.

Usage

gof_mc(
  obj_sp1,
  obj_sp2,
  n_sim = 499L,
  unique_bbox = NULL,
  alpha = 0.01,
  H = "L",
  ts = "SMAD",
  distances = NULL,
  fixed = FALSE,
  method = "hausdorff"
)

Arguments

obj_sp1

an object from class SpatialPolygons or SpatialPointsDataFrame

obj_sp2

an object from class SpatialPolygons or SpatialPointsDataFrame

n_sim

an integer corresponding to the number of Monte Carlo simulations for the test

unique_bbox

a matrix 2 \times 2 corresponding to the boundary box that contains both sets

alpha

a numeric indicating the confidence level.

H

a character indicating the function to be used. Possible entries are: 'K' or 'L'.

ts

a character associated to a test statistic. Inputs acepted: c('IM', 'MAD', 'SIM', 'SMAD', 'IMDQ', 'MADDQ').

distances

a numeric vector indicating the distances to evaluate H(d). If NULL then the range considered goes from 5 observed inside the unique_bbox.

fixed

a boolean indicating if the first pattern should be fixed on the toroidal shift or the first will be fixed in half of iterations and then the other one. TRUE or FALSE, respectively.

method

a character specifying which kind of distance will be used to evalueate H. Also, there is an option of using areas. Options available: c('hausdorff', 'euclidean', 'area').

Value

a list from class gof_test, with values:

p_value

a numeric scalar giving the p-value of the test

mc_sample

a numeric vector giving the test statistic for each of the Monte Carlo simulations

mc_funct

a matrix where each line correspond to the function (K or L) estimated for the Monte Carlo simulations

distances

numeric vector containing the distances where mc_func were evaluated.

alpha

a numeric scalar giving the significance level

rejects

a logical scalar, TRUE if the null hypothesis is reject


lcgodoy/tpsa documentation built on Oct. 17, 2023, 3:26 p.m.