## Figures

## Abstract

In this study, we used recurrence quantification analysis (RQA) and recurrence plots (RPs) to compare the movement activity of individual workers of three ant species, as well as a gregarious beetle species. RQA and RPs quantify the number and duration of recurrences of a dynamical system, including a detailed quantification of signals that could be stochastic, deterministic, or both. First, we found substantial differences between the activity dynamics of beetles and ants, with the results suggesting that the beetles have quasi-periodic dynamics and the ants do not. Second, workers from different ant species varied with respect to their dynamics, presenting degrees of predictability as well as stochastic signals. Finally, differences were found among minor and major caste of the same (dimorphic) ant species. Our results underscore the potential of RQA and RPs in the analysis of complex behavioral patterns, as well as in general inferences on animal behavior and other biological phenomena.

**Citation: **Neves FM, Viana RL, Pie MR (2017) Recurrence analysis of ant activity patterns. PLoS ONE 12(10):
e0185968.
https://doi.org/10.1371/journal.pone.0185968

**Editor: **Jürgen Kurths, Humboldt-Universitat zu Berlin, GERMANY

**Received: **July 4, 2017; **Accepted: **September 24, 2017; **Published: ** October 9, 2017

**Copyright: ** © 2017 Neves et al. This is an open access article distributed under the terms of the Creative Commons Attribution License, which permits unrestricted use, distribution, and reproduction in any medium, provided the original author and source are credited.

**Data Availability: **All relevant data are within the paper and its Supporting Information files.

