Skip to content

A GitHub repository for the process rate estimator developed for the Sustainable Agroecosystems Group at ETH.

Notifications You must be signed in to change notification settings

Damian-Oswald/process-rate-estimator

Repository files navigation

🧪 Process Rate Estimator

This repository contains the source code and documentation for the process rate estimator. For a detailed (scientific) description of the process rate estimator, see Decock et al. (2022).

The project was done for the sustainable agro-ecosystems group at ETH Zurich. While the project documentation is presented on this website, the source code for the process rate estimator in contained in an R package called PRE. You can explore said package in this GitHub repository. Meanwhile, this repository contains the scripts for running the process rate estimator on some collected data as well as the source code for reproducing the documentation page.

📁 The repository structure

This repository contains:

  1. The source code for the documentation page: This repository contains the quarto documents necessary to render the documentation page (i.e., a bunch of .qmd and .yml files). Images, GIFs, bibliography etc. is in the /resources folder.
  2. The R scripts for running the process rate estimator: The R scripts in the folder /scripts run some part of the process rate estimator. Specifically, they (1) prepare the collected data appropriately (scripts/data-preparation), (2) find the best hyper-parameters (scripts/hypertuning), (3) run the process rate estimator itself (scripts/run-process-rate-estimator), (4) run the sensitivity and uncertainty analyses (scripts/sensitivity-analysis).

Note that the latter two are subdivided into scripts that perform the calculation and scripts that generate visualizations based on the output.

❓ How can I run the process rate estimator?

To run the process rate estimator, first install the R package PRE.1

remotes::install_github("https://github.com/Damian-Oswald/PRE")

After successful installation, you can clone this GitHub repository.

git clone https://github.com/Damian-Oswald/process-rate-estimator
cd process-rate-estimator

🌐 Reproducing the documentation site

The documentation site was built using the scientific publishing system Quarto. To reproduce the documentation, first install Quarto, then run quarto render to render the entire site.

🦠 Running the main script

After successful installation of the R package PRE and cloning of this repository, you can run the main script, which will reproduce the results for the process rate estimations.

Rscript scripts/run-process-rate-estimator/run-PRE.R

These results are also documented here.

🧮 Running the sensitivity analysis

To reproduce the sensitivity analysis (which is documented here), enter the following command:

Rscript scripts/sensitivity-analysis/sensitivitiy-analysis.R

Important

Running the sensitivity analysis R script is very compute intensive and may take a few days on an ordinary computer.

You can open the corresponding R script to change parameters such as SAMPLESIZE and SAMPLEREPEAT; however, doing this will change the exact numerical results.2

The results written by the sensitivity analysis are also used by the uncertainty analysis.

Footnotes

  1. This R package contains all functions that are repeatedly used throughout the workflow of this project. It's stored on its own GitHub repository.

  2. Although the expected results will not change.

About

A GitHub repository for the process rate estimator developed for the Sustainable Agroecosystems Group at ETH.

Topics

Resources

Stars

Watchers

Forks