drpfromts: Diagonal recurrence profile

View source: R/drpfromts.R

drpfromtsR Documentation

Diagonal recurrence profile

Description

Method to explore the diagonal profile of the recurrence plot (Auto, Cross, or Multi-dimensional). It returns the recurrence for different delays, the maximal recurrence observed and the delay at which it occurred.

Usage

 drpfromts(ts1, ts2, windowsize, radius,
delay, embed, rescale, normalize, mindiagline, minvertline, tw,
whiteline, recpt, side, method, metric, datatype) 

Arguments

ts1

First time-series

ts2

Second time-series

windowsize

A constant indicating the range of delays (positive and negative) to explore

radius

A threshold, cut-off, constant used to decide whether two points are recurrent or not.

delay

The delay unit by which the series are lagged.

embed

The number of embedding dimension for phase-reconstruction, i.e., the lag intervals.

rescale

Rescale the distance matrix; if rescale = 0 (do nothing); if rescale = 1 (mean distance of entire matrix); if rescale = 2 (maximum distance of entire matrix). if rescale = 3 (minimum distance of entire matrix). if rescale = 4 (euclidean distance of entire matrix).

normalize

Normalize the time-series; if normalize = 0 (do nothing); if normalize = 1 (Unit interval); if normalize = 2 (z-score).

mindiagline

A minimum diagonal length of recurrent points. Usually set to 2, as it takes a minimum of two points to define any line.

minvertline

A minimum vertical length of recurrent points.

tw

The Theiler window parameter

whiteline

A logical flag to calculate (TRUE) or not (FALSE) empty vertical lines.

recpt

A logical flag indicating whether measures of cross-recurrence are calculated directly from a recurrent plot (TRUE) or not (FALSE).

side

A string indicating whether recurrence measures should be calculated in the 'upper' triangle of the RP 'lower' triangle of the matrix, or 'both'. LOC is automatically excluded for 'upper' and 'lower'.

method

A string to indicate the type of recurrence analysis to peform. There are three options: rqa (autorecurrence); crqa(cross-recurrence); mdcrqa(multidimensional recurrence). Default value is crqa

metric

A string to indicate the type of distance metric used, default is euclidean but see help rdist() to list all other possible metrics.

datatype

a string (continuous or categorical) to indicate whether the nature of the data type

Value

A list with the following arguments:

profile

A vector of recurrence (ranging from 0,1) with length equal to the number of delays explored

maxrec

Maximal recurrence observed between the two-series

maxlag

Delay at which maximal recurrence is observed

Author(s)

Moreno I. Coco (moreno.cocoi@gmail.com)

See Also

windowdrp

Examples


# use the available data
data(crqa) 

listener = eyemovement$listener
narrator = eyemovement$narrator

res = drpfromts(narrator, listener, windowsize = 100,
                 radius = 0.001, delay = 1, embed = 1, rescale = 0,
                 normalize = 0, mindiagline = 2, minvertline = 2,
                 tw = 0, whiteline = FALSE, recpt = FALSE, 
                 side = 'both', method = 'crqa', 
                 metric = 'euclidean', datatype = 'continuous')

 profile = res$profile

 plot(seq(1,length(profile),1), profile, type = "l", lwd = 5,
     xaxt = "n", xlab = "Lag", ylab = "Recurrence")


crqa documentation built on Nov. 27, 2023, 5:10 p.m.