rid {gdverse} | R Documentation |
robust interaction detector(RID) model
Description
Function for robust interaction detector(RID) model.
Usage
rid(
formula,
data,
overlaymethod = "and",
discvar,
discnum = NULL,
minsize = NULL,
cores = 1
)
Arguments
formula |
A formula of RID model. |
data |
A data.frame, tibble or sf object of observation data. |
overlaymethod |
(optional) Spatial overlay method. One of |
discvar |
Name of continuous variable columns that need to be discretized. Noted that
when |
discnum |
A numeric vector for the number of discretized classes of columns that need
to be discretized. Default all |
minsize |
(optional) The min size of each discretization group. Default all use |
cores |
(optional) Positive integer(default is 1). If cores > 1, use parallel computation. |
Value
A list of the RID model result.
interaction
the result of RID model
Note
For bivariate spatial interactions, use the RGD
function and specify the type
parameter as interaction
.
The RID model requires at least 2^n-1
calculations when has n
explanatory variables.
When there are more than 10 explanatory variables, carefully consider the computational burden of this model.
When there are a large number of explanatory variables, the data dimensionality reduction method can be used
to ensure the trade-off between analysis results and calculation speed.
Please set up python dependence and configure GDVERSE_PYTHON
environment variable if you want to run rid()
.
See vignette('RGDRID',package = 'gdverse')
for more details.
Author(s)
Wenbo Lv lyu.geosocial@gmail.com
References
Zhang, Z., Song, Y., Karunaratne, L., & Wu, P. (2024). Robust interaction detector: A case of road life expectancy analysis. Spatial Statistics, 59(100814), 100814. https://doi.org/10.1016/j.spasta.2024.100814
Examples
## Not run:
## The following code needs to configure the Python environment to run:
data('sim')
g = rid(y ~ ., data = sim %>% dplyr::select(-dplyr::any_of(c('lo','la'))),
discvar = c("xa","xb","xc"), discnum = 4, cores = 6)
g
## End(Not run)