Population Synchrony

Jose Lopez-Collado

MAY, 2017

One problem is determine if two populations i,j are synchronized in time. estimating the temporal correlation gives a measure of how much the population are synchronized. Because the populations grow and decline in time, a better way to measure the synchrony is by assessing the growth rates (Bjornstad et al. 1999a). A package in R provides more ways to compute the synchrony among populations (Gouhier & Guichard, 2014).

The variable z = log(Nt) - log(Nt -1) measure the difference between population N at times t and t-1, that is, succesive observations. Emphasis is about change in the population abundance. t is the time series, t= 1, ..., T + 1. Therefore, there are T growth rates.

The cross correlation coefficient, r, is

r = Cov(zi, zj)/ (SD(zi)*SD(zj))

Where Cov(zi,zj) is the covariance between zi and zj, and SD is the square root of the variance of z.

Because the observations are time-dependent, it is not appropriate to use the normal statistical tests, thus, it has been suggested to build a confidence interval for r by mean of bootstraping or by randomization (Bjornstad et al. 1999b; Liebhold et al., 2004).

The data to be analized correspond to the sampling in two sites of the spittlebug in Veracruz. The sites ares CALIF and OASI.

The data frame tb1.csv is:

> tb1

# A tibble: 15 × 3

JULDAY CALIF OASI

<fctr> <int> <int>

1 183 35 7

2 190 45 17

3 197 59 21

4 204 130 26

5 211 166 33

6 218 645 42

7 225 443 32

8 232 209 27

9 239 71 30

10 253 45 23

11 260 36 17

12 267 28 11

13 274 25 8

14 281 22 3

15 288 7 2

The abundance plot is (X = CALIF, Y= OASI). The plot shows that both population grow and decline at similar rates, yet the population abundance is different:

95% Bootstrap confidence interval and mean

Because the data table contains column names different to the datacorr table in the next script, it is necesary to change the column names, and the first column is not necessary:

tb1$JULDAY<- NULL

colnames(tb1)<- c("X", "Y")

Now assign the working table to the datacorr table in the script (see next code):

datacorr<- tb1

To compute a confidence interval for the spatial correlation between the two populations, the next script just do that.

It resample the data frame r times and computes the correlation coeficient, from which the mean and a 95% CI is constructed with the empirical distribution and their 0.0275 and 0.975 quantiles

#===============================================

#===============================================

# Function to compute the spatial autocorrelation

# it takes the difference of the log value of succesive observations in time

# then computes the correlation

#

func.SpatialCorr<- function(xv, yv){

# It is necessary to add one to avoid zeroes

xd<- diff(log(xv + 1));

yd<- diff(log(yv + 1));

rrxy<- cor(xd,yd);

return(rrxy)

}

# Because the observations are time-dependent, instead of

# performing a statistical test, build a confidence interval

# by mean of bootstrapping the data

# r is the number of bootstrap samples to analyze

bseed<- 170517

r<- 1000

#bootsize is the number of observations in the data frame

bootsize<- length(datacorr$X)

# xycorr is the vector which will contain the correlation coeficient estimates

xycorr<- rep(0,r)

# set the seed to control random number generation:

set.seed(bseed)

# the for loop iterates from i=1 to r to generate the r models and their respective parameters

for (i in 1:r) {

# get the bootstrape sample

bootsample<-datacorr[sample(nrow(datacorr),bootsize,replace=TRUE),]

# compute correlation and flush to the result vector

xycorr[i]<- func.SpatialCorr(bootsample$X,bootsample$Y)

}

# Compute some statistic derived from bootstrap:

statCorr<-c(mean(xycorr), quantile(xycorr,0.025), quantile(xycorr, 0.975))

# ==================END OF SCRIPT ===============

Once we run the script, r values are generated by bootstrap and they are stored in the xycorr vector; besides, statCorr contains the mean and the 95% confidence interval. Remember that to run the script, you have to write in the console:

source("bootCorrXY.R")

Now you can get the mean and the confidence interval:

> statCorr

2.5% 97.5%

0.8491732 0.6536745 0.9550679

The sampling distribution of the computed correlation indices, stored in the xycorr vector is:

Point estimate of the correlation coefficient

The point estimate of the correlation coefficient is:

pe1<- func.SpatialCorr(tb1$X,tb1$Y)

[1] 0.4405619

The scatter plot of the log(N + 1) differences is:

This plot show a positive correlation between the population X (CALIF) and Y (OASI), the mean correlation value is 0.84 (0.65, 0.95), therefore, the analysis show a significant correlation (synchrony) among the two populations.

Literature consulted

Bjornstad, O., Ims, R.A., Lambin, X. 1999a. Spatial population dynamics: Analyzing patterns and processes of population synchrony. Trend in Ecology and Evolution. 14, 427- 432.

Bjornstad, O.N., Stensetii, N.C., Saitoh, T. 1999b. Synchrony and scaling in dynamics of voles and mice in Northern Japan. Ecology. 890, 622-637.

Gouhier, T.C., Guichard, F. 2014. Synchrony: quantifying variability in space and time. Methods in Ecology and Evolution. 5, 524-533.

Liebhold, A., Koenig, W.D., Bjornstad, O.N. 2004. Spatial synchrony in population dyamics. Ann. Rev. Ecol. Evol. Syst. 35, 467-490.