/Extreme-events-LDA

Quantifying dynamics of rodent community at Portal, using LDA

Primary LanguageR

Extreme-events-LDA

"Long‐term community change through multiple rapid transitions in a desert rodent community"

This repo contains the analyses for my project on rodent community change, now published in Ecology: https://doi.org/10.1002/ecy.2373

Main Analysis Scripts:

  • rodent_LDA_analysis.R main script for analyzing rodent community change using LDA
  • rodent_data_for_LDA.R contains a function that creates the rodent data table used in analyses
  • AIC_model_selection.R contains functions for calculating AIC for different candidate LDA models
  • changepointmodel.r contains change-point model code
  • create_sim_data.R contains functions for creating simulated data, used in the manuscript supplement to demonstrate methods
  • LDA-distance.R function for computing Hellinger distance analyses
  • simulated_data_LDA.R LDA/changepoint analysis using simulated data, used in supplement to demonstrate methods

Figure Scripts:

  • NDVI_figure.R creates a timeseries of NDVI at the site from 1984-2015, to show periods of low resources (supplemental figure in manuscript)
  • abundance_plots.R contains code for plotting timeseries of total rodent abundance (Fig 2 in manuscript)
  • explanatory-figure.R code to create graphical representation of LDA model (supplemental fig in manuscript)
  • LDA_figure_scripts.R contains functions for making main plots in manuscript (Fig 1). Called from rodent_LDA_analysis.R
  • pie_plots_for_presentation.R creates pie plot of species composition at a given trapping time. Not used in manuscript, but I use it in various talks I've given

Data files:

  • Rodent_table_dat.csv table of rodent data, created by rodent_data_for_LDA.R
  • Monthly_Landsat_NDVI.csv NDVI data for portal from Landsat satellites

Folders:

  • preliminaryscripts includes code from the initial stages of the project that didn't end up getting used in the final product
    • abundance_plots_old.R is an old version of abundance_plots.R
    • gibbs_functions.R contains functions for doing the gibbs sampler version of LDA (as opposed to VEM method)
    • LDA_analysis.R early, incomplete version of rodent_LDA_analysis.R
    • LDA_confidence_intervals.R early version of LDA analysis, playing with gibbs sampler and credible intervals
    • rodent_abundance_histograms.R playing around with histograms of total rodent abundance, to show lowest abundance events
    • rodent_euclid_dist_plot.R plots rodent community change over time, paired with a picture of shrub growth at Portal. This figure was in the first version of the manuscript but not later versions
    • Thibault_2004_eucliddist.R playing around with the euclidean distance analysis from Thibault et al 2004