Learn R Programming

patterncausality (version 0.1.3)

projectedNNsInfo: Projected Nearest Neighbors Information

Description

Extracts and returns information about the projected nearest neighbors in a time series context, specifically useful for understanding interactions in dynamic complex systems.

Usage

projectedNNsInfo(My, Dy, SMy, PSMy, timesX, i, h)

Value

A list containing indices of the element, the projected times, distances, weights derived from these distances, signatures, patterns, and the coordinates of the nearest neighbors.

Arguments

My

Matrix of coordinates in the original space.

Dy

Distance matrix, representing distances between elements in My.

SMy

Matrix of signatures, capturing essential patterns in the data.

PSMy

Matrix of patterns, representing characteristic configurations of the data.

timesX

Index at which the projection starts.

i

Index of the specific element for which information is being extracted.

h

Horizon over which the projection is considered.

Examples

Run this code
set.seed(123)
E <- 3
tau <- 1
Mx <- matrix(rnorm(300), nrow = 100)
My <- matrix(rnorm(300), nrow = 100)
Dx <- distanceMatrix(Mx, "minkowski")
Dy <- distanceMatrix(My, "minkowski")
SMx <- signatureSpace(Mx, E)
SMy <- signatureSpace(My, E)
PSMx <- patternSpace(SMx, E)
PSMy <- patternSpace(SMy, E)
CCSPAN <- (E - 1) * tau
NNSPAN <- E + 1
i <- 15
h <- 2
NNx <- pastNNsInfo(CCSPAN, NNSPAN, Mx, Dx, SMx, PSMx, i, h)
timesX <- NNx$times
projNNy <- projectedNNsInfo(My, Dy, SMy, PSMy, timesX, i, h)
print(projNNy)

Run the code above in your browser using DataLab