Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1,224 changes: 1,224 additions & 0 deletions 05-function-reference.qmd

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions rfaR-book/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
/.quarto/
**/*.quarto_ipynb
46 changes: 46 additions & 0 deletions rfaR-book/01-introduction.qmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# Introduction

## Purpose

`rfaR` is an R implementation of the Risk Management Center Reservoir
Frequency Analysis (RMC-RFA) software. RMC-RFA (and `rfaR`) use apply stratified
monte carlo methods to deterministic flood routing to produce a hydrologic hazard
curve[^1] at individual dam and levee sites. Hazard analyses support risk assessments
within the USACE Dam & Levee Safety Program.

[^1]: In risk analysis, the *hazard* is the risk source where potential consequences relate to harm [@aven_society_nodate]. In the context of dam and levee risk analyses, the source of risk is often defined using a reservoir stage-frequency relationship. The terms *hydrologic loading*, *stage-frequency*, and *hydrologic hazard* are used interchangeably to relate reservoir/river stages to annual exceedance probabilities (AEPs). These relationships are commonly presented as curves and are used as probabilistic loading conditions in dam and levee risk analyses.


## rfaR Analysis Summary

`rfaR` combines deterministic flood routing (Modified Puls) with a
nested, two-loop Monte Carlo framework to quantify:

- **Natural variability** — simulated in the inner loop as a *realization*. Each
realization represents 10,000 indiviual flood events with randomly sampled
starting stage, hydrograph shape, and inflow volume (from an associated frequency distribution).

- **Knowledge uncertainty (epistemic uncertainty)** — simulated in the outer loop, by sampling
different parameter sets (from LP3 or GEV flood frequency distributions,
informed by MCMC output from RMC-BestFit).

## Relationship to RMC-RFA

`rfaR` reimplements the core RMC-RFA methodology in open-source R, offering:

- Reproducibility and transparency in the routing and sampling logic
- Integration with the broader R/RMC ecosystem (e.g., RMC-BestFit outputs)

## How This Manual Is Organized

- **Methodology** — statistical and hydrologic methods behind the two-loop
simulation framework
- **Installation** — getting `rfaR` running locally
- **Workflow** — an end-to-end walkthrough from raw inputs to a
stage-frequency curve
- **Simulation Modes** — Median, Expected, and Full Uncertainty simulation modes explained
- **Function Reference** — Function references (auto-generated from package documentation)
- **Validation** — comparison against RMC-RFA / HEC-HMS benchmark results

For function-level documentation, also see the
[pkgdown reference site](https://usace-rmc.github.io/rfaR/).
17 changes: 17 additions & 0 deletions rfaR-book/02-methodology.qmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Methodology

## Overview

`rfaR` implements a two-loop, nested Monte Carlo framework to propagate both
natural variability and knowledge uncertainty through a deterministic flood
routing model.

## Outer Loop: Parameter Uncertainty



## Inner Loop: Realizations



## Flood Routing
27 changes: 27 additions & 0 deletions rfaR-book/03-installation.qmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Installation

## Requirements

- R (version ≥ *TODO*)
- Recommended: [Positron](https://positron.posit.co/) or RStudio

## Installing rfaR

```r
# From GitHub
remotes::install_github("USACE-RMC/rfaR")
```

*TODO: note CRAN install instructions once published.*

## Dependencies

*TODO: list key dependencies (ggplot2, future/future.apply, lmom, cli, etc.)
and any that require special handling on USACE machines.*

## Verifying Installation

```r
library(rfaR)
# TODO: smoke-test
```
22 changes: 22 additions & 0 deletions rfaR-book/04-workflow.qmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Workflow

## Overview


## Step 1: Prepare Inputs


## Step 2: Hydrograph Setup


## Step 3: Sampling



## Step 4: Routing


## Step 5: Running the Full Simulation


## Step 6: Interpreting Results
Loading
Loading