cmc_psat {sapo} | R 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
cmc_psat(
p1,
p2,
id_col = NULL,
n_sim = 499L,
alpha = 0.01,
var_st = TRUE,
ts = "SMAD",
distances = NULL,
hausdorff = TRUE,
method = "rnd_poly"
)
Arguments
p1 |
a |
p2 |
a |
id_col |
a |
n_sim |
an |
alpha |
a |
var_st |
use the variance stabilizing funciton? |
ts |
a |
distances |
a |
hausdorff |
a |
method |
(default = "rng_poly") a |
Value
a list
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
orL
) 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
Examples
library(sapo)
library(sf)
set.seed(2024)
## loading toy data
poly1 <- system.file("extdata", "poly1.rds", package = "sapo") |>
readRDS()
poly2 <- system.file("extdata", "poly2.rds", package = "sapo") |>
readRDS()
my_ht <- cmc_psat(poly1, poly2, n_sim = 199)
my_ht$p_value