Optimizes the selection of spatial predictors using two different methods: "moran.i", and "p.value".

optimization_function(
  x = NULL,
  weight.r.squared = NULL,
  weight.penalization.n.predictors = NULL,
  optimization.method = "moran.i"
)

Arguments

x

Optimization data frame generated internally by select_spatial_predictors_sequential() or select_spatial_predictors_recursive(). Default: NULL

weight.r.squared

Numeric between 0 and 1, weight of R-squared in the optimization process. Default: NULL

weight.penalization.n.predictors

Numeric between 0 and 1, weight of the penalization on the number of added spatial predictors. Default: NULL

optimization.method

Character, one of "moran.i", and "p.value". Default: "moran.i"

Value

A numeric vector with the optimization criteria.

Details

The method "moran.i" tries to maximize 1 - Moran's I while taking into account the R-squared of the model and a penalization on the number of introduced spatial predictors through the expression

(1 - Moran's I) + w1 * r.squared - w2 * penalization

The method "p.value" uses a binary version of the p-values of Moran's I (1 if >= 0.05, 0 otherwise), and uses the expression

max(1 - Moran's I, binary p-value) + w1 * r.squared - w2 * penalization

The "moran.i" method generally selects more spatial predictors than the "p.value" method.