**Funding: **CNPq/MCT (http://cnpq.br/) provided support for this study through research fellowships to MRP (571334/2008-3), as well as a graduate fellowship to FMN (141355/2012-3). The funders had no role in study design, data collection and analysis, decision to publish, or preparation of the manuscript.

**Competing interests: ** The authors have declared that no competing interests exist.

## Introduction

Animal behavior is characterized by broad differences in hierarchical organization and variability, from individual organisms to societies. The variability often detected in animal behavior seems unpredictable at first sight, resulting from genetic, developmental, neural and physiological processes, as well as environmental effects [1]. However, this apparent intrinsic variability could hide nonlinear and unstable deterministic signals. In a seminal work, Cole [1] observed that the time series of single, isolated workers of the ant *Temnothorax* (= *Leptothorax*) *allardycei* had movement activity characteristic of low-dimensional chaos, whereas periodic patterns emerge when larger numbers of ant workers are allowed to interact. Indeed, the existence of chaos in ant activity has been suggested as a necessary dynamic for foraging and exploration [2–3], yet empirical studies about the dynamics of activity (movement) patterns are still in their infancy (e.g. [1–2, 4–9]). Ants, in particular, display several advantages as a model organism for these kinds of study, given that they show considerable variation in social complexity (e.g. colony size, behavioral and genetic composition, and the way in which reproduction is partitioned among nestmates), morphological, ecological and behavioral traits at the colony-level [10–11]. Furthermore, ants are easy to manipulate and rear under laboratory conditions, and to observe in 2D experimental setups [10].

Activity could be considered as one of the most vital biological features of animals, being correlated with a wide spectrum of behavioral syndromes, such as aggressiveness and exploration [12–17]. A highly informative way to collect and investigate movement activity probably could be provided by the investigation of spatio-temporal data of several species. However, the study of time series patterns imposes some difficulties, not the least of which being data collection. A large amount of noise in data collection (as often occurs in real data, e.g. from EEG analysis, cardiology or geology) reduces the ability to detect deterministic signals. Fortunately, the possibility of automated tracking of individuals in recent years offers efficient ways to obtain qualitative reliable data [18]. Characterizing irregular behavior of deterministic or stochastic processes is not a straightforward task to perform either. Nevertheless, we can take advantage of tools from nonlinear dynamics based on the temporal component of the behavior to gain insights into its operation and evolution [19]. Several analysis methods have been proposed to investigate the presence of determinism in time series (e.g. Lyapunov exponents, Fourier analysis, Power spectral analysis), however, hitherto with very limited empirical applications [19].

In this study, we introduce the use of recurrence analyses for the study of animal behavior. Recurrence analysis is a new, reliable and robust method of nonlinear data analysis that could be used for an improved understanding of biological time series. It is composed of visual diagnostics known as Recurrence Plots (RPs), and measures of complexity, such as Recurrence Quantification Analysis (RQA) [20–21]. Using these tools, one can distinguish regimes of recurrence behavior, which may be characteristic of different processes, such as white noise, chaotic maps, and (quasi-) periodic processes [21]. RQA has several advantages when compared to other time series analysis, such as its mathematical simplicity, non-restrictive modelling assumptions, and the capacity to deal with inherent noise [19]. RQA has been used to interpret and correlate complex patterns in dynamic systems, such as in physics [22], physiology [23], meteorology [24], economics [25], geophysics [26] and cardiology [27]. The use of the RQA measures could give a more detailed and qualitative approach to time series analysis of complex dynamics. Here, we examine and compare the complex temporal pattern of movement activity dynamics of isolated individuals of species with varying levels of social complexity and behavioral specialization.

## Methods

Three ant species were used in our study: *Gnamptogenys striatula* (Ectatomminae), *Linepithema micans* (Dolichoderinae), and *Pheidole rudigenis* (Myrmicinae). Workers from three colonies of each chosen species were collected in the campus of the Universidade Federal do Paraná in Curitiba, state of Paraná, Brazil. *Gnamptogenys striatula* is typically found in open habitats and rainforests, showing a suite of primitive behavioral and morphological traits [28]. Colonies of *G*. *striatula* are small (150–200 individuals) and have either one or several queens and gamergates (i.e. workers with reproductive capacity) [29–30]. *Linepithema micans* belongs to a widespread genus that includes an important invasive species (i.e. *Linepithema humile* [31]), which could be an indicative of its own potential as an invasive species. Colony size in *L*. *micans* might exceed 1000 individuals, leading to a fairly complex social organization [32]. Finally, *P*. *rudigenis*, as is the norm for its genus, is characterized by a dimorphic sterile worker caste, with regular workers (minors) carrying out quotidian colony tasks, whereas larger, big-headed workers (majors) are specialized in specific tasks, such as colony defense or seed milling [33]. Furthermore, for comparison with non-social insects, we used adults of the beetle *Tenebrio molitor*, a cosmopolitan pest of stored grains with gregarious behavior. No specific permissions were required for the locations or activities reported in this manuscript. The study did not involve human participants, specimens or tissue samples, or vertebrate animals, embryos or tissues. Furthermore, the field studies did not involve endangered or protected species.

Ants were collected manually by attracting them outside their nests using sugar water or tuna baits between 10:30 am and 5:00 pm (*n* = 30 workers for each species, except for *P*. *rudigenis*, in which 30 minor and major workers were tested separately). Assays lasting for two hours (*n* = 7200 seconds) typically started 45 min after the collection, whereas *T*. *molitor* were reared in laboratory in three acrylic boxes, stored in a well-ventilated, dark place, at ambient humidity and temperature with food (i.e. wheat bran) *ad libitum*. Trials were carried with different combinations of colonies and species per day (i.e. at least 10 individuals for each colony; 30 individual time series by each species), for a total of 150 analyzed experiments (*n* = 300 hours). In order to extract the time series without the interference of fluctuating densities, only one single individual of each species was used in each trial, so that we only conducted analyses using isolated ants. Given that all chosen ant species have similar body sizes, we disregarded the possible effects of the body size of the individuals or its body parts when comparing the time series of each ant species. However, the adults of *T*. *molitor* are much larger than the ants (i.e. the ant species chosen have a mean body size of 2.6 mm while *T*. *molitor* has a body size of 15 mm). We justify the use of *T*. *molitor* in this study because we are not investigating the amplitude of the activity between the species, but how its dynamics, i.e. the changes of states between activity and inactivity over time occurs (the concept of activity considered in our study is explained in the section below).

### Experimental setup

The experimental apparatus for the trials consisted of an environmental chamber made with cardboard (51 x 26 cm) with a tracking Petri dish arena inside (92 mm in diameter) (Fig 1). The arena was brightly lit (≈880 lux) by two fluorescent light spots (Taschibra ^{®} TKT15 15W 120 VAC 60 Hz 370 mA 6.400 *K*) positioned at opposite corners. Individuals were placed inside the arena under controlled environmental conditions (21 ± 2°C and 65% ± 10 relative humidity), between a glass cover plate and the substrate, which was shallow enough to constraint movement into only two dimensions. The color of the floor of the arena was opaque white for better image contrast, consisting of odorless white rubber silicon RTV (i.e. Room Temperature Vulcanizing silicon CS1000). After each trial, both the arena and the substrate were cleaned, washed in bleach (80%), dried and not used for at least five hours before a new experiment.

Measurements, disposition view of the light spots, camera and the tracking arena (a). Video frame of an ant (*Linepithema micans*) in the arena during the tracking, the black line corresponds to the movement of the ant (b). Final tracking coordinates (x,y) of 2400 frames extracted from a time series (*Linepithema micans*), the grey dashed lines are the coordinates obtained (c).

We recorded the movements of the individuals with a camera mounted 20 cm above the experimental setup (Everio GZ-MG435BUB). Trials were recorded at 20 frames *per* second. The extracted raw movie (MPEG-2; 720x480 pixels) was transformed into uncompressed AVI video files by the program Virtual Dub software by Avery Lee, version 1.5.10. The Euclidean distance between the consecutive coordinates (x, y) of each frame, was considered the measure of activity (at an interval of three seconds; *n* = 2400 frames *per* trial). Thus, a high level of activity produced large number of pixel differences. Inactivity was characterized by the motionless state of the individual, which did not change its position within the interval of time considered between the frames. Activity was represented by white dots and inactivity by black dots in the RPs. Our definition of the activity measurement is similar to that of Cole [1] in the study on the activity behavior of the ant *Temnothorax albipennis*.

### Tracking system

The x-y coordinates of the individual positions were extracted using the Ctrax software (Caltech Multiple Fly Tracker; version 0.3.12) and the associated FixErrors toolbox for MATLAB (v. 7.10.0 2010; MathWorks, Inc., Natick, MA, USA [34–35]; MATLAB v. 7.10.0). Ctrax was primarily made for tracking fruit flies, but is able to track individuals and large groups of animals (e.g. cockroaches, fishes, ants) while maintaining their individual identities [35–37]. Furthermore, Ctrax has high accuracy in movement tracking and requires simple recording equipment [35]. During preliminary experiments, we observed false positives errors (type I) and false negative errors (type II). Type I errors (mismatches of object identity) were corrected manually with the help of the FixErrors toolbox available for the Ctrax software, whereas type II errors (loss of tracking) were accepted only when they accounted for less than 5% of the time series.

### Recurrence plots

We investigated the obtained time series using the Recurrence Plot (RP), which is a technique of nonlinear data analysis first proposed by Eckmann et al. [20]. RPs consists of a visualization (or a graph) of a square matrix in which the matrix elements correspond to those times at which a state in a dynamical system recurs, i.e. approaches itself after some period of time [20–21]. Consequently, the RP reveals all the times when the phase space trajectory of the dynamical system visits roughly the same region in the phase space [21]. We constructed recurrence matrices by comparing embedding vectors with each other at different times, drawing pixels when the distance between vectors falls within an *ε*-neighborhood [21, 38–39]. Such an RP can be mathematically expressed as
where *ε* is a threshold, *H*(.) is the Heaviside unit step function, ||…|| stands for some norm (e.g., the Euclidean norm), *i* = 1, 2,…*N* is represented in the horizontal axis, and *j* with the same range in the vertical axis. The RP is thus obtained by assigning a black (white) dot to the points for which **R**_{i,j} = 1(0). By construction, the recurrence matrix is always symmetric (**R**_{i,j} = **R**_{j,i}), and a point is always recurrent to itself, i.e., **R**_{i,i} = 1 forming the main diagonal line of the RP [21].

Graphic representations of recurrence points permit to observe and interpret the general overview pattern of each individual time series. Eckmann et al. [20] made distinctions on how to visually read some of the plots. Marwan et al. [21] classifies recurrence plot structures into large-scale and small-scale patterns, Homogeneous patterns, characterizing white noise; Periodic patterns, when recurrence plots present diagonal lines and/or checkerboard structures; Drift patterns, when there is fading in the corners, for systems which are non-stationary; Disrupted patterns, for extreme (and rare) events, when white bands are present, indicating transitions. Furthermore, small-scale patterns can also be characterized, as in the case of isolated points, which is an expression of quickly changing/fluctuating states. Diagonal and vertical lines are important structural elements of RPs, creating the basis for its quantification. Diagonal lines appear when two parts of the phase space trajectory run parallel for some time, whereas vertical or horizontal lines occur when the system either does not change or it changes slowly [38]. Moreover, Zbilut and Webber [23] introduced measures based on the information extracted from the RPs to quantify dynamical features of the data. Recurrence quantification analyses (RQA) provide a characterization of the type of dynamics present in the system (e.g. periodic, chaotic) [21, 40]. RPs and RQA were obtained through the CRP toolbox (v. 5.17) developed by Norbert Marwan for MATLAB (MATLAB 7.10.0) [34]. The toolbox can be found at http://tocsy.pik-potsdam.de/CRPtoolbox/.

### Recurrence quantification analysis

RQA comprises many quantitative diagnostics of the distribution of dots (actually pixels) in a recurrence plot to provide quantification of important aspects revealed through the RPs in detail. We choose five measures to examine our data: Recurrence rate (RR), Determinism (DET), Entropy (ENT), Laminarity (LAM) and Trapping Time (TT). The recurrence rate (RR) is the probability of finding a black recurrence point (for which **R**_{i,j} = 1), or
where *N*^{2} is the total number of pixels (black or white) in a RP [21]. Recurrence rate uses the same definition of the correlation sum, which does not include the main diagonal line, being related with to probability that a specific state will recur. Higher RR (for the same value of the *ε* parameter) would indicate that there are only few overall changes in the dynamics of the responses over time and that performance is confined to few different states.

Determinism (DET) measures the percentage of points in an RP belonging to diagonal lines, indicating deterministic components in the recurrence plot [21]. The DET measure is calculated by,
the *l*_{min} is the minimum and the *l*_{max} is the maximum length allowed for a diagonal line. *P*(*l*) = {*l*_{i}; *i* = 1,2, …, *N*_{l}} is the frequency distribution of the lengths *l*_{i} of diagonal lines, and *N*_{l} is the absolute number of diagonal lines, except for the main diagonal line [21]. The higher the DET value, more it reflects the predictability of the system over time. We can also compute estimates for the *Shannon entropy* (ENT),
where
is the probability distribution of the diagonal line lengths. The ENT reflects the complexity of the deterministic structure present in a system [21]. Higher entropy would indicate more inherent complexity of the corresponding time series, e.g. for uncorrelated noise the value of ENT would be rather small, indicating its low complexity. Laminarity (LAM) is the percentage of RP points forming vertical lines, or of these laminar phases,
where *v*_{min} is the minimum lengths of a vertical line and *v*_{max} is the maximum vertical length. Analogously to diagonal lines, we can obtain the frequency distribution of the lengths *v*_{i} of vertical lines *P*(*v*) = {*v*_{i}; *i* = 1,2, …, *N*_{v}}, where *N*_{v} is the absolute number of vertical lines. LAM represents the occurrence of laminar states in the system without describing the length [21]. Moreover, we calculated the trapping time (TT) that is the average length of a vertical line, it’s given by
TT estimates the mean time that the system will remain at a specific state or how long the state will be trapped [21].

There are different ways into how to apply RQA, mostly based in order of magnitude (large and small scale) and data format (e.g. networks, time series). Here, we applied a global time series approach for each individual replicate. The global time series approach focuses on a large scale encompassing the entire time series with the five chosen RQA measures been extracted from it.

#### Recurrence parameters.

The recurrence plots and the corresponding recurrence analysis used in the experiments might be affected by the chosen parameters from each time series and the embedding parameters affecting the quality of the phase space reconstruction, namely, time delay *τ*, embedding dimension *m* and the threshold value *ε*. The time delay *τ* determines the predictability of the components in the reconstructed vectors of the system state [21]. It should be chosen in a way such that the elements in the embedding vectors are no longer correlated. We estimate the time delay as the one where average mutual information reaches its first minimum [41]. The embedding dimension *m* determines the number of the components in the reconstructed vector of the system state. It should be large enough to unfold the system trajectories from self-overlaps, but not too large as the noise will be amplified. We employ the false nearest neighbor (FNN) method as suggested by Kennel et al. [42] to determine a good value for our system. The threshold value *Ɛ* was defined accordingly to each time series recurrence plot, it was chosen using the value that corresponds to 10% of the maximum phase space diameter of the data [20]. Through the methods exposed here, the recurrence measures were stipulated in such a way that the embedding dimension and the time delay for all the time series were defined with the value of three. The threshold value was defined individually according to each time series (i.e: threshold median value and interquartile range: *G*. *striatula* 0.71 (0.12); *L*. *micans* 0.74 (0.11); *P*. *rudigenis* minors 0.79 (0.16); *P*. *rudigenis* majors 0.74 (0.09); *T*. *molitor* 1.23 (0.29).

#### Surrogate data and statistical tests.

We compared each time series original data with a shuffled surrogate, which is a common approach used for validation of results in time-series analysis [43]. In the context of RQA, significant differences between the RQA measures of the data and its surrogates could be indicative of a strong deterministic component (not deterministic in the mathematical sense, but meaning that the dynamics is not simply stochastic) with the absence of spurious elements present by the system, as well as indicating non-stationarity [21, 44]. It should be made clear that determinism in the RQA context actually reflects the predictability of the system over time. It is indeed possible for a stochastic process to produce such patterns in the RQA terminology [39], and one should not conclude that the process is “deterministic” in the usual sense. In order to create the surrogate time series, we shuffled the data *x*(*n*) randomly choosing a pair of points from the data chain and randomly exchanged the positions of such points for each trial. The procedure has been repeated *N* times, where *N* is the number of data points. This shuffling preserves the statistical distribution of the data (e.g. mean, variance) but destroys the phasic time-correlated information in the dynamics. This leads to an empirical distribution of the RQA measures under the null-hypothesis of independence in time and an identical distribution. Given that normality was not met for the RQA measures obtained based on a preliminary Lilliefors test [45], we used the two tailed Mann-Whitney non-parametric rank sum test for independence [46] to compare the recurrence measures between the original data for each species and it is corresponding shuffled data (with *p*≤0.05). The comparison between species was made by the Kruskal-Wallis test [47]; it is also a non-parametric one-way analysis of variance by ranks for testing equality of three or more population medians. The pairwise differences between the species were tested using the Dunn’s test (1964). The null hypothesis for each pairwise comparison is that the probability of observing a randomly selected value from the first group that is larger than a randomly selected value from the second group equals one half; this null hypothesis corresponds to that of the Wilcoxon-Mann-Whitney rank-sum test. Statistical analyses were performed by the R software v. 3.2.3 (R Core Team 2015 [48]) using the dunn.test package [49].

## Results

We obtained a series of RQA global measures (*n* = 750) and individual RPs (*n* = 75) from a total of 150 time-series. The results highlight similarities and disparities between the activity dynamics of each species. Due to the topological nature of recurrence plots, we can also infer by visual inspection of RPs some of the features presented by all species and some particularities of them (Fig 2). All RPs showed several white bands, characterizing non-stationarity due to transitions. RPs showed diagonal and horizontal structures for almost all the species, supporting the hypothesis of a deterministic content present in the data. Furthermore, the RPs did not show homogeneous topologies, clearly rejecting the idea of a random process for most of the species. However, *P*. *rudigenis* had relatively short lines and isolated dots, indicating heavy fluctuation in the activity dynamics. This can imply the existence of uncorrelated random motions or even anti-correlated process. The RPs of *T*. *molitor* (Fig 2) have substantial phases of inactivity (black clusters) with a few sparse bouts of activity (white clusters), which is consistent with the influence of a deterministic quasi-periodic pattern.

Each species had a characteristic recurrence plot pattern, here demonstrate by representative time series (approximately 2400 points; equivalent to 7200 seconds) with measures near the median RQA values from the replicates. The species are *Gnamptogenys striatula* (a), *Linepithema micans* (b), *Pheidole rudigenis* minor (c) and major subcaste (d), and *Tenebrio molitor* (e). In the RP’s, white dot are maximum distance and black dots are minimum. Estimated parameters: Dimension = 3, Time delay = 3 and the Threshold values were variable with each time series and are signalled in each RP.

We compared the global RQA measures of the original data matching the shuffled ones. In general, the surrogate data possess lower significant values of the RQA measures compared to the original data, with the exception of RR in *P*. *rudigenis* majors (Table 1). Differences between normal and surrogate data were usually higher in *G*. *striatula* and *L*. *micans*, with a typical percentage change between 38% and 86%. Differently, *P*. *rudigenis* and *T*. *molitor* had a percentage change of 7.3% to 88%. A higher percentage difference between the time series and their corresponding surrogates could indicate a more significant effect of the RQA values (i.e. higher differences of DET suggests a time series with strong predictable dynamics over time).

Recurrence rate (RR), determinism (DET), entropy (ENT), laminarity (TT) and trapping time (TT) of the original and surrogate data (_{surr}).

RQA measures were also compared between species (Table 2). *Tenebrio molitor* presented significant higher RQA measures than the ants, however, these results alone must not be interpreted as a display of higher complexity. The ant species *G*. *striatula* and *L*. *micans* had in general significant RQA measures when compared with *P*. *rudigenis* (in the RR and DET values, only significant compared to the majors), whereas both *P*. *rudigenis* worker castes presented the lower results among all of the species. The worker castes of *P*. *rudigenis* differ significantly in the LAM values, where the *P*. *rudigenis* minors have higher RQA measures compared to the *P*. *rudigenis* majors (Table 2).

## Discussion

To the best of our knowledge, the present study provided the first application of recurrence analysis to the study of animal activity, as well as one of the first applications to biological phenomena outside the study of physiological and cardiac rhythms. The implications of our study are threefold. First, we found substantial differences between the activity dynamics of the gregarious beetles and the highly complex social ant species, with the results suggesting that the beetles have quasi-periodic dynamics and the ants do not. Second, workers from the different ant species varied with respect to their dynamics, presenting a degree of predictability as well as stochastics signals. Finally, differences were found among minor and major caste of the same (dimorphic) ant species. Each of these issues will be discussed in turn.

The activity pattern observed in the flour beetle *T*. *molitor* was characterized by the presence of periodic short bursts of activity, interspersed with longer periods of quiescence, as indicated by the extremely high values of vertical lines measures (LAM and TT). This could be also verified by the presence and consistency of wide laminar states of inactivity within the RPs (i.e. black clusters). The underlying causes of this behavior are still poorly known, but one possibility is that it is an involuntary response to the non-optimal conditions. In general, *T*. *molitor* is more inactive during daylight [50], normally evading natural light in search of darker areas [51]. The presence of long lines with different distances to each other in the RPs of *T*. *molitor* suggests a quasi-periodic dynamic (several frequencies in the system, whose ratios are irrational). Conversely, the time series of ants were more dynamic, composed by diagonal and horizontal structures from the RPs, RQA measures significantly higher in general than the shuffled time series but mixed with stochasticity (i.e. white-noise like pattern from the RPs, mostly present in *P*. *rudigenis*). Such patterns could be a result of noisy deterministic signals (i.e. in terms of predictability) or even low-dimensional deterministic chaos. Noise is extrinsic, it may come from various sources, such as uncertainties in the parameters of the system, fluctuations in parameters we do not have access (e.g. influence of the environment). Determinism is intrinsic, since it comes from the underlying dynamics of the system being studied. In biological systems, it is very likely that stochastic (noisy) behavior is always present, since there are always environmental factors acting on the system in an unpredictable and seemingly random fashion. One example would be the effect of the mutual interactions among the insects, which although of weak intensity, can affect randomly the behavior of individuals. Discriminating between noise and chaotic patterns in the RPs is not a trivial task [39]. Thus, here we limit to discuss what the presence of the observed patterns in the time series could mean in the context of ant behavior. Although the behavior of an organism may appear to be quite variable, the behavioral phenotype may be considerable less variable if a degree of predictability is present as we observed in the ant species. Since movement activity is closely related with other kinds of behavior, such as locomotion, patrolling (scouting), feeding or mating, all these behaviors may also display evidence of noisy deterministic signals. Furthermore, there is evidence from workers of the ant *Camponotus fellah* that single individuals are more active when isolated than at higher densities [52]. Some tasks, such as patrolling/scouting and foraging, which could be envisioned as information gathering processes outside the nest [53], also probably are composed by this kind of "hyperactive” behavior in isolated ants. Likewise, ants need to also respond to the cues provided by nestmates in a variety of contexts, from the recruitment during foraging to colony-level alarm behavior, for ensure the survival of the colony and its ergonomic efficiency [54–55]. Therefore, it is not surprising that ant activity patterns are more complex than those of solitary or even a gregarious species such as *T*. *molitor*.

There were interesting differences in activity patterns within the different ant species. For instance, both *L*. *micans* and *G*. *striatula*, which are monomorphic species, had higher RR and DET values. In monomorphic species, all colony tasks are performed by workers of equivalent morphology, with specialization only being possible through behavioral or age differences among workers [56]. On the other hand, in species with a dimorphic worker caste, some workers are morphologically adapted to specific tasks (e.g. colony defense, seed milling) whereas other workers can focus on more quotidian tasks, such as nest maintenance and brood care [53, 56–59]. Such differences are probably reflected in their intrinsic propensity to respond to specific cues in a way that is different from a colony with monomorphic workers. Indeed, in *P*. *rudigenis*, a species with polymorphic workers, both castes showed the lower RQA measures compared with the other species, with major caste presenting yet lower RQA values than the minor caste. Given that major workers in *P*. *rudigenis* probably play an important role in colony defense, the types of cues that they should respond are more stochastic or unpredictable in nature (e.g. encountering a forager from a competing colony or a predator). Thus, an activity behavior with a more unpredictable dynamic could be more adaptive given that randomness or chaotic behavior is an efficient response to environmental unpredictability, as explored in mathematical models based of ant behavior [3, 60–61]. Alternatively, the differences between castes could reflect the counterpart aspects of the intrinsic division of labor in a dimorphic species.

The search and interpretation of complex patterns in biological systems is an ambitious task and must be made with caution. Through our reductionist methodological approach using recurrence analysis, we propose the use of several RQA measures in conjunction with RPs, for a more consistent and comprehensive interpretation of the results. The possible use of recurrence analyses in the study of animal behavior are vast, from the interpretation of transitions within time series to the detection of synchronization and network complexity expect it to be an important tool in new empirical studies. Furthermore, the present study is among the first studies measuring individual complexity with comparison between species. The data generated by this kind of analysis could be interesting for behavioral ecologists as to physicists and correlated fields interested in the modelling and theoretical investigations of biological complex systems. The recurrence analysis permits further investigations to understand deeply patterns within time series. For instance, preliminary results indicate a progress to a more deterministic behavior with increasing densities, however by very different processes [62]. Our first study using recurrence plots and recurrence quantification analysis in animal behavior suggests that the activity dynamics of ants are composed by a plethora of complex patterns that ranges from stochastics signals and degrees of predictability.

## Supporting information

### S1 File. Dataset of the time series of movement activity.

This dataset (Excel workbook format) is composed by the analyzed time series (normalized to zero-mean and standard deviation of one) of the activity dynamics of single individuals from all the species used in this study. The original x and y coordinates and non-normalized data are provided as well.

https://doi.org/10.1371/journal.pone.0185968.s001

(ZIP)

## Acknowledgments

We are grateful to R. Feitosa and A. Ferreira from the Laboratório de Sistemática e Biologia de Formigas (UFPR) that assisted in the identification of the studied ant species. For the recurrence analysis, we have used the CRP Toolbox for Matlab, developed and made available for us by Dr. N. Marwan, available on the internet at http://tocsy.pik-potsdam.de/CRPtoolbox/.

## References

- 1. Cole BJ, Is animal behaviour chaotic? Evidence from the activity of ants. Proc Roy Soc Lond B Bio. 1991a;244: 253–259.
- 2. Cole BJ. Short-term activity cycles in ants: A phase-response curve and phase resetting in worker activity. J Insect Behav. 1991b;4: 129–137.
- 3. Solé RV, Miramontes O, Goodwin BC. Oscillations and chaos in ant societies. J Theor Biol. 1993;161: 343–357.
- 4. Cole BJ. Short-term activity cycles in ants: age-related changes in tempo and colony synchrony. Behav Ecol Sociobiol. 1992;31: 181–188.
- 5.
Cole BJ. Fractal time in animal behaviour: the movement activity of
*Drosophila*. Anim Behav. 1995;50: 1317–1324. - 6.
Miramontes O. Complexity and Behaviour in Leptothorax Ants. M.Sc. Thesis, Open University, UK, 1992. http://scifunam.fisica.unam.mx/mir/TS0001EN.pdf
- 7. Boi S, Couzin ID, Del Buono N, Franks NR, Britton NF. Coupled oscillators and activity waves in ant colonies. Proc Royal Soc B-Biol Sci. 1999;266: 371–378.
- 8.
Lone SR, Sharma VK. Timekeeping through social contacts: Social synchronization of circadian locomotor activity rhythm in the carpenter ant
*Camponotus paria*. Chronobiol Int. 2011;28: 862–872. pmid:22080731 - 9. Christensen K, Papavassiliou D, de Figueiredo A, Franks NR, Sendova-Franks AB, Universality in ant behaviour. J R Soc Interface. 2014; 12: 20140985. pmid:25411406
- 10. Wilson EO. The sociogenesis of insect colonies. Science. 1985;228: 1489–1495. pmid:17831241
- 11. Grimaldi D, Agosti D. A formicine in New Jersey Cretaceous amber (Hymenoptera: Formicidae) and early evolution of the ants. P Natl Acad Sci USA. 2000;97: 13678–13683. pmid:11078527
- 12. Korb J, Heinze J. Multilevel selection and social evolution of insect societies. Naturwissenschaften 2004;91: 291–304. pmid:15241605
- 13. Brodin T. Behavioral syndrome over the boundaries of life-carryovers from larvae to adult damselfly. Behav Ecol. 2009;20: 30–37.
- 14. Biro PA, Beckmann C, Stamps JA. Small within-day increases in temperature affects boldness and alters personality in coral reef fish. Proc R Soc Lond B. 2010;277: 71–77. pmid:19793748
- 15. Réale D, Garant D, Humphries MM, Bergeron P, Careau V, Montiglio PO. Personality and the emergence of the pace-of-life syndrome concept at the population level. Philos T R Soc B. 2010;365: 4051–4063. pmid:21078657
- 16.
Chapman BB, Hegg A, Ljungberg P. Sex and the syndrome: individual and population consistency in behaviour in rock pool prawn,
*Palaemon elegans*. PLoS One. 2013;8: e59437. pmid:23555034 - 17. Sweeney K, Cusack B, Armagost F, O’Brien T, Keiser CN, Pruitt JN. Predator and prey activity levels jointly influence the outcome of long-term foraging bouts. Behav Ecol. 2013;24: 1205–1210. pmid:23935257
- 18. Dell AI, Bender JA, Branson K, Couzin ID, Polavieja de GG, Noldus LPJJ, et al. Automated image-based tracking and its application in ecology. Trends Ecol Evol. 2014;29: 417–428. pmid:24908439
- 19. Webber CL Jr., Marwan N, Facchini A, Giuliani A. Simpler methods do it better: Success of Recurrence Quantification Analysis as a general purpose data analysis tool. Phys Lett. A. 2009;373: 3753–3756.
- 20. Eckmann JP, Kamphorst SO, Ruelle D. Recurrence plots of dynamical systems. Europhys Lett. 1987;5: 973–977.
- 21. Marwan N, Romano MC, Thiel M, Kurths J. Recurrence Plots for the Analysis of Complex Systems. Phys Rep. 2007;438: 237–329.
- 22. Guimarães-Filho ZO, Caldas IL, Viana RL, Kurths J, Nascimento IC, Kuznetsov YK. Recurrence quantification analysis of electrostatic fluctuations in fusion plasmas. Phys Lett A. 2008;372: 1088–1095.
- 23. Webber CL Jr., Zbilut JP. Dynamical assessment of physiological systems and states using recurrence plot strategies. J Appl Physiol 1994;76: 965–973. pmid:8175612
- 24. Marwan N, Trauth MH, Vuille M, Kurths J. Comparing modern and Pleistocene ENSO-like influences in NW Argentina using nonlinear time series analysis methods. Clim Dynam. 2003;21: 317–326.
- 25. Holyst JA, Zebrowska M, Urbanowicz K. Observation of deterministic chaos in financial time series by Recurrence Plots, can one control chaotic economy? Eur Phys J B. 2001;20: 531–535.
- 26. Marwan N, Thiel M, Nowaczyk NR. Cross Recurrence Plot Based Synchronization of Time Series, Nonlinear Proc Geoph. 2002;9: 325–331.
- 27. Marwan N, Zou Y, Wessel N, Riedl M, Kurths J. Estimating coupling directions in the cardiorespiratory system using recurrence properties. Philos T Roy Soc A. 2013;371: 20110624.
- 28.
Lattke JE. Revisión del género
*Gnamptogenys*Roger en Venezuela (Hymenoptera: Formicidae). Acta Terramaris. 1990;2: 1–47. - 29.
Giraud T, Blatrix R, Poteaux C, Solignac M, Jaisson P. Population structure and mating biology of the polygynous ponerine ant
*Gnamptogenys striatula*in Brazil. Mol. Ecol. 2000;9: 1835–1841. pmid:11091319 - 30.
Lommelen E, Johnson CA, Drijfhout FP, Billen J, Wenseleers T, Gobin B, Cuticular hydrocarbons provide reliable cues of fertility in the ant
*Gnamptogenys striatula*. J Chem Ecol. 2006;32: 2023–2034. pmid:16902821 - 31.
Wild AL. Evolution of the Neotropical ant genus
*Linepithema*. Syst Entomol. 2009;34: 49–62. - 32.
Wild AL. Taxonomic revision of the ant genus
*Linepithema*(Hymenoptera: Formicidae). University of California Publications in Entomology. 2007;126: 1–151 2007. - 33.
Wilson EO.
*Pheidole*in the New World: a dominant, hyperdiverse ant genus. Cambridge: Harvard University Press; 2003. - 34.
MATLAB and Statistics Toolbox Release version 7.10.0 (2010) The MathWorks Inc, Natick, Massachusetts, United States.
- 35.
Branson K, Robie AA, Bender J, Perona P, Dickinson MH. High-throughput ethomics in large groups of
*Drosophila*. Nat methods. 2009;6: 451–457. pmid:19412169 - 36.
Bender JA, Simpson EM, Tietz BR, Daltorio KA, Quinn RD, Ritzmann RE. Kinematic and behavioral evidence for a distinction between trotting and ambling gaits in the cockroach.
*Blaberus discoidalis*. J Exp Biol. 2011;214: 2057–2064. pmid:21613522 - 37. Reid CR, Sumpter DJT, Beekman M. Optimisation in a natural system: Argentine ants solve the Towers of Hanoi. J Exp Biol. 2011;214: 50–58. pmid:21147968
- 38. Marwan N, Kurths J. Line structures in recurrence plots. Phys Lett A. 2005;336: 349–357.
- 39. Marwan N. How to avoid potential pitfalls in recurrence plot based data analysis. Int J Bifurcat Chaos. 2011; 21: 1003–1017.
- 40. Marwan N, Wessel N, Meyerfeldt U, Schirdewan A, Kurths J. Recurrence-plot-based measures of complexity and their application to heart-rate-variability data. Phys Rev E. 2002;66: 026702
- 41. Zbilut JP. Embeddings and delays as derived from quantification of recurrence plots. Phys. Lett. A 1992;171: 199–203.
- 42. Kennel MB, Brown R, Abarbanel HDI. Determining embedding dimension for phase-space reconstruction using a geometrical construction. Phys Rev. A 1992;45.
- 43. Theiler J, Eubank S, Longtin A, Galdrikian B, Farmer JD. Testing for nonlinearity in time series: the method of surrogate data. Physica D 1992;58: 77–94.
- 44. Riley MA, Balasubramaniam R, Turvey MT. Recurrence quantification analysis of postural fluctuations. Gait Posture 1999;9: 65–78. pmid:10575072
- 45. Lilliefors H. On the Kolmogorov–Smirnov test for normality with mean and variance unknown. J Am Stat Assoc. 1967;62: 399–402.
- 46. Mann HB, Whitney DR. On a Test of Whether one of Two Random Variables is Stochastically Larger than the Other. Ann Math Stat. 1947;18: 50–60.
- 47. Kruskal WH. Use of ranks in one-criterion variance analysis. J Am Stat Assoc. 1952;47: 583–621.
- 48.
R Development Core Team. R: A language and environment for statistical computing. Vienna, Austria: R Foundation for Statistical Computing; 2015. (url:http://www.R-project.org/)
- 49.
Dinno A. dunn.test: Dunn's Test of Multiple Comparisons Using Rank Sums. R package version 1.3.2. https://CRAN.R-project.org/package=dunn.test (accessed May 2016)
- 50.
Fondacaro JD, Butz A. Circadian rhythm of locomotor activity and susceptibility to methyl parathion of adult
*Tenebrio molitor*(Coleoptera: Tenebrionidae). Ann Entomol Soc Am. 1970; 63: 952–955. pmid:5449405 - 51.
Cotton RT. Notes on the biology of the meal worms,
*Tenebrio molitor*Linne and*T*.*obscurus*Fab. Ann Entomol Soc Am. 1927;20: 81–86. - 52. Koto A, Mersch D, Hollis B, Keller L. Social isolation causes mortality by disrupting energy homeostasis in ants. Behav Ecol Sociobiol. 2015;69: 583–591.
- 53. Adler FR, Gordon DM. Optimization, conflict, and nonoverlapping foraging ranges in ants. Am Nat. 2003;162: 529–543. pmid:14618533
- 54.
Hölldobler B, Wilson EO. The ants. Harvard, MA: The Belknap Press of Harvard University Press, 1990.
- 55. Nicolis SC, Deneubourg JL. Emerging patterns and food recruitment in ants: an analytical study. J Theor Biol. 1999;198: 575–592. pmid:10373356
- 56.
Öster GF, Wilson EO. Caste and ecology in the social insects, Princeton University Press, Princeton, 1978.
- 57.
Detrain C, Pasteels JM. Caste differences in behavioral thresholds as a basis for polyethism during food recruitment in the ant,
*Pheidole pallidula*(Nyl.) (Hymenoptera: Myrmicinae). J Insect Behav. 1991;4: 157–176. - 58.
Detrain C, Pasteels JM. Caste polyethism and collective defense in the ant
*Pheidole pallidula*: the outcome of quantitative differences in recruitment. Behav Ecol Sociobiol. 1992;29: 405–412. - 59.
Pie MR, Traniello JFA. Morphological evolution in a hyperdiverse clade: the ant genus
*Pheidole*. J Zool. 2007;271: 99–109. - 60. Deneubourg JL, Aron S, Goss SAPJM, Pasteels JM, Duerinck G. Random behaviour, amplification processes and number of participants: how they contribute to the foraging properties of ants. Physica D. 1986;22: 176–186.
- 61. Gordon DM, Goodwin BC, Trainor LE. A parallel distributed model of the behaviour of ant colonies. J Theor Biol. 1992;156: 293–307
- 62. Neves FM, Pie MR, Viana RL. Self-organization in the movement activity of social insects (Hymenoptera: Formicidae). AIP Conf Proc. 2012;1479: 658–661.