GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - CGIAR-Climate-Data-Hub/cattle-ghg-uncertainty: Cattle GHG Uncertainty Calculator: Monte Carlo (IPCC Approach 2) uncertainty analysis for Tier 2 cattle GHG inventories. Enteric CH4, manure CH4/N2O, IPCC Table 3.3 / UNFCCC outputs. Free R Shiny web tool, no coding required.

BranchesTags
Open more actions menu

Latest commit

 

History

607 Commits
607 Commits

Folders and files

NameName
Last commit message
Last commit date
.github/workflows
.github/workflows
 
 
R
R
 
 
config
config
 
 
defaults
defaults
 
 
documentation
documentation
 
 
reports
reports
 
 
rsconnect/shinyapps.io/mlolita26
rsconnect/shinyapps.io/mlolita26
 
 
scripts
scripts
 
 
translator_prompts
translator_prompts
 
 
www
www
 
 
.gitattributes
.gitattributes
 
 
.gitignore
.gitignore
 
 
.rscignore
.rscignore
 
 
.zenodo.json
.zenodo.json
 
 
CITATION.cff
CITATION.cff
 
 
CONTRIBUTING.md
CONTRIBUTING.md
 
 
LICENSE
LICENSE
 
 
README.md
README.md
 
 
VERSION
VERSION
 
 
app.R
app.R
 
 
install.R
install.R
 
 
runtime.txt
runtime.txt
 
 

Repository files navigation

IPCC Tier 2 Cattle GHG Uncertainty Calculator

Launch App Launch on Binder License: MIT R audit

A free, web-based cattle GHG uncertainty calculator for national inventory teams to quantify and report uncertainty in their IPCC Tier 2 emission estimates. Upload your country data, run 10,000 Monte Carlo simulations, and download results formatted directly for IPCC Table 3.3: no coding required. An in-app AI Translator turns raw country data files (in any shape, any language) into the strict input template before you analyse.

Who is this for. National GHG inventory compilers preparing Biennial Transparency Reports (BTRs), Biennial Update Reports (BURs) and National Inventory Reports (NIRs) under the UNFCCC Enhanced Transparency Framework (ETF) who need IPCC Approach 2 (Monte Carlo) uncertainty estimates for livestock, rather than Approach 1 error propagation. The tool implements the full IPCC 2006 Vol. 4 Ch. 10/11 Tier 2 equation chain for cattle (enteric fermentation CH₄, manure management CH₄ and N₂O, pasture deposition N₂O) and reports uncertainty in the IPCC 2006 Vol. 1 Ch. 3 Table 3.3 convention (95% margin of error as a percentage of the mean), split into activity-data, emission-factor and combined components.

Developed by the CGIAR Alliance of Bioversity International and CIAT, under the CGIAR Climate Action Programme Funded by Global Methane Hub (Grant R-2026-01051)


Run the app: no installation needed

There are two ways to open the app in a browser without installing R or writing any code.

Option A: shinyapps.io (recommended)

Fast, persistent, no waiting time. The app is live and ready.

Click the green Launch App badge above, or go to: https://mlolita26.shinyapps.io/cattle-ghg-uncertainty/

Option B: Binder (zero account, slower start)

Free, no account needed. First load takes 3–8 minutes while the environment builds. Subsequent loads are faster.

Click the launch binder badge above. Once the environment is ready, the app opens automatically in your browser.


What this tool does

When a country reports cattle greenhouse-gas emissions under the Paris Agreement, every input: animal populations, body weights, feed quality, emission factors, has uncertainty attached to it. This tool propagates that uncertainty through the full IPCC Tier 2 equation chain so you can report not just a single emission number, but a defensible confidence interval, complete with a sensitivity ranking of which parameters drive the spread.

Emission sources covered: Enteric fermentation CH₄ · Manure management CH₄ · Direct N₂O from managed manure · Indirect N₂O from managed manure (volatilisation + leaching) · Direct N₂O from pasture/range/paddock (PRP) · Indirect N₂O from PRP

