peaks {synchrony} | R Documentation |
Find the proportion of local minima/maxima common to both time series and compute its significance via Monte Carlo randomizations
Description
Find the proportion of local minima/maxima common to both time series and compute its significance via Monte Carlo randomizations
Usage
peaks (t1, t2, nrands = 0, type = 1, quiet = FALSE)
Arguments
t1 |
time series 1 in matrix format ( |
t2 |
time series 2 in matrix format ( |
nrands |
number of randomizations. Default is |
type |
Randomization method. The |
quiet |
Suppress progress bar when set to |
Value
Returns a named list containing:
pval |
p-value computed by randomly shuffling both time series |
rands |
proportion of local minima/maxima common to both time series for each randomization |
obs |
proportion of local minima/maxima common to both time series in the observed dataset |
index |
indices of local minima/maxima common to both time series in the observed dataset |
Author(s)
Tarik C. Gouhier (tarik.gouhier@gmail.com)
References
Buonaccorsi, J. P., J. S. Elkinton, S. R. Evans, and A. M. Liebhold. 2001. Measuring and testing for spatial synchrony. Ecology 82:1668-1679.
Purves, D. W., and R. Law. 2002. Fine-scale spatial structure in a grassland community: quantifying the plant's eye view. Journal of Ecology 90:121-129.
Examples
t1=runif(100)
t2=runif(100)
(p=peaks(t1, t2))