Skip to content

Commit 96c1a52

Browse files
committed
updated Readme and added test version of template
1 parent 801627b commit 96c1a52

File tree

2 files changed

+86
-74
lines changed

2 files changed

+86
-74
lines changed

README.md

Lines changed: 86 additions & 74 deletions
Original file line numberDiff line numberDiff line change
@@ -1,118 +1,130 @@
1+
# {mocaredd}: Monte Carlo Simulations for REDD+ uncertainty analysis
2+
13
<!-- badges: start -->
4+
25
[![R-CMD-check](https://github.com/openforis/mocaredd/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/openforis/mocaredd/actions/workflows/R-CMD-check.yaml)
6+
37
<!-- badges: end -->
48

5-
**THIS TOOL IS UNDER DEVELOPMENT**
6-
**Current development version 0.3.0**
9+
#### {mocaredd} is a free and opensource application that aims at making simulation-based uncertainty calculations for REDD+ easier to process, report and verify.
10+
11+
It works by combining the strengths of spreadsheet tools (XLSX) for templating and a statistical language (R) for running the simulations, aggregating results and producing helpful visuals.
12+
13+
<!-- new section -->
14+
15+
## What for?
16+
17+
In the context of the REDD+ mechanism (Reducing emission from Deforestation and forest Degradation "plus"), countries can receive result-based payments for emission reductions and removal increases of greenhouse gas (GHG) from the forestry sector. Emission reductions are estimated by quantifying the amount of greenhouse gas emissions between a reference level (i.e baseline) and a monitorig period. These estimates come with a level of uncertainty due to the sampling methods and models used to generate the estimations.
18+
19+
High integrity REDD+ standards, that set rules for the quantification of emissions and removals, and their uncertainties, increasingly require the use of Monte Carlo simulations for REDD+ uncertainties. These simulations are often run in spreadsheet tools, but the lack of structure and inherent disadvantage of spreadsheets for this task (error prone, difficulty to handle large amount of data) is becoming a barrier for the quality, reproducibility and verification of uncertainties based on simulations.
20+
21+
{mocaredd} provides a template for organizing data, and a tool that takes the data, runs Monte Carlo Simulations and produces improved estimates of and confidence intervals around greenhouse gas emissions and emission reductions from the forestry sector (REDD+).
22+
23+
<!-- new section -->
24+
25+
## How to run the application ?
26+
27+
The application is available online (read-to-use) at: <https://openforis-shiny.shinyapps.io/mocaredd/>
28+
29+
It can also be installed for offline use (require installing R and Rstudio, may require administrator permission). The app require R version 3.4 minimum. RStudio is recommended as Integrated Development Environment. With Windows machines, Rtools should also be installed:
730

8-
<i>
9-
Features:
31+
- [https://cloud.r-project.org/]()
32+
- [https://posit.co/download/rstudio-desktop/]()
33+
- [https://cran.r-project.org/bin/windows/Rtools/]()
1034

11-
- Download a demo template with user inputs, time periods, land use change areas, carbon elements.
12-
- User filled template submission to the tool,
13-
- Verification of template integrity,
14-
- Build calculation chain from input data to greenhouse gas emission reductions (ER)
15-
- Calculate arithmetic mean ERs from input data
16-
- Run simulations for all variables and reproduce calculation chain for each simulation
17-
- Calculate the median of simulated ERs as a better estimate than the arithmetic mean
18-
- Calculate uncertainty as quantiles of simulations at the chosen level
19-
- Show medians and confidence intervals at intermediate level (REDD+ activities, activity data and emission factors)
35+
R and Rstudio are installed, open R studio and run the folloing code in the terminal:
2036

21-
Planned features:
37+
```
38+
if (!require(remotes)) install.packages("remotes")
39+
if (!require(mocaredd)) remotes::install_github("openforis/mocaredd@v1.0")
2240
23-
- Tutorial on filling in the template with examples for various country circumstances
24-
- Additional template tab and calculations for annual processes (removals, soil organic carbon degradation)
25-
- Sensitivity analysis for activity data vs emission factors, REDD+ activities, different land use changes
26-
</i>
41+
mocaredd::shiny_run_mocaredd()
42+
```
2743

44+
<!-- new section -->
2845

29-
# {mocaredd}: Monte Carlo Simulations for REDD+ uncertainty analysis
46+
## Step-by-Step app workflow
3047

31-
Contains functions and a shiny app for (1) setting up, (2) running Monte Carlo Simulations and (3) producing improved estimates of and confidence intervals around greenhouse gas emissions and emission reductions from the forestry sector.
48+
1. The app provides a template spreadsheet to download, either directly in the app or here (see Resources below):
3249

33-
The apps takes an input XLSX file following a specific template meant to harmonize reporting of areas of land use transitions and associated carbon stocks. It then provides simulations, medians, percentage uncertainties and confidence intervals at various stages of aggregation from emissions related land use transitions to REDD+ activities and emission reductions between reference and monitoring periods.
50+
2. The user fills in the spreadsheet 4 tabs:
3451

35-
\
52+
1. **User inputs** (user_inputs). Helps offering great flexibility with a minimum number of parameters.
3653

37-
### Run the app
54+
2. **Time periods** (time_periods). Describes the times periods covered by the data and how they are combined into reference or reporting.
3855

39-
#### Online (experimental)
56+
3. **Land use transitions** (AD_lu_transitions). Describes the probability density functions (PDFs) for the land use change areas for each time period
4057

41-
https://gaelsola.shinyapps.io/mocaredd/
58+
4. **Carbon stocks** (c_stocks). Contains the probability density functions for all the carbon elements necessary to associate emission or removal factors to all land use changes and time periods.
4259

60+
3. The user upload the filled template into the tool.
4361

44-
#### Locally on your computer.
62+
4. The app run checks:
4563

46-
Although a bit ore cumbersome, the installation of R and Rstudio is now straightforward for the mast majority of computers.
64+
1. verifies that all connections between time periods, land use changes and carbon elements are correctly entered,
4765

48-
The app require R version 3.4 minimum. RStudio is recommended as Integrated Development Environment.
49-
With Windows machines, Rtools should also be installed:
66+
2. provides an overview of the data (number of time periods, carbon pools, method for forest degradation, etc.),
5067

51-
- [https://cloud.r-project.org/]()
52-
- [https://posit.co/download/rstudio-desktop/]()
53-
- [https://cran.r-project.org/bin/windows/Rtools/]()
68+
3. calculates the arithmetic mean of aggregated emission reductions (no simulation yet).
5469

55-
Install the package and run the app:
70+
4. makes land use change matrices in ha.
5671

57-
if (!require(remotes)) install.packages("remotes")
58-
if (!require(mocaredd)) remotes::install_github("openforis/mocaredd@v0.3.0")
59-
60-
mocaredd::shiny_run_mocaredd()
72+
5. If all checks are passed, the app runs the simulations:
6173

74+
1. for each PDF, the determined number of simulations is randomly generated, then
6275

76+
2. the carbon accounting chain of calculations is created based on the data uploaded,
6377

64-
### Workflow
78+
3. the simulations are aggregated to emissions per land use change, emissions and removals per REDD+ activity and time period, emissions reduction and increased removals for each monitoring period in the data.
6579

66-
1. Input XSLX file following provided template.
67-
1. Checks are run to ensure the entity codes are unique and matching between tables.
68-
1. Simulations are produced and results can be seen as forest plots, simulations densities and comparison between simulations and arithmetic means for the final emission reductions.
69-
1. Sensitivity analysis shows the impact of AE vs EF, REDD+ activities, time periods.
80+
4. The improved estimates and their confidence intervals are reported as the median and quantiles of the simulations at each stage of the aggregation.
7081

82+
6. A sensitivity analysis is run to provide the respective contributions of REDD+ activities, activity data and emission factors, and time periods to the overall uncertainty.
7183

72-
### Calculation steps
84+
<!-- new section -->
7385

74-
1. Check that the template is followed correctly and that the tables are correctly linked (keys link time to land use changes and land use changes to carbon stock elements)
75-
2. Generate simulations for all probability distribution functions
76-
3. Calculate carbon stocks based on carbon stock elements reported.
77-
4. Calculate Emission factors for each land use change and time period
78-
5. Calculate Emissions from IPCC formula Eij = EFij x ADij for each land use change i and time period j.
79-
6. Aggregate Emissions per time period
80-
7. Aggregate Emissions for the reference and monitoring periods
81-
8. Calculate Emission Reductions as the difference between annualized emissions during the reference period and annualized emissions during each of the monitoring periods.
86+
## Resources
8287

88+
- Online app: <https://openforis-shiny.shinyapps.io/mocaredd/>
8389

84-
### Template
90+
- Online documentation: <https://openforis.github.io/mocaredd/>
8591

86-
(ADD Link to a template from github here)
92+
- Template guidelines: <https://openforis.github.io/mocaredd/articles/tuto-template.html>
8793

88-
The template includes 4 tabs:
94+
- Template simple (2 time periods, 12 land use changes classes, 2 carbon pools, inc. simulations in Excel for comparison): [Example2-with-sims.xlsx](https://docs.google.com/spreadsheets/d/19ySu_L4aI3tepq9FbYksbBa0yNi4s49c/edit?usp=sharing&ouid=104053208207168605668&rtpof=true&sd=true)
8995

90-
#### User inputs (user_inputs)
91-
They help offering great flexibility with a minimum number of parameters.
96+
- Template intermediate (4 time periods, 48 land use change classes, 4 carbon pools): [Example1-4pools.xlsx](https://docs.google.com/spreadsheets/d/1H9yfPCSfSELgW506OIHqS-15hJtTECHB/edit?usp=sharing&ouid=104053208207168605668&rtpof=true&sd=true)
9297

93-
- **trunc_pdf**: use truncated PDF to avoid negative simulated values were illogical (for ex. areas.). (Note for v2.0, currently only works for normal distributions).
94-
- **n_iter**: number of iterations. Most standards require 10,000 simulations.
95-
- **ran_seed**: rand seed for the simulation. If note specified, the first run sets a random seed and reports it for reproducing the same results.
96-
- Carbon stocks are reported following many different methods and pools, to allow flexibility the next user inputs provide ways to customize what is reported and how.
97-
- **c_unit**: for AGB abd BGB, is the unit dry matter (DM) or carbon (C)?
98-
- **c_fraction**: Carbon fraction to convert dry matter to carbon, if c_unit is "DM".
99-
- **c_fraction_se**: standard error of the carbon fraction
100-
- **c_fraction_pdf**: probability distribution function of the carbon fraction.
101-
- **dg_pool**: If degradation is a ratio of intact forest Cstock, list of pools separated by coma to which the ratio applies.
102-
- **dg_ext**: Extension used in the land use IDs for degraded land uses, for example if Evergreen forest is coded "EV" and degraded evergreen forest "EV_deg", dg_ext is "_deg". Necessary to automatically link intact forest carbon stock with its degradation ratio.
103-
- **ad_annual**: Is Activity Data reported annual or as a sum over the time period considered? (TRUE or FALSE).
104-
- **conf_level**: Confidence level (1 - alpha) for the uncertainty calculations.
98+
- Github repository: <https://github.com/openforis/mocaredd>
10599

100+
- Contact form: [Contact us](https://forms.gle/YZy4xmviSMvUT8DJ9)
106101

107-
#### Time periods (time_periods)
102+
<!-- new section -->
108103

109-
TBD
104+
## Planned features
110105

111-
#### land use transitions (AD_lu_transitions)
106+
- Improve the template guidelines with examples from real cases.
107+
- Improve the sensitivity analysis.
108+
- Develop the template tab and calculations for annual processes (removals, soil organic carbon).
109+
- Develop the template and calculations for bootstrap from raw data.
110+
- Add truncated PDFs support.
111+
- Add IPCC tier 1 uncertainties propagation around the arithmetic means.
112112

113-
TBD
113+
```{=html}
114+
<!--
114115
115-
#### Carbon stocks (c_stocks)
116+
Current features:
116117
117-
TBD
118+
- Download a demo template with user inputs, time periods, land use change areas, carbon elements.
119+
- User filled template submission to the tool,
120+
- Verification of template integrity,
121+
- Build calculation chain from input data to greenhouse gas emission reductions (ER)
122+
- Calculate arithmetic mean ERs from input data
123+
- Run simulations for all variables and reproduce calculation chain for each simulation
124+
- Calculate the median of simulated ERs as a better estimate than the arithmetic mean
125+
- Calculate uncertainty as quantiles of simulations at the chosen level
126+
- Show medians and confidence intervals at intermediate level (REDD+ activities, activity data and emission factors)
127+
- Show sansitivity analysis
118128
129+
-->
130+
```
53.5 KB
Binary file not shown.

0 commit comments

Comments
 (0)