getRecurrencePoints: A function to get recurrent points in a time series

Description Usage Arguments Details Value Author(s) Examples

View source: R/getRecurrencePoints.R

Description

This function is the core of the function createSimpleRm. It finds the recurrence points in a time series, possibly embedded.

Usage

1
getRecurrencePoints(timSer, embedDim, lagDelay, threshold)

Arguments

timSer

The time series

embedDim

The embedding dimension

lagDelay

The delay for the embedding (in lags)

threshold

The threshold

Details

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.

Value

A list containing the X and Y positions of the recurrent points in the recurrence matrix (upper triangle)

Author(s)

Marina Saez Andreu

Examples

 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")

KarsTS documentation built on Jan. 16, 2021, 5:07 p.m.