Corporate Credit, Securitized-Products Proxy, VaR/ES, Stress Testing, Backtesting, Model Governance
This repository is an offline, local-runnable framework for fixed-income market-risk model development. It uses public-data-compatible loaders, cached/sample-compatible interfaces, and deterministic synthetic fallbacks so the full pipeline can run without proprietary data or internet access.
This is a non-production portfolio framework. It does not use J.P. Morgan data, proprietary bank portfolios, trading-desk positions, Bloomberg/TRACE subscription data, or production securitized-products models. Outputs are regulatory-style and FRTB-inspired review artifacts, not regulatory capital certification.
- Builds a Treasury-rate and credit-spread risk-factor panel from public-data-compatible schemas or deterministic fallback data.
- Validates market data for missing observations, stale quotes, date alignment, and outlier shocks.
- Generates synthetic corporate-credit and securitized-products proxy portfolios.
- Prices fixed-rate corporate bonds using spread-adjusted discounting and computes DV01/CS01/OAS01 sensitivities.
- Builds a synthetic mortgage-pool and tranche waterfall proxy with prepayment, default, severity, WAL, and tranche-loss diagnostics.
- Computes historical VaR, Monte Carlo VaR, Student-t VaR, Expected Shortfall, stressed VaR, and scenario stress losses.
- Runs rolling 250-day 99% VaR backtesting with Kupiec and Christoffersen tests.
- Quantifies modeling-assumption impact across VaR engine, distribution, volatility, horizon, correlation, valuation, and securitized-product assumptions.
- Adds reliability-focused specialty modules: Market Health Timestep, residual VaR correction, conservative risk envelope, false-safe diagnostics, and specialty ablation.
- Generates model-risk documentation: methodology notes, validation memo, regulatory mapping, limitations, compensating controls, and executive summary.
This upgraded version adds five screening-oriented improvements for the JPMC Market Risk Model Development role:
scripts/create_public_compatible_samples.pycreates cached public-compatible samples and a source catalog so the pipeline can demonstrate public-data schema readiness without requiring live internet access.outputs/model_inventory.csvandreports/model_inventory.mdregister model components, inputs, validation tests, limitations, and controls.reports/public_data_readiness_report.mddocuments whether the run used live FRED data, cached public-compatible samples, or deterministic fallback.reports/jpmc_market_risk_role_alignment.mdsummarizes how the project maps to Fixed Income market risk, Corporate Credit, Securitized Products proxy modeling, VaR/ES, backtesting, assumption impact, and model governance.- The governance packet now separates regulatory-style evidence from prohibited overclaims such as production regulatory capital, real JPMC data, or desk-approved securitized-products pricing.
python -m venv .venv
# Windows: .venv\Scripts\activate
# macOS/Linux: source .venv/bin/activate
pip install -r requirements.txt
make run
make testOr directly:
python scripts/run_pipeline.py
pytest -qoutputs/risk_factor_panel.csvoroutputs/risk_factor_panel.parquetoutputs/corporate_credit_sensitivities.csvoutputs/securitized_tranche_cashflows.csvoutputs/var_es_by_portfolio.csvoutputs/stressed_var_results.csvoutputs/stress_loss_by_scenario.csvoutputs/backtesting_exceptions.csvoutputs/kupiec_christoffersen_results.csvoutputs/assumption_sensitivity_matrix.csvoutputs/specialty_ablation_table.csvoutputs/model_risk_findings.csvoutputs/release_decision.json
reports/market_data_validation_report.mdreports/corporate_credit_portfolio_report.mdreports/securitized_products_proxy_report.mdreports/var_es_methodology.mdreports/stress_testing_report.mdreports/backtesting_report.mdreports/assumption_impact_report.mdreports/specialty_contribution_report.mdreports/model_validation_memo.mdreports/regulatory_mapping_memo.mdreports/known_limitations.mdreports/compensating_controls.mdreports/executive_risk_summary.md
The framework is built around the following public-data-compatible layers:
- Federal Reserve H.15 / FRED Treasury constant maturity rates for rate-risk factors.
- FRED ICE BofA option-adjusted spread series for corporate-credit spread factors.
- Freddie Mac / Fannie Mae / Ginnie Mae style mortgage-performance or disclosure schemas for securitized-products proxy modeling.
- Synthetic positions and deterministic fallback samples for reproducible local execution.
Built an end-to-end offline fixed-income market-risk model development framework using public Treasury-rate, ICE BofA corporate-credit spread, and public mortgage-performance/disclosure-compatible data schemas with synthetic corporate-bond and securitized-products proxy portfolios, covering market-data validation, risk-factor construction, spread-adjusted valuation, DV01/CS01/OAS01 sensitivities, VaR/Expected Shortfall, stressed VaR, scenario stress testing, rolling backtesting, assumption-impact analysis, specialty ablations, and model-risk documentation under explicit public-data/synthetic-portfolio boundaries.
This upgraded version includes a complete weakness-analysis and reinforcement loop:
- 250-day traffic-light backtesting proxy
- VaR exception attribution by dominant risk component and market-health state
- VaR stability diagnostics across multiple lookback windows and bootstrap intervals
- bounded empirical residual VaR correction
- securitized proxy CPR/default/severity/liquidity stress grid
- small-data validation smoke run
- Dockerfile and GitHub Actions CI workflow
Canonical validation commands:
python scripts/create_public_compatible_samples.py
python scripts/run_pipeline.py
python scripts/run_small_data_validation.py
pytest -qOr run everything:
python scripts/run_all_checks.pyClaim boundary: offline framework, public-data-compatible loaders, cached public-style samples, deterministic synthetic fallback, synthetic portfolio, securitized-products proxy, and regulatory-style documentation. No proprietary bank data, production trading-desk portfolio, production MBS/ABS model, or regulatory capital certification is claimed.
The V4 package adds model-risk review depth beyond the original VaR/stress/backtesting framework:
- Actual-vs-hypothetical P&L attribution proxy.
- FRTB-inspired ES, liquidity-horizon, and modellability-proxy diagnostics.
- Champion/challenger VaR model selection.
- Reverse stress testing against VaR/ES thresholds.
- SHA-256 reproducibility manifest.
- Expanded small-data smoke validation and 20 pytest checks.
Canonical full validation command:
python scripts/run_all_checks.pyLatest validation status: PASS. The framework remains offline/public-data-compatible/synthetic-portfolio/proxy only and does not claim production or regulatory certification.
Recommended local setup:
python -m venv .venv
source .venv/bin/activate # Windows: .venv\Scripts\activate
python -m pip install --upgrade pip
python -m pip install -r requirements.txt
python -m pip install -e . --no-deps
python scripts/run_all_checks.pyThe project uses a src/ package layout and now includes explicit setuptools build metadata in pyproject.toml. The GitHub Actions workflow installs the package in editable mode, runs an import smoke test, regenerates cached public-compatible samples, executes the full pipeline, runs small-data validation, executes pytest, and verifies required artifacts.
Docker smoke test:
docker build -t fimrf .
docker run --rm fimrfBoundary: this is an offline/public-data-compatible framework with deterministic cached samples and synthetic fallback data. It does not use JPMC data, desk P&L, Bloomberg/TRACE/WRDS marks, or production securitized-products assumptions.
This project includes a local/offline fixed-income market-risk model development workflow with public-compatible Treasury/OAS samples, synthetic corporate-credit portfolios, Freddie Mac CRT-enhanced local mortgage proxy validation, VaR/ES, stressed VaR, rolling backtesting, P&L attribution proxy, FRTB-inspired diagnostics, reverse stress testing, trained VaR overlay, daily risk operations simulation, and function/performance evaluation reports.
Resume-safe baseline contribution from the local operations experiment: selected residual-corrected VaR reduced simulated exception rate from 2.94% to 0.93%, false-safe days from 19 to 6, and RED/AMBER review burden from 39 to 9 days under explicit public-data/synthetic-portfolio boundaries.