Description Usage Arguments Details Value Author(s) Examples
View source: R/getRecurrencePoints.R
This function is the core of the function createSimpleRm. It finds the recurrence points in a time series, possibly embedded.
1 | getRecurrencePoints(timSer, embedDim, lagDelay, threshold)
|
timSer |
The time series |
embedDim |
The embedding dimension |
lagDelay |
The delay for the embedding (in lags) |
threshold |
The threshold |
Two points in the phase space are recurrent when the distance between them (infinite norm) is less than the threshold.
In a recurrence matrix the X positions read rightwards and the Y positions read upwards. Recurrence matrices are symmetric and their diagonal (line X = Y) cannot contain not-recurrent points. For this reason, only the upper triangle is stored.
A list containing the X and Y positions of the recurrent points in the recurrence matrix (upper triangle)
Marina Saez Andreu
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | # # Generate time series
timSer <- genTSExample(stationary = FALSE, InKTSEnv = FALSE)
graphics::plot(timSer)
# # Calculate recurrence matrix
RP <- getRecurrencePoints(timSer, 1, 0, threshold = 0.1)
X <- RP$recPointsX
Y <- RP$recPointsY
# # Recurrence plot
LT <- nrow(timSer)
graphics::par(pty = "s")
# Upper triangle
graphics::plot(timSer$time[X], timSer$time[Y], cex = 0.3, col = 4, xlab = "", ylab = "")
# Lower triangle
graphics::points(timSer$time[Y], timSer$time[X], cex = 0.3, col = 4)
# Diagonal
graphics::points(1:LT, 1:LT, cex = 0.3, col = 4)
graphics::par(pty = "m")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.