cpsd_disc {gdverse} | R Documentation |
optimal spatial data discretization based on SPADE q-statistics
Description
Function for determining the optimal spatial data discretization based on SPADE q-statistics.
Usage
cpsd_disc(
formula,
data,
wt,
discnum = 3:22,
discmethod = "quantile",
strategy = 2L,
increase_rate = 0.05,
cores = 1,
return_disc = TRUE,
seed = 123456789,
...
)
Arguments
formula |
A formula of optimal spatial data discretization. |
data |
A data.frame or tibble of observation data. |
wt |
The spatial weight matrix. |
discnum |
(optional) A vector of number of classes for discretization. Default is |
discmethod |
(optional) The discretization methods. Default all use |
strategy |
(optional) Discretization strategy. When |
increase_rate |
(optional) The critical increase rate of the number of discretization.
Default is |
cores |
(optional) A positive integer(default is 1). If cores > 1, a 'parallel' package cluster with that many cores is created and used. You can also supply a cluster object. |
return_disc |
(optional) Whether or not return discretized result used the optimal parameter.
Default is |
seed |
(optional) Random seed number, default is |
... |
(optional) Other arguments passed to |
Value
A list with the optimal parameter in the provided parameter combination with k
,
method
and disc
(when return_disc
is TRUE
).
x
discretization variable name
k
optimal number of spatial data discreteization
method
optimal spatial data discretization method
disc
the result of optimal spatial data discretization
Note
When the discmethod
is configured to robust
, it will operate at a significantly reduced speed.
Consequently, the use of robust discretization is not advised.
Author(s)
Wenbo Lv lyu.geosocial@gmail.com
References
Yongze Song & Peng Wu (2021) An interactive detector for spatial associations, International Journal of Geographical Information Science, 35:8, 1676-1701, DOI:10.1080/13658816.2021.1882680
Examples
data('sim')
wt = inverse_distance_weight(sim$lo,sim$la)
cpsd_disc(y ~ xa + xb + xc,
data = sim,
wt = wt)