Feature Detail
Methodology IPCC 2006 Guidelines Vol. 4 Ch. 10–11; 2019 Refinement supported
Simulation 10 000 Monte Carlo iterations (configurable)
Correlations Iman-Conover restricted pairing on Spearman rank correlations (IPCC Vol.1 Ch.3 §3.2.3.2), which preserves each marginal distribution exactly; preset, manual, or structural-default emission-factor correlation; optional bounded per-MMS allocation sampling with per-iteration renormalisation
Uncertainty decomposition Activity data vs. emission factors, side-by-side
Sensitivity analysis Standardised Regression Coefficients (SRC) and partial rank correlation (PRCC)
Trend uncertainty Multi-year Monte Carlo with year-to-year temporal correlation of EFs (IPCC Vol.1 Ch.3 §3.2.2.4)
Reporting output IPCC Table 3.3 formatted XLSX / CSV download; Word run summary
Input format Excel template with dropdowns, formulas, IPCC defaults, and colour-coded guidance
AI Translator Built-in chat panel converts raw country data (.xlsx / .csv, multi-sheet, mixed languages, messy units) into the strict template. Backed by Anthropic Claude (default claude-sonnet-4-6, overridable via the TRANSLATOR_MODEL environment variable), gated by magic-link email auth.
Example data Country X (hypothetical dairy) and Country Y (hypothetical pastoral): pre-loaded, no upload needed to explore

Tabs in the app

Tab Purpose
Home Overview, quick-start guide, funding logos
Resources (Definitions and glossary button) Plain-language glossary of every IPCC parameter, plus a glossary of the statistical terms (Monte Carlo, confidence interval, margin of error, SRC/PRCC) used across the tabs
Resources Methodology PDF, user-guide PDF, AI Translator chat panel, and links to the IPCC chapters
1. Data Input Pick an example or upload your filled Excel template; the parameter table shows every value with its distribution, uncertainty and bounds, read-only
2. QA/QC Automated traffic-light checks (bounds, IPCC defaults, fractions, units)
3. Correlations Upload a historical time series, pick a preset, or enter a manual correlation matrix
4. Simulate & Results Choose iterations + GWP version, run Monte Carlo, see histogram + 95 % CI + decomposition + per-system table
5. Sensitivity Tornado chart + ranking table (SRC and PRCC)
6. IPCC Report IPCC Table 3.3 output ready to paste into UNFCCC reporting; XLSX / CSV / Word download
Contact / Feedback Pre-filled email link + feedback form

AI Translator: turn raw country data into a ready-to-upload template

If your raw inventory data lives in your own Excel or CSV files with column names that don't match the template, the tool's in-app AI Translator does the column mapping, unit conversion (lbs/kg, L/kg, %/fraction, °F/°C, etc.), sub-category vocabulary resolution, and IPCC-default fill-in for any parameter you don't have country-specific data for.

Workflow. Open the Resources tab → the AI Translator card sits at the top. Sign in with your email (CGIAR addresses are auto-approved; other addresses require a one-time admin OK). Drop in your file. The AI reads every sheet and asks 2-5 clarifying questions. When you have answered them, click the green Produce template now button: that button is the only trigger for template emission (typing "go ahead" in the chat does not start it). The result is a downloadable .xlsx in the exact shape the Data Input tab expects.


Repository structure

Folders the running app needs are at the top and unchanged. Everything else is grouped by the work it belongs to.

