spatgeom {spatgeom}R Documentation

Geometric Spatial Point Pattern Analysis

Description

Function to estimate the geometric correlation between variables.

Usage

spatgeom(x, y, scale = FALSE, nalphas = 100, envelope = FALSE, mc_cores = 1)

Arguments

x

numeric matrix or data.frame of covariables.

y

numeric vector of responses in a model.

scale

boolean to make the estimations with scaled variables. Default FALSE.

nalphas

a single number for the number of alphas generated between the minimum and maximum edge distance on the Delanauy triangulation.

envelope

boolean to determine if the Monte-Carlo is estimated. Default FALSE.

mc_cores

an integer to determine how many parallel process should be run. Default mc_core=1.

Value

A list of class spatgeom with the following elements:

call

The function call.

x

x input.

y

y output.

results

A list of size ncol(x) corresponding to each column of x. Each element of the list has:

triangles

a data frame of class sfc (see sf::st_sf())with columns geometry, segments, max_length and alpha. The data.frame contains the whole Delanauy triangulation for the corresponding column of x and y. The segments column are the segments of each individual triangle and max_length is the maximum length of them.

geom_indices

a data frame with columns alpha and geom_corr. The alpha column is a numeric vector of size nalphas from the minimum to the maximum distance between points estimated in the data. The geom_corr column is the value 1 - (alpha shape Area)/(containing box Area).

intensity

the intensity estimated for the corresponding column of x and y.

mean_n

the mean number of points in the point process.

envelope_data

a data frame in tidy format with 40 runs of a CSR process, if envelope=TRUE, The CSR is created by generating n uniform points in the plane, where n is drawn from Poisson distribution with parameter mean_n.

References

Hernández, A.J., Solís, M. Geometric goodness of fit measure to detect patterns in data point clouds. Comput Stat (2022). https://doi.org/10.1007/s00180-022-01244-1

Examples

xy <- donut_data(n = 30, a = -1, b = 1, theta = 2 * pi)
estimation <- spatgeom(y = xy[, 1], x = xy[, -1])

# If you want to estimate the envelope, you can use the envelope argument to
# TRUE. This will take a while to run.
## Not run: 
estimation_with_envelope <- spatgeom(
  y = xy[, 1], x = xy[, -1],
  envelope = TRUE
)

## End(Not run)

[Package spatgeom version 0.3.0 Index]