fnn: false nearest neighbours

fnnR Documentation

false nearest neighbours

Description

false nearest neighbours

Usage

## S4 method for signature 'sf'
fnn(
  data,
  target,
  lib = NULL,
  pred = NULL,
  E = 1:10,
  tau = 1,
  style = 1,
  dist.metric = "L1",
  nb = NULL,
  rt = 10,
  eps = 2,
  threads = detectThreads(),
  detrend = TRUE
)

## S4 method for signature 'SpatRaster'
fnn(
  data,
  target,
  lib = NULL,
  pred = NULL,
  E = 1:10,
  tau = 1,
  style = 1,
  dist.metric = "L1",
  rt = 10,
  eps = 2,
  threads = detectThreads(),
  detrend = TRUE
)

Arguments

data

observation data.

target

name of target variable.

lib

(optional) libraries indices.

pred

(optional) predictions indices.

E

(optional) embedding dimensions.

tau

(optional) step of spatial lags.

style

(optional) embedding style (0 includes current state, 1 excludes it).

dist.metric

(optional) distance metric (L1: Manhattan, L2: Euclidean).

nb

(optional) neighbours list.

rt

(optional) escape factor.

eps

(optional) neighborhood diameter.

threads

(optional) number of threads to use.

detrend

(optional) whether to remove the linear trend.

Value

A vector

References

Kennel M. B., Brown R. and Abarbanel H. D. I., Determining embedding dimension for phase-space reconstruction using a geometrical construction, Phys. Rev. A, Volume 45, 3403 (1992).

Examples

columbus = sf::read_sf(system.file("case/columbus.gpkg", package="spEDM"))

fnn(columbus,"crime")


spEDM documentation built on Aug. 31, 2025, 5:08 p.m.