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.
This repository contains:
- 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. - 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.
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
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.
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.
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
-
This R package contains all functions that are repeatedly used throughout the workflow of this project. It's stored on its own GitHub repository. ↩
-
Although the expected results will not change. ↩