psam_mc: Polygons Spatial Association Test - PSAM

View source: R/mc_test.R

psam_mcR Documentation

Polygons Spatial Association Test - PSAM

Description

A Monte Carlo test based on the test statistic psam, to verify if two sets of polygons are associated.

Usage

psam_mc(
  obj_sp1,
  obj_sp2,
  n_sim = 499L,
  unique_bbox = NULL,
  alpha = 0.05,
  alternative = "two_sided",
  fixed = FALSE,
  hausdorff = F,
  ...
)

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

alternative

a character indicating the alternative hypothesis, it can be: "two_sided", "repulsion", or "attraction" if you interest is only check if the sets are independent or not, if the two sets repulses each other, or if the two sets attracts each other, respectively.

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.

hausdorff

a boolean. If TRUE, then the Hausdorff distance is used. Otherwise the Euclidean distance is used. Default is FALSE.

...

parameters for test statistics functions

Value

a list from class psam_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

alternative

a character giving the alternative hypothesis

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.