inst/examples/appendices/knit_sources/appendices_knit_.md

Autocorrelation performs particularly poorly on the examples in the text, falling on approximately the 1:1 line in the ROC curves. This example goes through the steps to demonstrate that in a sufficiently-frequently sampled timeseries, autocorrelation does contain some signal of early warning, it is simply a weaker signal than the corresponding analysis with variance, which in turn is weaker than the model-based approach. Bear in mind the purpose of this is to highlight this approach to quantifying uncertainty in the performance of warning signals as it is to choose the best indicator.

We begin by running the individual based simulation, supplied in our helper package, populationdynamics.

We compute the observed value of Kendall's tau for the autocorrelation computed in a moving window over the data. (The warningtrend function is just a wrapper for the base function cor.test, which handles different window sizes. The default uses half the length of the timeseries.)

While this gives us single value which is useful for statistical comparisons that follow, recall that it is more common to simply plot the autocorrelation computed in this manner, and the increase is just the visual pattern.

To bootstrap the estimate of tau, we need to be able to simulate under a null and test model. We use our models of a stable system and a system approaching a collapse to do this. We first estimate the model parameters from the data,

and then we can simulate some replicates

tidy up the data a bit; columns should be variables, not replicates Wickam (2007).

Now that we have replicates from each process, we can apply the warningtrend window_autocorr to each replicate

And gather and plot the results

Parallelization

Parallel code for the plyr command is straight-forward for multicore use,

Which works nicely (other than the progress indicator finishing early).

In principle, this can be parallelized over MPI using an additional function, seems to work:



cboettig/earlywarning documentation built on May 13, 2019, 2:07 p.m.