crqa (version 1.0.6)

runcrqa: Wrapper to compute different types of cross-recurrence quantification analyses between two time-series.

Description

Wrapper to extract CRQ information on categorical and continuous time series information. The function provides two types of analysis: the recurrence diagonal profile (type = 1), or a detailed analysis of the recurrence plot (type = 2). For both methods, the function can perform a profile analysis (method = 'profile'), which looks at how recurrence change for the different lags, or a window analysis (method = 'window'), where recurrence is tracked across the time-course by sliding overlapping windows.

Usage

runcrqa(ts1, ts2, par)

Arguments

ts1

First time-series

ts2

Second time-series

par

A list of argument parameters depending on whether the wrapper is used to obtain only profiles, i.e., type 1, or to extract more detailed measures from the cross-recurrence plot, type 2. See details below for a detailed explanation of the arguments for the two different methods.

Value

The values returned depends on the type (1,2) of computation requested.

For type = 1:

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

For type = 2:

rec = The percentage of recurrent points falling within the specified radius.

det = Proportion of recurrent points forming diagonal line structures.

nrline = The total number of lines in the recurrent plot

maxline = The length of the longest diagonal line segment in the plot, excluding the main diagonal

meanline = The average length of line structures

entropy = Shannon information entropy of all diagonal line lengths

relEntropy = Entropy measure normalized by the number of lines observed in the plot. Handy to compare across contexts and conditions

lam = Proportion of recurrent points forming vertical line structures

tt = The average length of vertical line structures

Details

Independently of the type, the argument 'method' can take two values either 'profile' or 'window':

method = 'profile': compute the recurrence profile over the all time series for different lags method = 'window': compute recurrence over time by sliding a window

For type 1:

with method = 'profile'

ws = the width (+/-) timestamps to use to lag the series

with method = 'window'

step = the sampling jumps over which windows are rolled

windowsize = the size of the window of analysis.

lagwidth = the number of lags to be analyzed.

For type 2:

delay = the delay introduced to the time series

embed = the embedding dimensions for phase-space reconstruction

rescale = Normalization of the distance matrix if rescale = 1 (mean distance of entire matrix); if rescale = 2 (maximum distance of entire matrix)

radius = Maximum distance to accept two-points as recurrent. If the series are categorical, it must be set to a very small value

normalize = Rescale factor for 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.

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

References

Webber Jr, C. L., and Zbilut, J. P. (2005). Recurrence quantification analysis of nonlinear dynamical systems. Tutorials in contemporary nonlinear methods for the behavioral sciences, 26-94.

Marwan, N., and Kurths, J. Nonlinear analysis of bivariate data with cross recurrence plots. Physics Letters A 302.5 (2002): 299-307.

See Also

drpdfromts, windowdrp, crqa, wincrqa

Examples

Run this code
# NOT RUN {
data(crqa)

####################################################
###Cross-recurrence diagonal profile 

par = list(type = 1, ws = 100, method = "profile",
    datatype = "categorical", thrshd = 8, radius = 2,
     pad = FALSE)

ans = runcrqa(RDts1, RDts2, par)

profile = ans$profile; maxrec = ans$maxrec; maxlag = ans$maxlag

####################################################
###Windowed cross-recurrence profile 

par = list(type = 1, windowstep =  20, windowsize =  100, 
  method = "window", datatype = "categorical", thrshd = 8,
     pad = FALSE)

ans = runcrqa(RDts1, RDts2, par)

print(ans)

####################################################
### Cross-recurrence measures 

par = list(type = 2, delay = 1, embed =  1, rescale =  1,
  radius = 0.00001, normalize = 0, mindiagline = 2,
   minvertline = 2, whiteline = FALSE, recpt = FALSE)

res = runcrqa(RDts1, RDts2, par)

res[1:9]

# }

Run the code above in your browser using DataCamp Workspace