Extracts and returns information about the projected nearest neighbors in a time series context, specifically useful for understanding interactions in dynamic complex systems.
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.
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.
Examples
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)
#> $i
#> [1] 15
#>
#> $Times_Projected
#> [1] 12 9 7 6
#>
#> $Dists
#> 12 9 7 6
#> 1.545039 1.768418 1.686713 1.506116
#>
#> $Weights
#> [1] 0.2531190 0.2445762 0.2476669 0.2546378
#>
#> $Signatures
#> [,1] [,2]
#> [1,] -0.4889397 -0.05168247
#> [2,] -1.7754842 0.68892929
#> [3,] 1.6644563 -0.54619358
#> [4,] -1.9817257 1.55539909
#>
#> $Patterns
#> [1] 30 78 42 78
#>
#> $Coordinates
#> [,1] [,2] [,3]
#> [1,] 0.7567748 0.2678350 0.21615254
#> [2,] 1.2366750 -0.5388092 0.15012013
#> [3,] -2.0142105 -0.3497542 -0.89594782
#> [4,] 0.3311792 -1.6505465 -0.09514745
#>