Skip to content

USACE-RMC/RMC-BestFit

Repository files navigation

RMC-BestFit

CI DOI NuGet License: 0BSD

RMC-BestFit is free and open-source software developed by the U.S. Army Corps of Engineers Risk Management Center (USACE-RMC) for Bayesian flood-frequency analysis, distribution fitting, uncertainty quantification, rating curves, bivariate and coincident frequency analysis, time-series modeling, and related hydrologic risk workflows. Version 2.0 exposes the core statistical engine as a reusable .NET model library while retaining the desktop application, UI/project layer, and REST API source in the same repository.

Note

RMC-BestFit 2.0.0 is the official public 2.0 release. Expect ongoing bug fixes, minor enhancements, and documentation improvements as the project continues to evolve.

RMC-BestFit desktop application

Supported Frameworks

Component Target Notes
RMC.BestFit .NET 10.0 Portable model library and first public NuGet package
RMC.BestFit.Tests .NET 10.0 Public model-library unit tests run by CI
RMC.BestFit.Api .NET 10.0 REST API and MCP server source over the model library
RMC-BestFit desktop app .NET 10.0 Windows Windows 10+ WPF application; HEC-DSS still resolves through explicit local binary/native references during migration

Installation

Install the model library from NuGet:

dotnet add package RMC.BestFit --version 2.0.0

Or search for RMC.BestFit in the NuGet Package Manager. The package depends on RMC.Numerics 2.x for probability distributions, optimization, MCMC sampling, and numerical methods.

Source builds include the model library, unit tests, UI/project layer, desktop application, and API projects. Public CI initially restores, builds, and tests the portable model-library path while public packaging for the broader desktop stack and HEC-DSS dependency is finalized.

Documentation

Note

Documentation for RMC-BestFit 2.0 is published with this release and will continue to expand with additional examples, verification materials, and API coverage. The Version 1.0 User's Guide and Verification Report linked below remain published references for the previous major release.

Document Description
Getting Started Minimal namespaces and first model-library workflows
Technical Reference Model, data, distribution, estimation, analysis, and diagnostic documentation
REST API + MCP Server Headless API and MCP server over RMC.BestFit.dll
References Consolidated bibliography for the public documentation
Version 1.0 User's Guide Published desktop user guide for the previous major release
Version 1.0 Verification Report Published verification report for the previous major release

Solution Structure

Area Path Description
Model Library src/RMC.BestFit/ Core statistical models, analyses, diagnostics, data frames, trend functions, and link functions
Model Tests src/RMC.BestFit.Tests/ Public unit tests for data, estimation, distributions, analyses, diagnostics, rating curves, time series, bivariate analysis, and spatial extremes
UI Layer src/RMC.BestFit.UI/ Project serialization and UI wrapper layer used by the desktop application
Desktop App src/RMC.BestFit.App/ WPF application shell and RMC-BestFit desktop interface
API src/RMC.BestFit.Api/ REST API and MCP server source for programmatic workflows
Documentation docs/ Public technical documentation and references
Examples examples/ Tutorial .bestfit projects, input data, spreadsheets, and walkthrough markdown

The long-running verification project, verification datasets, and additional validation reports are intentionally excluded from the initial public source release. Those materials are being prepared for follow-on publication.

Quick Start

Restore, build, and test the public model-library path:

dotnet restore src/RMC.BestFit.Tests/RMC.BestFit.Tests.csproj
dotnet build src/RMC.BestFit.Tests/RMC.BestFit.Tests.csproj -c Release --no-restore
dotnet test src/RMC.BestFit.Tests/RMC.BestFit.Tests.csproj -c Release --no-build

Create the public NuGet package locally:

dotnet pack src/RMC.BestFit/RMC.BestFit.csproj -c Release -o packages /p:Version=2.0.0

Key Capabilities

Domain Public API and workflows
Input data DataFrame with ExactSeries, UncertainSeries, IntervalSeries, and ThresholdSeries for exact, uncertain, interval-censored, and threshold observations
Estimation MaximumLikelihood, MaximumAPosteriori, GeneralizedMethodOfMoments, and BayesianAnalysis with information criteria and MCMC diagnostics
Flood-frequency models FittingAnalysis, UnivariateAnalysis, UnivariateDistribution, MixtureAnalysis, CompetingRiskAnalysis, PointProcessAnalysis, and CompositeAnalysis
Bulletin 17C Bulletin17CAnalysis and Bulletin17CDistribution workflows for Log-Pearson Type III frequency analysis, penalties, and uncertainty methods
Bivariate and coincident frequency BivariateDistribution, BivariateAnalysis, and CoincidentFrequencyAnalysis for copula-based joint frequency and response-frequency workflows
Rating curves RatingCurve and RatingCurveAnalysis for Bayesian stage-discharge relationships with one to three segments
Time series AutoRegressive, MovingAverage, ARIMA, ARIMAX, and corresponding AR/MA/ARIMA/ARIMAX analyses
Spatial extremes SpatialGEV, SpatialGEVAnalysis, Gaussian copula support, and spatial correlation models
Diagnostics Prior and posterior predictive checks, observation influence, prior influence, leverage diagnostics, threshold diagnostics, R-hat, ESS, WAIC, LOO-CV, DIC, AIC, BIC, and RMSE outputs
Automation REST API and MCP server endpoints for time-series retrieval, input data creation, analysis execution, workflow chaining, metadata discovery, and JSON results

Examples

The examples folder contains tutorial .bestfit projects and supporting files that can be opened in RMC-BestFit 2.0.

Chapter Topic
Time Series Data Importing and downloading raw time series from USGS, GHCN, CHMN, ABOM, HEC-DSS, and manual entry
Input Data Extracting block maxima, peaks-over-threshold, and USGS peak-flow samples
Univariate Distribution Analysis Bayesian, Bulletin 17C, point-process, mixture, and composite frequency analyses
Bivariate Distribution Analysis Copula-based bivariate fitting and coincident frequency analysis
Rating Curve Analysis Bayesian piecewise power-law stage-discharge rating curves
Time Series Analysis ARIMA, ARIMAX, and regression fitting with autocorrelated residuals

Publications

RMC Training

Support

USACE-RMC maintains RMC-BestFit 2.0 with regular bug fixes, documentation improvements, and validation updates. Public issues should include the RMC-BestFit version, operating system, .NET SDK version when relevant, the workflow or project file involved, and enough detail to reproduce the behavior.

The repository includes a fast model-library test suite that is intended to serve both as regression coverage and as API usage examples. Longer-running verification materials are being prepared separately for public release.

Contributing

Bug reports, feature requests, documentation feedback, and independent validation results are welcome. Please read CONTRIBUTING.md before opening a pull request. Review capacity is limited, so proposed code changes should start with an issue discussion.

License

RMC-BestFit is provided under the Zero-Clause BSD (0BSD) license.

About

RMC-BestFit is a state-of-the-art Bayesian estimation and fitting software developed collaboratively by the USACE-RMC and ERDC-CHL.

Topics

Resources

License

Code of conduct

Contributing

Security policy

Stars

27 stars

Watchers

4 watching

Forks

Packages

 
 
 

Contributors

Languages