{"id":2367,"date":"2025-12-09T10:46:15","date_gmt":"2025-12-09T10:46:15","guid":{"rendered":"https:\/\/blogs.mathworks.com\/finance\/?p=2367"},"modified":"2025-12-09T11:40:13","modified_gmt":"2025-12-09T11:40:13","slug":"credit-and-market-risk-management-from-risk-modeling-to-regulatory-compliance","status":"publish","type":"post","link":"https:\/\/blogs.mathworks.com\/finance\/2025\/12\/09\/credit-and-market-risk-management-from-risk-modeling-to-regulatory-compliance\/","title":{"rendered":"Credit and Market Risk Management: From Risk Modeling to Regulatory Compliance"},"content":{"rendered":"<p>In this technical session, <a rel=\"noopener\" href=\"https:\/\/www.linkedin.com\/in\/valerio-sperandeo-a16032a3\/\" target=\"_blank\">Valerio Sperandeo<\/a>, Senior Application Engineer, demonstrated how MATLAB can support financial institutions in building robust, transparent, and scalable risk models aligned with regulatory frameworks such as Basel (CCR and FRTB).<\/p>\n<div style=\"height:10px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n<div class=\"wp-block-cover aligncenter is-light has-medium-font-size\" style=\"min-height:144px\"><span aria-hidden=\"true\" class=\"wp-block-cover__background has-background-dim-40 has-background-dim\" style=\"background-color:#f4f4f4\"><\/span><\/p>\n<div class=\"wp-block-cover__inner-container\">\n<h1 class=\"has-text-align-center has-text-color has-medium-font-size\" style=\"color:#0076a8\">Access the Materials<\/h1>\n<div style=\"height:5px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n<div class=\"is-content-justification-center is-layout-flex wp-container-1 wp-block-buttons\">\n<div class=\"wp-block-button has-custom-font-size\" style=\"font-size:18px\"><a class=\"wp-block-button__link has-white-color has-text-color has-background wp-element-button\" href=\"https:\/\/content.mathworks.com\/viewer\/6937fbbf9962d899634f9311\" style=\"background-color:#0076a8\" target=\"_blank\" rel=\"noreferrer noopener\">Watch the recording<\/a><\/div>\n<div class=\"wp-block-button has-custom-font-size\" style=\"font-size:18px\"><a class=\"wp-block-button__link has-white-color has-text-color has-background wp-element-button\" href=\"https:\/\/content.mathworks.com\/viewer\/6937fc009962d89c3d4f9235\" style=\"background-color:#0076a8\" target=\"_blank\" rel=\"noreferrer noopener\">View the slides<\/a><\/div>\n<div class=\"wp-block-button has-custom-font-size\" style=\"font-size:18px\"><a class=\"wp-block-button__link has-white-color has-text-color has-background wp-element-button\" href=\"https:\/\/content.mathworks.com\/viewer\/6937feea35ae18d02fd50c85\" style=\"background-color:#0076a8\" target=\"_blank\" rel=\"noreferrer noopener\">MATLAB examples<\/a><\/div>\n<\/div>\n<\/div>\n<\/div>\n<div style=\"height:10px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n<div style=\"height:10px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n<div style=\"height:10px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n<h1>Why Risk Validation Matters<\/h1>\n<p>Accurate risk modeling is essential for capital adequacy and efficient portfolio management. Inaccurate estimates of risk measures\u2014such as probability of default, loss given default, exposure at default, value-at-risk (VaR), and expected shortfall (ES)\u2014can lead to under- or overestimation of capital requirements. The webinar emphasized the importance of model validation to ensure predictive accuracy, reasonable assumptions, and performance under different economic conditions.<\/p>\n<h1>Tools for Validation and Backtesting<\/h1>\n<p>Valerio introduced the new Risk Validation Package in MATLAB R2025a, which provides a unified framework for assessing model discrimination and calibration. Discrimination measures how well a model separates different outcomes\u2014for example, distinguishing between defaulting and non-defaulting borrowers. Calibration evaluates how closely predicted probabilities match observed outcomes. Both are essential for understanding model performance and ensuring regulatory compliance.<\/p>\n<p>Unlike previous model-specific functions, this package supports validation across models built in MATLAB or imported from other languages. It includes metrics such as accuracy ratio, area under curve, Kolmogorov-Smirnov statistic, and Brier score.<\/p>\n<div style=\"height:20px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n<div class=\"is-layout-constrained wp-block-group\">\n<div class=\"wp-block-group__inner-container\">\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter is-resized\"><img decoding=\"async\" loading=\"lazy\" src=\"http:\/\/blogs.mathworks.com\/finance\/files\/2025\/11\/Slide-4-image.png\" alt=\"\" class=\"wp-image-2370\" width=\"1121\" height=\"617\"\/><\/figure>\n<\/div>\n<\/div>\n<\/div>\n<div style=\"height:20px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n<p>The session featured a practical example comparing logistic regression and decision tree models for credit scoring, using validation metrics and decile-based analysis to assess performance. Calibration tests such as binomial and correlated binomial tests were also demonstrated.<\/p>\n<p>The Risk Validation Package enables validation across credit, market, insurance, and climate risk types. It integrates with MATLAB workflows for scorecard development, backtesting, and simulation. All code is open and editable to support transparency and debugging. This consistent framework helps risk teams assess performance, identify weaknesses, and benchmark models across diverse modeling approaches.<\/p>\n<div style=\"height:20px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter is-resized\"><img decoding=\"async\" loading=\"lazy\" src=\"http:\/\/blogs.mathworks.com\/finance\/files\/2025\/11\/Slide-5-image.png\" alt=\"\" class=\"wp-image-2371\" width=\"1198\" height=\"658\"\/><\/figure>\n<\/div>\n<div style=\"height:20px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n<h1>Market Risk Backtesting<\/h1>\n<p>When working with market risk measures and time series data, validation often involves backtesting. This helps assess how well a model&#8217;s forecasts align with actual outcomes over time\u2014an essential step for internal governance and regulatory compliance.<\/p>\n<p>The webinar explored the MATLAB frameworks for backtesting VaR and ES. The VaR backtest object supports statistical tests like the traffic light test, binomial test, and proportion of failures. For ES, MATLAB offers multiple backtest objects based on academic research, including minimally biased tests that jointly evaluate VaR and ES forecasts. These tools help risk teams assess the reliability of ES forecasts, which is increasingly important in regulatory contexts.<\/p>\n<div style=\"height:20px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter is-resized\"><img decoding=\"async\" loading=\"lazy\" src=\"http:\/\/blogs.mathworks.com\/finance\/files\/2025\/11\/Slide-11-image.png\" alt=\"\" class=\"wp-image-2372\" width=\"1200\" height=\"664\"\/><\/figure>\n<\/div>\n<div style=\"height:30px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n<p>Valerio demonstrated how to compare historical and filtered historical methods for estimating VaR and ES on a portfolio of U.S. Treasuries. Filtered historical methods showed better adaptability to changing market regimes and improved backtest results.<\/p>\n<h1>Regulatory Workflows: CCR and FRTB<\/h1>\n<p>Even when market risk teams build internal models, they still need to implement the SA to benchmark results. If the Internal Models Approach (IMA) is not approved, SA becomes the fallback for regulatory capital calculations.<\/p>\n<p>The webinar showcased the MATLAB standardized approach engines for CCR (SA-CCR) and FRTB (FRTB-SA). These tools ingest ISDA CRIF files and compute capital charges for sensitivity-based, default risk, and residual risk components. Valerio demonstrated how to automate these workflows and visualize capital attribution across portfolios and risk types.<\/p>\n<div style=\"height:20px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n<figure class=\"is-layout-flex wp-block-gallery-3 wp-block-gallery has-nested-images columns-default is-cropped\">\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" loading=\"lazy\" width=\"612\" height=\"488\" data-id=\"2373\"  src=\"https:\/\/blogs.mathworks.com\/finance\/files\/2025\/11\/Component-breakdown-structure.png\" alt=\"\" class=\"wp-image-2373\"\/><\/figure>\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" loading=\"lazy\" width=\"632\" height=\"390\" data-id=\"2374\"  src=\"https:\/\/blogs.mathworks.com\/finance\/files\/2025\/11\/Bar-chart.png\" alt=\"Market capital risk charge component breakdown\" class=\"wp-image-2374\"\/><\/figure>\n<\/figure>\n<div style=\"height:20px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n<div style=\"height:20px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n<h1>Automation and Dashboards<\/h1>\n<p>To scale validation and reporting across multiple trading desks, a certain level of automation is essential. Valerio introduced MATLAB App Designer for building interactive dashboards. He showed a P&amp;L attribution test app that visualizes test results and exports graphics to risk reports. This approach enhances transparency, supports stakeholder communication, and streamlines compliance.<\/p>\n<h1>Looking Ahead<\/h1>\n<p>The webinar concluded with a reminder that risk management is not one-size-fits-all. Institutions need flexible tools that adapt to evolving data and regulatory requirements. MATLAB provides a customizable framework for building and validating risk models, automating reporting, and performing what-if analysis.<\/p>\n<h1>Learn More<\/h1>\n<ul>\n<li>Read <a href=\"https:\/\/www.mathworks.com\/content\/dam\/mathworks\/white-paper\/mastering-market-risk-capital.pdf?s_v1=63243&amp;elqem=Webinar%20Recording%3A%20Credit%20and%20Market%20Risk%20Management%202025-11-12&amp;rec_id=8158a54cf2b3450e9dbb9ecf7edb4879&amp;s_eid=EML_1762956652&amp;elqTrackId=6d0e41cd3d7d44568bbf04bdbd28bfba&amp;elq=8158a54cf2b3450e9dbb9ecf7edb4879&amp;elqaid=63243&amp;elqat=1&amp;elqCampaignId=&amp;elqak=8AF53E4D4DEC8E983AFC6ED978B74FB03433599F7108D18B6CB759703A1A984A4255\" target=\"_blank\" rel=\"noreferrer noopener\">Navigating FRTB white paper<\/a><\/li>\n<li>Explore <a href=\"https:\/\/www.mathworks.com\/discovery\/frtb.html\" target=\"_blank\" rel=\"noreferrer noopener\">FRTB with MATLAB discovery page<\/a><\/li>\n<li>Discover <a href=\"https:\/\/blogs.mathworks.com\/finance\/2025\/09\/23\/navigating-frtb-standardized-vs-internal-models-and-the-role-of-scriptable-risk-engines\/\" target=\"_blank\" rel=\"noreferrer noopener\">FRTB SA vs IMA blog post<\/a><\/li>\n<\/ul>\n<div style=\"height:10px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n<div class=\"is-layout-flex wp-block-buttons\">\n<div class=\"wp-block-button is-style-fill\"><a class=\"wp-block-button__link has-white-color has-text-color has-background wp-element-button\" href=\"mailto:compfin@mathworks.com\" style=\"background-color:#d78825\" target=\"_blank\" rel=\"noreferrer noopener\">Contact Us<\/a><\/div>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<div class=\"overview-image\"><img decoding=\"async\"  class=\"img-responsive\" src=\"http:\/\/blogs.mathworks.com\/finance\/files\/2025\/11\/Slide-4-image.png\" onError=\"this.style.display ='none';\" \/><\/div>\n<p>In this technical session, Valerio Sperandeo, Senior Application Engineer, demonstrated how MATLAB can support financial institutions in building robust, transparent, and scalable risk models aligned&#8230; <a class=\"read-more\" href=\"https:\/\/blogs.mathworks.com\/finance\/2025\/12\/09\/credit-and-market-risk-management-from-risk-modeling-to-regulatory-compliance\/\">read more >><\/a><\/p>\n","protected":false},"author":233,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[49,13,28,4,19],"tags":[],"_links":{"self":[{"href":"https:\/\/blogs.mathworks.com\/finance\/wp-json\/wp\/v2\/posts\/2367"}],"collection":[{"href":"https:\/\/blogs.mathworks.com\/finance\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blogs.mathworks.com\/finance\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blogs.mathworks.com\/finance\/wp-json\/wp\/v2\/users\/233"}],"replies":[{"embeddable":true,"href":"https:\/\/blogs.mathworks.com\/finance\/wp-json\/wp\/v2\/comments?post=2367"}],"version-history":[{"count":86,"href":"https:\/\/blogs.mathworks.com\/finance\/wp-json\/wp\/v2\/posts\/2367\/revisions"}],"predecessor-version":[{"id":2569,"href":"https:\/\/blogs.mathworks.com\/finance\/wp-json\/wp\/v2\/posts\/2367\/revisions\/2569"}],"wp:attachment":[{"href":"https:\/\/blogs.mathworks.com\/finance\/wp-json\/wp\/v2\/media?parent=2367"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blogs.mathworks.com\/finance\/wp-json\/wp\/v2\/categories?post=2367"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blogs.mathworks.com\/finance\/wp-json\/wp\/v2\/tags?post=2367"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}