pastNNsInfo {patterncausality}R Documentation

Finding Nearest Neighbors and Keeping their Topological Information

Description

This function identifies the nearest neighbors of a given point in a time series, excluding common coordinate vectors and a specified horizon from the candidate nearest neighbors. It returns detailed information about these neighbors, including their times, distances, signatures, patterns, and coordinates.

Usage

pastNNsInfo(CCSPAN, NNSPAN, Mx, Dx, SMx, PSMx, i, h)

Arguments

CCSPAN

Integer, the span of common coordinates to exclude from the nearest neighbor search.

NNSPAN

Integer, the number of nearest neighbors to consider for the analysis.

Mx

Matrix, the main matrix representing the state space of the system.

Dx

Numeric matrix, containing distances between points in the state space.

SMx

Matrix, containing signatures of the state space.

PSMx

Matrix, containing patterns derived from the signatures.

i

Integer, the current index in time series data for which nearest neighbors are being considered.

h

Integer, the horizon beyond which data is not considered in the nearest neighbor search.

Value

A list containing:

Examples

# Generate random data for demonstration
set.seed(123)
E <- 3
tau <- 1
Mx <- matrix(rnorm(200), nrow = 20)
Dx <- distanceMatrix(Mx, "minkowski")
SMx <- signatureSpace(Mx, E)
PSMx <- patternSpace(SMx, E)
CCSPAN <- (E - 1) * tau
NNSPAN <- E + 1
i <- 15
h <- 2
neighborsInfo <- pastNNsInfo(CCSPAN, NNSPAN, Mx, Dx, SMx, PSMx, i, h)
print(neighborsInfo)

[Package patterncausality version 0.1.2 Index]