by Van Huong Le1, Rodrigo Vargas2
1Department of Plant and Soil Sciences, University of Delaware, Newark, DE, 19716, USA 2School of Life Sciences, Arizona State University, Tempe, AZ, USA
Corresponding author affiliation and e-mail:
Rodrigo Vargas
chool of Life Sciences, Arizona State University, Tempe, AZ, USA
This repository contains the source code to perform different simulation methods: the traditional Sequential Gaussian CoSimulation (SGCoSim) and copula-based cosimulation (CopCoSim). Here are two case studies using data of soil CO${2}$ efflux (i.e., the CO${2}$ efflux from soils to the atmosphere known as soil respiration) that are relevant for carbon cycle science.
- Data: this folder contains the data
- Functions: this folder contains the useful functions
- Scripts: this folder contains the scripts
- Results: this folder contains the results
- RProject_Simulations_1D.Rproj: This file is the R Project
- Data: this folder contains the data
- Functions: this folder contains the useful functions
- Scripts: this folder contains the scripts
- Results: this folder contains the results
- RProject_Simulations_2D.Rproj: This file is the R Project
The code has been tested using packages of:
-
R version 4.3.1
-
RStudio 2023.06.1
Opening the project RProject_Simulations_1D.Rproj with Rstudio. Then open all the scripts in the "scripts" folder. The scripts are run in the following order: 0_Getting_Started.R, 1_Selection_of_a_representative_training_dataset.R, 2_Application_of_stochastic_simulation_methods.R, 3_Evaluation_of_model_performance.R.
- 0_Getting_Started.R: This script installs and loads R packages, as well as loads functions from the functions folder.
- 1_Selection_of_a_representative_training_dataset.R: This script explores and calculates the univariate statistical properties and dependency relationships between variables, along with the temporal or spatial distribution of the variable of interest. It also calculates its autocorrelation function and applies the sampling method (i.e., acLHS) based on the data.
- 2_Application_of_stochastic_simulation_methods.R: This script models the characteristic functions of the variables using the SGCoSim and CopCoSim methods and performs the simulations.
- 3_Evaluation_of_model_performance.R: This script produces the final figures and evaluates the model performance.
Opening the project RProject_Simulations_2D.Rproj with Rstudio. Then open all the scripts in the "scripts" folder. The scripts are run in the following order: 0_Getting_Started.R, 1_Selection_of_a_representative_training_dataset.R, 2_Application_of_stochastic_simulation_methods.R, 3_Evaluation_of_model_performance.R.
- 0_Getting_Started.R: This script installs and loads R packages, as well as loads functions from the functions folder.
- 1_Selection_of_a_representative_training_dataset.R: This script explores and calculates the univariate statistical properties and dependency relationships between variables, along with the temporal or spatial distribution of the variable of interest. It also calculates its autocorrelation function and applies the sampling method (i.e., acLHS) based on the data.
- 2_Application_of_stochastic_simulation_methods.R: This script models the characteristic functions of the variables using the SGCoSim and CopCoSim methods and performs the simulations.
- 3_Evaluation_of_model_performance.R: This script produces the final figures and evaluates the model performance.
Source code to replicate figures in publication: "Copula-based Cosimulation for Simulating Temporal or Spatial Data in Biogeosciences "
By Van Huong Le and Rodrigo Vargas (in review)