Code Monkey home page Code Monkey logo

sparseinteractions's Introduction

SparseInteractions

This repository contains the R and stan scripts necessary to recreate the analyses presented in the manuscript "Disentangling key species interactions in diverse and heterogeneous communities: A Bayesian sparse modeling approach". It is organized into two folders. "BH_simulations" holds all the scripts and simulated .csv files necessary for testing the models using data simulated according to stochastic Beverton-Holt models of community dynamics. "Empirical" holds the data and scripts necessary to recreate the analyses on Waitzia acuminata and Arctotheca calendula from the Bendering and Perenjori nature reserves in southwest Australia. The "BH_simulations" folder is further subdivided into a "Main" folder with the scripts used for the analysis in the main paper, a "Box" folder with scripts exploring different underlying model structures, a "Tau-CI" folder with model scripts exploring different fixed values of tau and credible interval levels to determine parameter inclusion in the final model, and a "VariableAlphaRanges" folder containing simulations and model fits for communities with different underlying competitive hierarchies.

Most R scripts in the repository save output and load input generated from previous scripts. This is necessary as some of the Bayesian models take long enough to run that performing all model fits and subsequent analyses in a single script is untenable. To minimize problems encountered when running these scripts on different local computers, we use the "here" package to navigate within the file structure used in the repository. If attempting to run the analyses presented in this repository, we therefore recommend cloning the entire repository to maintain its file structure.

If, however, users are simply interested in modifying the sparse modeling approach we present for their own data, we do not recommend cloning the entire repository as it has many files necessary for our simulations and analysis that will not be relevant to users wishing to apply the model to different data. Instead, we suggest users copy the ModelFits.R, BH_FH_Preliminary.stan, and BH_Final.stan files from the empirical folder to modify for their needs. These three files are all that are necessary to implement a version of the sparse modeling approach, though they will need to be modified for use with other data or underlying model structures (e.g. Ricker or Lotka-Volterra instead of Beverton-Holt). As we intend for these files to be the primary ones used in modifying our approach for other datasets, these are also the most heavily commented versions of the model fitting files. Other model fitting files like those used for the simulations are more sparsely commented rather than repeating the same information as presented in the manuscript and for the empirical files.

sparseinteractions's People

Contributors

tpweiss06 avatar cmwerner avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.