cattle-ghg-uncertainty/
├── app.R, install.R, runtime.txt    # Shiny entry point, dependency installer, Binder R version
├── R/                               # All application source: UI, server, emission engine
│                                    #   (calc_*), Monte Carlo (mc_*), utilities (utils_*),
│                                    #   AI translator (chat_ui, anthropic_client, auth, history, usage log)
├── www/                             # Everything the app serves: logos, CSS, built guides (PDF/DOCX),
│                                    #   Find-out-more HTML pages, translator kit files
├── config/                          # translator sign-in whitelist (approved_users.example.csv shows the
│                                    #   shape; the real list is untracked and stays out of git)
├── defaults/                        # THE numbers the tool ships: defaults_master.csv (single authority),
│                                    #   baseline_defaults.csv (July 2026 values), provenance_register.md,
│                                    #   DEFAULTS_MASTER.md (readable rendering)
├── translator_prompts/              # AI translator prompt sources (generated .md carry a manifest)
│
├── documentation/
│   ├── source/                      # R Markdown sources of the user guide, methodology,
│   │                                #   correlations and translator pages (built into www/)
│   ├── team/                        # Documents written for the project team (assumptions note)
│   └── beta_test/                   # Beta-test package: sample inventory, feedback form, guide
├── ipcc_reference/                  # IPCC chapters we verified against (pdf/, text extracts in text/);
│                                    #   not in git, copyrighted
├── scripts/                         # Build, check and deploy tooling; audit.R is the test contract
├── reports/                         # Generated by scripts: AUDIT_REPORT, DEFAULTS_MATRIX, ALL_VALUES,
│                                    #   VALUE_CHANGES_FOR_REVIEW, PARAM_SWEEP
├── test_data/                       # Country inventories used in testing; not in git
├── runtime/                         # Written by the running app: conversation history, usage log,
│                                    #   sign-in tokens; not in git
├── project_history/                 # Reviewer rounds, received documents, 2026 archive; not in git
├── knowledge/                       # Cold-start notes for maintainers and AI agents; not in git
└── rsconnect/                       # shinyapps.io deploy state

Testing and verification

The calculation engine has a regression gate at scripts/audit.R. It builds a synthetic hand-computed "golden case" and asserts every IPCC Vol.4 Ch.10/Ch.11 equation, the Monte Carlo sampler, the validators and the exporters against it, then writes reports/AUDIT_REPORT.md.

Rscript scripts/audit.R    # exits non-zero if any check fails

It runs on every push and pull request (see the audit badge above). Checks that depend on fixtures in test_data/ report as SKIP in a clean clone, because that directory holds real national inventory data and is deliberately untracked.


Contributing

See CONTRIBUTING.md. Bug reports and feature requests go in GitHub issues. If you are a national inventory compiler rather than a developer, the structured 20-30 minute review package in documentation/beta_test/ is the most useful route, and it needs no login, no R and no installation.


Funding and acknowledgements

This tool was developed as part of project D614: GMH Emissions Uncertainty funded by the Global Methane Hub (Grant R-2026-01051), implemented by the CGIAR Alliance of Bioversity International and CIAT under the CGIAR Climate Action Programme.

Alliance of Bioversity International and CIAT      CGIAR Climate Action Programme      Global Methane Hub


Citation

If you use this tool in your inventory work or research, please cite it (see CITATION.cff, rendered by GitHub's "Cite this repository" button):

Alliance of Bioversity International and CIAT (CGIAR) (2026). IPCC Tier 2 Cattle GHG Uncertainty Calculator (software). https://github.com/CGIAR-Climate-Data-Hub/cattle-ghg-uncertainty

A DOI badge will appear here once the first archived release is minted.


License

MIT © CGIAR Alliance of Bioversity International and CIAT, 2026

About

Cattle GHG Uncertainty Calculator: Monte Carlo (IPCC Approach 2) uncertainty analysis for Tier 2 cattle GHG inventories. Enteric CH4, manure CH4/N2O, IPCC Table 3.3 / UNFCCC outputs. Free R Shiny web tool, no coding required.

cgiar-climate-data-hub.github.io/cattle-ghg-uncertainty/

Topics

cattleclimate-changeenteric-fermentationghg-inventoryipcclivestockmethanemonte-carlomrvnational-inventorynitrous-oxider-shinytier-2uncertainty-analysisuncertainty-quantificationunfccc

Resources

Readme
MIT license

Contributing

Contributing
Activity
Custom properties

Stars

0 stars

Watchers

0 watching

Forks

0 forks
Report repository

Releases

Packages

Contributors

Languages

You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.