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
|
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
|
mc_cores |
an integer to determine how many parallel process should be
run. Default |
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 ofx
. Each element of the list has:- triangles
a data frame of class
sfc
(seesf::st_sf()
)with columnsgeometry
,segments
,max_length
andalpha
. The data.frame contains the whole Delanauy triangulation for the corresponding column ofx
andy
. Thesegments
column are the segments of each individual triangle andmax_length
is the maximum length of them.- geom_indices
a data frame with columns
alpha
andgeom_corr
. Thealpha
column is a numeric vector of sizenalphas
from the minimum to the maximum distance between points estimated in the data. Thegeom_corr
column is the value1 - (alpha shape Area)/(containing box Area).
- intensity
the intensity estimated for the corresponding column of
x
andy
.- 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 parametermean_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)