Skip to contents

simplex forecasting

Usage

# S4 method for class 'sf'
simplex(
  data,
  target,
  lib,
  pred = lib,
  E = 1:10,
  tau = 1,
  k = 4,
  nb = NULL,
  threads = detectThreads(),
  trend.rm = TRUE
)

# S4 method for class 'SpatRaster'
simplex(
  data,
  target,
  lib,
  pred = lib,
  E = 1:10,
  tau = 1,
  k = 4,
  threads = detectThreads(),
  trend.rm = TRUE
)

Arguments

data

The observation data.

target

Name of target variable.

lib

Row numbers(vector) of lattice data or row-column numbers(matrix) of grid data for creating the library from observations.

pred

(optional) Row numbers(vector) of lattice data or row-column numbers(matrix) of grid data used for predictions.

E

(optional) Dimensions of the embedding.

tau

(optional) Step of spatial lags.

k

(optional) Number of nearest neighbors to use for prediction.

nb

(optional) The neighbours list.

threads

(optional) Number of threads.

trend.rm

(optional) Whether to remove the linear trend.

Value

A matrix

Examples

columbus = sf::read_sf(system.file("shapes/columbus.gpkg", package="spData"))
# \donttest{
simplex(columbus,target = "CRIME",lib = 1:49)
#> The suggested embedding dimension E for variable CRIME is 6 
#>        E       rho       mae     rmse
#>  [1,]  1 0.5582378 10.187568 14.18034
#>  [2,]  2 0.5973572  9.330923 13.76604
#>  [3,]  3 0.6012386  9.947011 13.73818
#>  [4,]  4 0.5949300 10.559699 14.05813
#>  [5,]  5 0.6392106  9.460928 13.08035
#>  [6,]  6 0.6442922  9.438912 12.99714
#>  [7,]  7 0.6356835  9.578565 13.14957
#>  [8,]  8 0.6371715  9.541046 13.13519
#>  [9,]  9 0.6370924  9.542534 13.13622
#> [10,] 10 0.6370924  9.542534 13.13622
# }