Skip to content

Simplified version of projectedNNsInfo function, intended for contexts where the distance matrix is directly passed as a parameter, applicable in scenarios where distances are precomputed or not dependent on dynamic indices.

Usage

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

Arguments

My

Matrix of coordinates in the original space.

Dy

Precomputed distance matrix for all elements.

SMy

Matrix of signatures.

PSMy

Matrix of patterns.

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 similar to projectedNNsInfo, containing details about the element, projected times, distances, weights, signatures, patterns, and coordinates.

Examples

set.seed(123)
E <- 3
tau <- 1
Mx <- matrix(rnorm(200), nrow = 20)
My <- matrix(rnorm(200), nrow = 20)
CCSPAN <- (E - 1) * tau
NNSPAN <- E + 1
i <- 15
h <- 2
Dx <- distanceVector(point = Mx[i, ], candidateNNs = Mx[1:(i - CCSPAN - h), ], n = 2)
Dy <- distanceVector(point = My[i, ], candidateNNs = My[1:(i - CCSPAN - h), ], n = 2)
SMx <- signatureSpace(Mx, E)
SMy <- signatureSpace(My, E)
PSMx <- patternSpace(SMx, E)
PSMy <- patternSpace(SMy, E)
NNx <- pastNNsInfo_Lite(CCSPAN, NNSPAN, Mx, Dx, SMx, PSMx, i, h)
timesX <- NNx$times
projNNy <- projectedNNsInfo_Lite(My, Dy, SMy, PSMy, timesX, i, h)
print(projNNy)
#> $i
#> [1] 15
#> 
#> $Times_Projected
#> [1]  4 10 12  3
#> 
#> $Dists
#>  [1] 5.879295 4.409728 4.136853 4.336187 3.448843 3.220030 3.479096
#>  [8] 4.332972 4.929059 3.795081 4.759499
#> 
#> $Weights
#>  [1] 0.08777905 0.09058359 0.09111413 0.09072627 0.09246564 0.09291954
#>  [7] 0.09240579 0.09073251 0.08958240 0.09178301 0.08990807
#> 
#> $Signatures
#>            [,1]       [,2]       [,3]        [,4]       [,5]       [,6]
#> [1,]  0.1643943 -1.8448920  2.4375023 -1.56585030 -0.7868617  1.7133336
#> [2,] -0.9615645  1.5010526 -0.3962528  0.07885816  1.8695086 -2.0302839
#> [3,] -0.3340070 -0.4715568  1.5244043  0.09165305 -0.2974063 -1.9452088
#> [4,]  1.3749932  0.3862125 -1.4489062  0.33887214 -1.3245653 -0.4002356
#>            [,7]       [,8]        [,9]
#> [1,] -0.6048036  0.9686565 -2.07969028
#> [2,] -0.1871963 -0.2811321  0.80714196
#> [3,] -0.8043145  0.3416996 -0.50659744
#> [4,]  3.0098291 -1.3972883 -0.09904009
#> 
#> $Patterns
#> [1]  51293202 123799878  51213990  44681970
#> 
#> $Coordinates
#>             [,1]        [,2]       [,3]       [,4]       [,5]       [,6]
#> [1,]  0.54319406  0.70758835 -1.1373036 1.30019868 -0.2656516 -1.0525133
#> [2,] -0.05402813 -1.01559258  0.4854600 0.08920722  0.1680654  2.0375740
#> [3,]  0.24368743 -0.09031959 -0.5618764 0.96252797  1.0541810  0.7567748
#> [4,] -0.26514506  1.10984814  1.4960607 0.04715443  0.3860266 -0.9385387
#>             [,7]        [,8]       [,9]      [,10]
#> [1,]  0.66082030  0.05601673  1.0246732 -1.0550170
#> [2,]  0.00729009 -0.17990623 -0.4610383  0.3461036
#> [3,] -1.18843404 -1.99274849 -1.6510489 -2.1576463
#> [4,] -1.33877429  1.67105483  0.2737665  0.1747264
#>