knitr::opts_chunk$set(echo = TRUE)

Introduction

This report documents applying the dynamic stability analysis to the Portal dataset [@Ernest_2019].

First, some setup for the environment:

library(portalDS)
library(dplyr)
library(ggplot2)

set.seed(42)
knitr::opts_chunk$set(
  fig.width = 10, 
  collapse = TRUE,
  comment = "#>"
)

Workflow

Data

We use data from the 8 control plots, up to the 2015 treatment-switch. Abundances are summed, and scaled according to the number of plots sampled in each census (sometimes, incomplete sampling occurred). Only species with at least 50% non-zero abundance across the time series were kept. Missing censuses had abundances imputed using linear interpolation for each individual species.

block <- make_portal_block(filter_q = 0.5)
str(block)

Analysis

We do not go through the full analysis here. Instead, see the Maizuru Dynamic Stability vignette or (eventual methdos write-up).

We specify a results file for storing the outputs of the analysis. The compute_dynamic_stability() function will check for the presence of individual output components and will skip them if they've already been computed.

results_file <- here::here("output/portal_ds_results_50.RDS")
results <- compute_dynamic_stability(block, results_file, id_var = "censusdate")
str(results, max.level = 1)
results_file <- here::here("output/portal_ds_results_50.RDS")
results <- readRDS(results_file)

Results

Abundance time series

plot_time_series(results$block)

Eigenvalues & Eigenvectors

Highlighted segments are the posterior estimates of regime shifts from Christensen et al. 2018.

plot_eigenvalues(results$eigenvalues, 
                 num_values = 3) %>% 
    add_regime_shift_highlight()
plot_eigenvectors(results$eigenvectors) %>% 
    add_regime_shift_highlight()

Singular values and SVD vectors

Again, highlighted segments are the posterior estimates of regime shifts from Christensen et al. 2018.

plot_svd_values(results$svd_decomp$d, 
                num_values = 3) %>% 
    add_regime_shift_highlight()
plot_svd_vectors(results$svd_decomp$u) %>% 
    add_regime_shift_highlight()

Volume contraction and total variance

plot_volume_contraction(results$volume_contraction) %>%
  add_regime_shift_highlight()
plot_total_variance(results$total_variance) %>%
  add_regime_shift_highlight()

Detailed Results

Eigenvectors over specific time spans

In the second half of the time series, there are 3 periods where the dominant eigenvalue is complex. Two of these periods also coincide with community shifts described in Christensen et al. 2018. Here we look at the dominant eigenvector in more detail:

lower_date <- as.Date(c("1999-01-12", "2003-09-17", "2009-08-13"))
upper_date <- as.Date(c("2000-01-12", "2004-09-17", "2011-01-15"))
plot_eigenvectors(results$eigenvectors) +
  scale_x_date(limits = c(lower_date[1], upper_date[1]),
               expand = c(0.01, 0))
plot_eigenvectors(results$eigenvectors) +
  scale_x_date(limits = c(lower_date[2], upper_date[2]),
               expand = c(0.01, 0))
plot_eigenvectors(results$eigenvectors) +
  scale_x_date(limits = c(lower_date[3], upper_date[3]),
               expand = c(0.01, 0))

References



ha0ye/portalDS documentation built on March 28, 2020, 1:21 p.m.