Skip to content
naulon

No noticeNo retraction, correction or concern found when last checked on Dec 3, 2026.

Cross-recurrence quantification analysis of categorical and continuous time series: an R package

Moreno I. Coco, Rick Dale

Frontiers in Psychology · 2014

doi:10.3389/fpsyg.2014.00510 (opens in a new tab)

We email you when a new notice or a question about this paper appears.

Abstract

This paper describes the R package crqa to perform cross-recurrence quantification analysis of two time series of either a categorical or continuous nature. Streams of behavioral information, from eye movements to linguistic elements, unfold over time. When two people interact, such as in conversation, they often adapt to each other, leading these behavioral levels to exhibit recurrent states. In dialog, for example, interlocutors adapt to each other by exchanging interactive cues: smiles, nods, gestures, choice of words, and so on. In order for us to capture closely the goings-on of dynamic interaction, and uncover the extent of coupling between two individuals, we need to quantify how much recurrence is taking place at these levels. Methods available in crqa would allow researchers in cognitive science to pose such questions as how much are two people recurrent at some level of analysis, what is the characteristic lag time for one person to maximally match another, or whether one person is leading another. First, we set the theoretical ground to understand the difference between “correlation” and “co-visitation” when comparing two time series, using an aggregative or cross-recurrence approach. Then, we describe more formally the principles of cross-recurrence, and show with the current package how to carry out analyses applying them. We end the paper by comparing computational efficiency, and results’ consistency, of crqa R package, with the benchmark MATLAB toolbox crptoolbox (Marwan, 2013). We show perfect comparability between the two libraries on both levels.

Abstract licence: CC BY

No text here

Its licence does not allow us to show the full text. Read it at PubMed Central:

Read at PubMed Central (opens in a new tab)

Figures 12

From PubMed Central, U.S. National Library of Medicine. Licence: CC BY.

Two example experimental runs, in which we observe the behavior of two simple conversational “agents,” a confederate (C) and participant (S), over 1000 time steps. The confederate’s behavior is experimentally setup to amplify the occurrence of the ev

Figure 1

Full legend

Two example experimental runs, in which we observe the behavior of two simple conversational “agents,” a confederate (C) and participant (S), over 1000 time steps. The confederate’s behavior is experimentally setup to amplify the occurrence of the event. P(C) in the plot reflects the raw probability that the confederate will emit the behavioral event (see Table 1). As specified in the agent’s policies, an increase in the behavioral event by the confederate should also increase it in the participant, which analyses are meant to bear out.

Open Figure 1 full size (opens in a new tab)
Data from 20 simulated interactions for each condition of the confederate’s event occurrence rate (0.05 vs. 0.25). As expected, one sees a relative increase in the event’s occurrence in agent S if it occurs in agent C.

Figure 2

Full legend

Data from 20 simulated interactions for each condition of the confederate’s event occurrence rate (0.05 vs. 0.25). As expected, one sees a relative increase in the event’s occurrence in agent S if it occurs in agent C.

