Version 1.2.3: UTC snapshot timestamp correction.
Retained from 1.2.2: Canonical default flags and regression cases.
Version 1.2.1: IRB default correction and API migration.
riskweightedassets is the R implementation of the RiskDataScience GmbH
reference engine for CRR III risk-weighted assets, regulatory capital, IRRBB
and ICAAP. It provides a stable R API, canonical Excel contracts, realistic
synthetic portfolios, bitemporal snapshots, deterministic lineage and
reconciliation controls. No Python runtime is required.
The package is intended for research, education, prototyping and independent model validation. It is not legal, supervisory, accounting or investment advice and is not a certified regulatory reporting system.
During development, build and install the local source package:
install.packages("riskweightedassets_1.2.0.tar.gz", repos = NULL, type = "source")
After CRAN acceptance the standard command will be:
install.packages("riskweightedassets")
library(riskweightedassets)
tables <- generate_synthetic_tables(bank_profile = "MID_SIZE_UNIVERSAL")
result <- calculate_tables(tables)
print(result)
result$metrics[c("RWEA_KSA", "RWEA_IRB", "TREA", "CET1_RATIO")]
The package exposes 77 documented public functions. Analysts can calculate an individual formula, inspect or override a regulatory weight, extract one result table, compare applied and fully-loaded metrics, or obtain a focused risk-domain analysis without using private package internals.
sa_exposure_value(100, 2, committed_undrawn = 40, annex_i_class = "CLASS_2")
irb_capital_requirement(.01, .45, .20, 2.5)
tables <- generate_synthetic_tables(bank_profile = "KSA_BANK")
override <- data.frame(
parameter_key = "RWA_MULTIPLIER", dimension_1 = "PILLAR1",
dimension_2 = "", parameter_value = 13
)
scenario_tables <- override_regulatory_parameters(
tables, override, reason = "Sensitivity analysis", approved_by = "Model Risk"
)
parameter_overrides(scenario_tables)
See the bank-analyst API map for the complete functional inventory and governance rules.
All writes go to a destination selected by the caller. Package resources are immutable.
root <- file.path(tempdir(), "rwa-runs")
dataset <- generate_synthetic_dataset(
root,
as_of = as.Date("2026-08-31"),
version = "v1.0.0",
bank_profile = "KSA_BANK"
)
validation <- validate_dataset(dataset)
result <- calculate_dataset(dataset)
result$output_files
calculate_dataset() writes six output workbooks and a machine-readable run
manifest below outputs/<deterministic-run-id>/. For integration without
spreadsheets, calculate_tables() accepts and returns ordinary R objects.
The package contains synthetic data only. It contains neither customer data
nor downloaded regulations, standards, PDFs or other third-party publications.
regulatory_sources() returns official URLs and archival SHA-256 values; the
documents remain outside the distribution.
Within R, start with help(package = "riskweightedassets") and the vignettes:
browseVignettes("riskweightedassets")
Copyright © 2026 RiskDataScience GmbH. Original package content is licensed under GNU GPL version 3. External publications remain subject to their own rights and are not redistributed.
Four new public functions cover SME, infrastructure, combined support and complete IRB RWEA. See supporting-factor documentation for inputs, eligibility, compatibility and audit output.