Timescale-specfic variance ratio (tsvr) package vignette

The tsvr package provides an implementation of a timescale-specific extension and generalization of the variance ratio of Peterson (1975). The variance ratio is used commonly in community ecology. The extension implemented in the tsvr package is described in detail by Zhao et al. (In prep). The tsvr package supports that paper and provides an implemetation of the tools developed there for anyone to use. The mathematical formulas for the variance ratio and extensions are detailed elsewhere (Peterson 1975; Hallett et al. 2014; Zhao et al. In prep). The mathematics are also summarized here, but the main purpose of this vignette is to provide a decription of how to use the tsvr package.

Preparing data

A typical dataset for analysis using tsvr is an N × T matrix of nonnegative numeric values where rows correspond to species in a community (so the number of species is N) and columns correspond to evenly spaced times during which sampling was conducted (so the number of times sampling was conducted is T). Matrix entries may be densities, or percent cover values for plant species within a quadrat, or biomasses, or other measures of abundance of the species. For instance:

library(tsvr)
class(JRGdat)
## [1] "data.frame"
names(JRGdat)
##  [1] "year"                        "agoseris.heterophylla"      
##  [3] "astragalus.gambelianus"      "bombycilaena.californica"   
##  [5] "brodiaea.sp"                 "bromus.berteroanus"         
##  [7] "bromus.hordeaceus"           "calandrinia.ciliata"        
##  [9] "calycadenia.multiglandulosa" "castilleja.densiflora"      
## [11] "chlorogalum.pomeridianum"    "crassula.connata"           
## [13] "elymus.multisetus"           "epilobium.brachycarpum"     
## [15] "hemizonia.congesta"          "hesperevax.sparsiflora"     
## [17] "lasthenia.californica"       "layia.platyglossa"          
## [19] "lepidium.nitidum"            "lotus.wrangelianus"         
## [21] "microseris.douglasii"        "nassella.pulchra"           
## [23] "plantago.erecta"             "poa.secunda"                
## [25] "trifolium.albopurpureum"     "trifolium.sp"               
## [27] "vulpia.microstachys"
d<-t(as.matrix(JRGdat[,2:dim(JRGdat)[2]]))
dim(d)
## [1] 26 28

Here d is a 26 × 28 matrix containing percent cover measurements for each year from 1983 to 2010 for 26 species which occurred in a 1 m2 plot in the Jasper Ridge Biological Preserve serpentine grassland site. Species names are in the row names of JRGdat, which is an example dataset embedded in the tsvr package. Documentation for the dataset can be viewed via ?JRGdat. See (Hallett et al. 2014) for details of the Jasper Ridge ecosystem and of these and other related data.

Standard implementations of Fourier transforms require time series consisting of measurements taken at evenly spaced times, with no missing data. The core functions provided in tsvr make these same assumptions and throw an error if data are missing. The user is left to decide on and implement a reasonable way of filling missing data, if data are missing. We have previously used the simple approach of replacing missing values in a time series by the median of the non-missing values in the time series (Sheppard et al. 2016). This approach, and other related simple procedures (Sheppard et al. 2016), seem unlikely to artefactually produce significant synchrony, or coherence relationships with other variables, but rely on the percentage of missing data being fairly low and may obscure detection of synchrony or significant coherence relationships if too many data are missing. For applications which differ meaningfully from the prior work for which the tools of this package were developed (Zhao et al. In prep), different ways of filling missing data may be more appropriate.

The timescale-specific variance ratio techniques which are the focus of this package use Fourier methods to decompose by timescale the classic variance ratio and related quantities. Detrending and variance standardization across time series, techniques which are often applied before doing Fourier analysis, may not be approriate except in cases for which it makes sense to calculate the classic variance ratio and related quantities after performing those techniques.

The lack of a timescale-specific Loreau-de Mazancourt variance ratio

It is difficult to envision an analogous timescale-specific version of the Loreau-de Mazancourt approach. The quantity $\text{CV}_{\text{pop}}^2=\left(\sum_i \sqrt{\operatorname{var}_t (x_i(t))}\right)^2/(\operatorname{mean}_t(x_{\text{tot}}(t)))^2$ cannot be decomposed by replacing the variances in the numerator by power spectra because of the square root.

Acknowledgements

This material is based upon work supported by the National Science Foundation under grant numbers 1714195 and 1442595, by the James S McDonnell Foundation, and by a working group grant from the Long Term Ecological Research Network Communications Office of the National Center for Ecological Analysis and Synthesis. Any opinions, findings, and conclusions or recommendations expressed in this material are those of the authors and do not necessarily reflect the views of these funders. We thank all users of the package who have reported or will later report ways in which the package could be improved.

References

Hallett, LM, JS Hsu, EE Cleland, SL Collins, TL Dickson, EC Farrer, LA Gherardi, et al. 2014. “Biotic Mechanisms of Community Stability Shift Along a Precipitation Gradient.” Ecology 95: 1693–1700.
Loreau, M, and C de Mazancourt. 2008. “Species Synchrony and Its Drivers: Neutral and Nonneutral Community Dynamics in Fluctuating Environments.” American Naturalist 172: E48–66.
Peterson, CH. 1975. “Stability of Species and of Community for the Benthos of Two Lagoons.” Ecology 56: 958–65.
Sheppard, LW, J Bell, R Harrington, and DC Reuman. 2016. “Changes in Large-Scale Climate Alter Spatial Synchrony of Aphid Pests.” Nature Climate Change 6: 610–13.
Zhao, L, S Wang, L Hallett, A Rypel, MCN Castorani, LG Shoemaker, KL Kottingham, K Suding, and DC Reuman. In prep. “Decomposition of the Variance Ratio Illuminates Timescale-Specific Population and Community Variabilty.” In Prep.