Random_ews_example

ENSO EWS

Let’s just see what happens with the MEI data for PDO:

dat <- read.table("https://www.carlboettiger.info/assets/data/mei.csv", header=TRUE)

For the moment let’s ignore annual structure and just collapse this into timeseries sampled bimonthly.

require(reshape2)
dt <- melt(dat, id="YEAR")
X <- dt$value
Z <- X[!is.na(X)]
Z <- data.frame(1:(length(Z)-1), Z[1:(length(Z)-1)])
png("mei.png")
require(earlywarnings)
a <- generic_ews(Z, detrending="gaussian")

How about the data from MacDonald (2005)

original data link

dat <- read.table("https://www.carlboettiger.info/assets/data/pdo-macdonald2005.csv", header=TRUE)
png("macdonald2005.png")
require(earlywarnings)
a <- generic_ews(dat, detrending="gaussian")
dev.off()