Open Figure 2 full size (opens in a new tab)
Unfolding aggregate scores using cross correlation. Cross-correlation functions between confederate and participant agents. The high agent condition (red), reflecting the cross-correlation between C and S agents at different time lags or shifts (scal

Figure 3

Full legend

Unfolding aggregate scores using cross correlation. Cross-correlation functions between confederate and participant agents. The high agent condition (red), reflecting the cross-correlation between C and S agents at different time lags or shifts (scale: step increments), shows maximal variance accounted for at lag −1, C leading S by one time step (as set in the simulation). Smoothed profiles generated with ggplot2 in R, with stat_smooth which uses standard error to define the width of the lines.

Open Figure 3 full size (opens in a new tab)
Example cross recurrence plots (CRPs) of two sample runs of the simulated data. Left shows a high condition run, right shows a low condition run. Points reflect relative moments in time where C and S are revisiting event states (=1), whereas 0’s (non

Figure 4

Full legend

Example cross recurrence plots (CRPs) of two sample runs of the simulated data. Left shows a high condition run, right shows a low condition run. Points reflect relative moments in time where C and S are revisiting event states (=1), whereas 0’s (non-events) do not produce points on the plot. Three black lines define the approximate location of the lag calculations described in the text (from −5 to +5). The middle black line is the line of coincidence (LOC), where lag = 0. Though difficult to see in this plot, the points appear shifted slightly upwards (lagged +1), indicative of C leading S. This pattern becomes more evident in Figure 5, when calculating percentage recurrence over these diagonals.

Open Figure 4 full size (opens in a new tab)
By calculating the rate of points on diagonals around the LOC (left side), we obtain a diagonal-wise recurrence that reflects the relative co-visitation, as a function of lag (right side). The line superimposed on both panels shows the approximate re

Figure 5

Full legend

By calculating the rate of points on diagonals around the LOC (left side), we obtain a diagonal-wise recurrence that reflects the relative co-visitation, as a function of lag (right side). The line superimposed on both panels shows the approximate region over which percentages are calculated. Like cross-correlation we get a maximization at −1, reflecting C driving S. However, the difference between the conditions is larger, proportional to the relative rate of occurrence. Recurrence does not count non-events (0’s), so the y-axis levels will be determined by the frequency of the events in the time series (1’s). Smoothed profiles (on the right) were generated with ggplot2 in R, with stat_smooth which uses standard error to define the width of the lines.

Open Figure 5 full size (opens in a new tab)
A basic sketch of how recurrence is constructed from one time series (top left). The time series is lagged (by 10), copied (3 times), and overlaid with itself (top right). If we use 3 dimensions (copies), then it is possible to visualize this reconst

Figure 6

Full legend

A basic sketch of how recurrence is constructed from one time series (top left). The time series is lagged (by 10), copied (3 times), and overlaid with itself (top right). If we use 3 dimensions (copies), then it is possible to visualize this reconstructed phase space (bottom left). By drawing a radius of a given size around parts of this reconstructed phase space (thick line, bottom left), one can determine when recurrence is taking place. The time indices of these recurrence points can be used to construct the recurrence plot (bottom right). Cross recurrence is done in almost exactly the same way, except two time series are used.

Open Figure 6 full size (opens in a new tab)
Show all 12 figures
Data available in crqa. Eye-movement responses of dyads (speakers and listeners) engaged in dialog from Richardson and Dale (2005) (left panel, RDts1, RDts2). Body-movement intensity of the interlocutors engaged in a conversation from Paxton and Dale

Figure 7

Full legend

Data available in crqa. Eye-movement responses of dyads (speakers and listeners) engaged in dialog from Richardson and Dale (2005) (left panel, RDts1, RDts2). Body-movement intensity of the interlocutors engaged in a conversation from Paxton and Dale (2013) (right panel, leftmov, rightmov). In the bottom row of the figure, we illustrate the concept of recurrence in categorical and continuous time series, and the role played by the radius parameter when the series are not lagged.

Open Figure 7 full size (opens in a new tab)
Diagonal-wise recurrence profile for two eye-movement series (RDts1, RDts2) taken from Richardson and Dale (2005).

Figure 8

Full legend

Diagonal-wise recurrence profile for two eye-movement series (RDts1, RDts2) taken from Richardson and Dale (2005).

Open Figure 8 full size (opens in a new tab)
Window cross-recurrence of the two eye-movement series (RDts1, RDts2) from Richardson and Dale (2005).

Figure 9

Full legend

Window cross-recurrence of the two eye-movement series (RDts1, RDts2) from Richardson and Dale (2005).

Open Figure 9 full size (opens in a new tab)
Recurrence Plot of the two eye-movement series (RDts1, RDts2) from Richardson and Dale (2005). The recurrent points are marked with blue color, whereas the non-recurrent points are left blank. The values obtained on the measures for this plot are: RE

Figure 10

Full legend

Recurrence Plot of the two eye-movement series (RDts1, RDts2) from Richardson and Dale (2005). The recurrent points are marked with blue color, whereas the non-recurrent points are left blank. The values obtained on the measures for this plot are: REC = 12.52; DET = 98.95; Lmax = 124; L = 11.3; ENTR = 3.2; LAM = 99.7; TT = 20.6. Usually, these values are interpreted relatively, by comparing one condition to another condition in an experiment. In general, DET will be higher than REC, with DET often quite high (90% or higher) and REC considerably lower (10% or less), so 12% would be considered relatively high.

Open Figure 10 full size (opens in a new tab)
Phi-coefficient plot of a particular object for the two eye-movement series (RDts1, RDts2) from Richardson and Dale (2005).

Figure 11

Full legend

Phi-coefficient plot of a particular object for the two eye-movement series (RDts1, RDts2) from Richardson and Dale (2005).

Open Figure 11 full size (opens in a new tab)
Elapsed user time to extract CRQ measures on simulated dichotomous time series of increasing lengths using crqa in R and crqtoolbox in MATLAB. Means over 20 iterations are shown as lines. The programming language of the library is identified using li

Figure 12

Full legend

Elapsed user time to extract CRQ measures on simulated dichotomous time series of increasing lengths using crqa in R and crqtoolbox in MATLAB. Means over 20 iterations are shown as lines. The programming language of the library is identified using line type.

Open Figure 12 full size (opens in a new tab)

References 39

  1. 1.

    Bakeman R. (1997 ). Observing Interaction: an Introduction to Sequential Analysis. Cambridge: Cambridge University Press

    Not in our library10.1017/cbo9780511527685 (opens in a new tab)

  2. 2.

    Bakeman R. Quera V. (2011 ). Sequential Analysis and Observational Methods for the Behavioral Sciences. Cambridge: Cambridge University Press

    Not in our library10.1017/cbo9781139017343 (opens in a new tab)

  3. 3.

    Balasubramaniam R. Riley M. Turvey M. (2000 ). Specificity of postural sway to the demands of a precision task. Gait Posture 11, 12–24

    Not in our library10.1016/s0966-6362(99)00051-x (opens in a new tab)

  4. 4.

    Barbosa A. Déchaine R. Vatikiotis-Bateson E. Yehia H. (2012 ). Quantifying time-varying coordination of multimodal speech signals using correlation map analysis. J. Acoust. Soc. Am. 131, 2162

    Not in our library10.1121/1.3682040 (opens in a new tab)

  5. 5.

    Bargh J. Chartrand T. (1999 ). The unbearable automaticity of being. Am. Psychol. 54, 462–479

    Not in our library10.1037/0003-066x.54.7.462 (opens in a new tab)

  6. 6.

    Beer R. (2003 ). The dynamics of active categorical perception in an evolved model agent. Adapt. Behav. 11, 209–243 19362447

    Not in our library10.1177/1059712303114001 (opens in a new tab)

  7. 7.

    Boker S. Xu M. Rotondo J. King K. (2002 ). Windowed cross-correlation and peak picking for the analysis of variability in the association between behavioral time series. Psychol. Methods 7, 338–355

    Not in our library10.1037/1082-989x.7.3.338 (opens in a new tab)

  8. 8.

    Branigan H. (2007 ). Syntactic priming. Lang. Linguist. Compass 1, 1–16 23968509

    Not in our library10.1111/j.1749-818x.2006.00001.x (opens in a new tab)

  9. 9.

    Brennan S. Clark H. (1996 ). Conceptual pacts and lexical choice in conversation. J. Exp. Psychol. Learn. Mem. Cogn. 22, 1482–1493

    Not in our library10.1037/0278-7393.22.6.1482 (opens in a new tab)

  10. 10.
  11. 11.

    Dale R. Warlaumont A. S. Richardson D. C. (2011b ). Nominal cross recurrence as a generalized lag sequential analysis for behavioral streams. Int. J. Bifurcat. Chaos 21, 1153–1161

    Not in our library10.1142/s0218127411028970 (opens in a new tab)

  12. 12.

    Eckmann J.-P. Kamphorst S. O. Ruelle D. (1987 ). Recurrence plots of dynamical systems. EPL (Europhys. Lett.) 4, 973

    Not in our library10.1209/0295-5075/4/9/004 (opens in a new tab)

  13. 13.

    Fusaroli R. Konvalinka I. Wallot S. (in press ). Analyzing social interactions: promises and challenges of cross recurrence quantification analysis, in Springer Proceedings in Mathematics & Statistics.

    Not in our library

  14. 14.

    Haywood S. Pickering M. Branigan H. (2005 ). Do speakers avoid ambiguities during dialogue? Psychol. Sci. 16, 362–366

    Not in our library10.1111/j.0956-7976.2005.01541.x (opens in a new tab)

  15. 15.

    Louwerse M. Dale R. Bard E. Jeuniaux P. (2012 ). Behavior matching in multimodal communication is synchronized. Cogn. Sci. 36, 1404–1426

    Not in our library10.1111/j.1551-6709.2012.01269.x (opens in a new tab)

  16. 16.

    Marwan N. (2008 ). A historical review of recurrence plots. Eur. Phys. J. Spec. Top. 164, 3–12

    Not in our library10.1140/epjst/e2008-00829-1 (opens in a new tab)

  17. 17.

    Marwan N. (2013 ). Cross Recurrence Plot Toolbox. Available online at: http://tocsy.pik-potsdam.de/CRPtoolbox

    Not in our library

  18. 18.

    Marwan N. Carmen Romano M. Thiel M. Kurths J. (2007 ). Recurrence plots for the analysis of complex systems. Phys. Rep. 438, 237–329

    Not in our library10.1016/j.physrep.2006.11.001 (opens in a new tab)

  19. 19.

    Marwan N. Kurths J. (2002 ). Nonlinear analysis of bivariate data with cross recurrence plots. Phys. Lett. A 302, 299–307

    Not in our library10.1016/s0375-9601(02)01170-2 (opens in a new tab)

  20. 20.

    MATLAB. (2012 ). version 7.14 (r2012a). Natick, Massachusetts: The MathWorks Inc

    Not in our library

  21. 21.

    Mirman D. (2014 ). Growth Curve Analysis and Visualization Using R. The R series. Boca Raton: Chapman and Hall

    Not in our library

  22. 22.

    Orsucci F. Giuliani A. Webber C. Jr. Zbilut J. Fonagy P. Mazza M. (2006 ). Combinatorics and synchronization in natural semiotics. Physica A 361, 665–676

    Not in our library10.1016/j.physa.2005.06.044 (opens in a new tab)

  23. 23.

    Paxton A. Dale R. (2013 ). Argument disrupts interpersonal synchrony. Q. J. Exp. Psychol. 66, 2092–2102

    Not in our library10.1080/17470218.2013.853089 (opens in a new tab)

  24. 24.

    Pickering M. Garrod S. (2004 ). Toward a mechanistic psychology of dialogue. Behav. Brain Sci. 27, 169–189

    Not in our library10.1017/s0140525x04000056 (opens in a new tab)

  25. 25.

    Richardson D. Dale R. (2005 ). Looking to understand: the coupling between speakers’ and listeners’ eye movements and its relationship to discourse comprehension. Cogn. Sci. 29, 39–54

    Not in our library10.1207/s15516709cog0000_29 (opens in a new tab)

  26. 26.

    Richardson D. Dale R. Kirkham N. (2007 ). The art of conversation is coordination common ground and the coupling of eye movements during dialogue. Psychol. Sci. 18, 407–413

    Not in our library10.1111/j.1467-9280.2007.01914.x (opens in a new tab)

  27. 27.

    Richardson M. Dale R. Marsh K. (2014 ). Complex dynamical systems in social and personality psychology: theory, modeling and analysis, in Handbook of Research Methods in Social and Personality Psychology, eds Reis H. T. Judd C. M. (New York, NY: Cambridge University Press), 253–282

    Not in our library

  28. 28.

    Richardson M. Marsh K. Schmidt R. (2005 ). Effects of visual and verbal interaction on unintentional interpersonal coordination. J. Exp. Psychol. Hum. Percept. Perform. 31, 62–79

    Not in our library10.1037/0096-1523.31.1.62 (opens in a new tab)

  29. 29.

    Riley M. Van Orden G. (2005 ). Tutorials in Contemporary Nonlinear Methods for the Behavioral Sciences Web Book. Arlington, VA: Digital Publication Available through the National Science Foundation

    Not in our library

  30. 30.

    Schober M. (1993 ). Spatial perspective-taking in conversation. Cognition 47, 1–24

    Not in our library10.1016/0010-0277(93)90060-9 (opens in a new tab)

  31. 31.

    Shockley K. (2005 ). Cross recurrence quantification of interpersonal postural activity, in Tutorials in Contemporary Nonlinear Methods for the Behavioral Sciences, eds Riley M. A. Van Orden G. C. (Arlington, VA: Digital Publication Available through the National Science Foundation), 142–177

    Not in our library

  32. 32.

    Shockley K. Baker A. A. Richardson M. J. Fowler C. A. (2007 ). Articulatory constraints on interpersonal postural coordination. J. Exp. Psychol. Hum. Percept. Perform. 33:201

    Not in our library10.1037/0096-1523.33.1.201 (opens in a new tab)

  33. 33.

    Shockley K. Santana M. Fowler C. (2003 ). Mutual interpersonal postural constraints are involved in cooperative conversation. J. Exp. Psychol. Hum. Percept. Perform. 29, 326–332

    Not in our library10.1037/0096-1523.29.2.326 (opens in a new tab)

  34. 34.

    Shockley K. Turvey M. (2005 ). Encoding and retrieval during bimanual rhythmic coordination. J. Exp. Psychol. Learn. Mem. Cogn. 31, 980–990

    Not in our library10.1037/0278-7393.31.5.980 (opens in a new tab)

  35. 35.

    Stephen D. Dixon J. Isenhower R. (2009 ). Dynamics of representational change: action, entropy, & cognition. J. Exp. Psychol. Hum. Percept. Perform. 35, 1811–1822

    Not in our library10.1037/a0014510 (opens in a new tab)

  36. 36.

    Wallot S. Fusaroli R. Tylén K. Jegindø E.-M. (2013 ). Using complexity metrics with rr intervals and bpm heart rate measures. Front Physiol. 4:211

    Not in our library10.3389/fphys.2013.00211 (opens in a new tab)

  37. 37.

    Webber C. Jr. Zbilut J. (2005 ). Recurrence quantification analysis of nonlinear dynamical systems, in Tutorials in Contemporary Nonlinear Methods for the Behavioral Sciences, eds Riley M. A. Van Orden G. C. (Arlington, VA: Digital Publication Available through the National Science Foundation), 26–94

    Not in our library

  38. 38.

    Zbilut J. Giuliani A. Webber C. (1998 ). Recurrence quantification analysis and principal components in the detection of short complex signals. Phys. Lett. A 237, 131–135

    Not in our library10.1016/s0375-9601(97)00843-8 (opens in a new tab)

  39. 39.

    Zbilut J. P. Webber C. L. Jr. (1992 ). Embeddings and delays as derived from quantification of recurrence plots. Phys. Lett. A 171, 199–203

    Not in our library10.1016/0375-9601(92)90426-m (opens in a new tab)

Cited by papers we hold 8

Reads

Read by people on this page

None yet.

Checked or read by AI through naulon

None yet.

A person counts once a day per paper. We keep no cookie and no address: a reader is a hash that changes every day. Any month under five reads shows no number.

Are you an author?

Is this your paper?

Claim it to add your note and be paid when agents cite it. Free.