phase.sync {synchrony} | R Documentation |
Phase synchrony of quasi-periodic time series
Description
Compute the phase synchrony between two quasi-periodic time series by quantifying their phase difference at each time step
Usage
phase.sync (t1, t2, nrands = 0, mod = 1, method = c("markov", "fft"),
nbreaks = 10, mins = FALSE, quiet = FALSE)
Arguments
t1 |
time series 1 in matrix format ( |
t2 |
time series 2 in matrix format ( |
nrands |
number of randomizations to perform (default is 0) |
mod |
flag to indicate whether to compute phase difference modulus |
method |
method to generate surrogate time series for Monte Carlo simulations.
This can be set to |
nbreaks |
number of bins to use to group the values in the time series.
Default is |
quiet |
Suppress progress bar when set to |
mins |
use local minima instead of local maxima to compute and the interpolate the phase. Default is
|
Details
Two time series are phase-locked if the relationship between their phases remains constant over time. This function computes the phase of successive local maxima or minima for each time series and then uses linear interpolation to find the phase at time steps that fall between local maxima/minima. A histogram can be used to determine if the distribution of the phase difference at each time step is uniform (indicating no phase locking) or has a clear peak (indicating phase locking).
Value
Returns a list containing Q.obs
, pval
, rands
,
phases1
, phases2
, deltaphase
, and icdf
:
Q.obs |
Phase synchrony ranging from 0 (no phase synchrony) to 1 (full phase synchrony) |
pval |
p-value of observed phase synchrony based on randomization test |
rands |
Monte Carlo randomizations |
phases1 |
|
phases2 |
|
deltaphase |
|
icdf |
Inverse cumulative distribution of Q values obtained from Monte Carlo randomizatons |
Author(s)
Tarik C. Gouhier (tarik.gouhier@gmail.com)
References
Cazelles, B., and L. Stone. 2003. Detection of imperfect population synchrony in an uncertain world. Journal of Animal Ecology 72:953–968.
Theiler, J., S. Eubank, A. Longtin, B. Galdrikian, and J. Doyne Farmer. 1992. Testing for nonlinearity in time series: the method of surrogate data. Physica D: Nonlinear Phenomena 58:77–94.
Examples
t1=runif(100)
t2=runif(100)
# Compute and interpolate phases using successive local minima
sync.mins=phase.sync(t1, t2, mins=TRUE)
# Compute and interpolate phases using successive local maxima
sync.maxs=phase.sync(t1, t2)
# Plot distribution of phase difference
hist(sync.mins$deltaphase$mod_phase_diff_2pi)