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.1.1.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 73 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.
vignette("complete-function-reference",
package = "riskweightedassets")Online documentation describes the GitHub release. For this installed package's exact API, use the bundled help pages and complete-function-reference vignette.
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.
The installed LEGAL.md notice contains the full imprint and privacy-policy
addresses. The package performs no telemetry and no automatic download.
Any scripts or data that you put into this service are public.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.