User Stories

Banche Popolari Unite Analyzes Credit Risk Using MATLAB

View PDF

Loss distribution deployed by BPU in MATLAB.


Roberto Modafferi, Banche Popolari Unite

To protect their portfolio offerings and remain profitable, banks must determine potential credit risk. With customer and market data growing exponentially, however, running the large computations required for precise analysis can be challenging.

Banche Popolari Unite (BPU Banca) of Italy monitors firm-specific and industry portfolio credit risk using a value-at-risk (VaR) model developed with MATLAB and the Statistics Toolbox.

"MATLAB allows us to manage a huge amount of data and to generate an impressive number of scenarios very quickly," says Roberto Modafferi, a quantitative analyst in the Risk Management Division of BPU Banca. "This has enabled us to monitor credit risk as a result of the estimated degree of portfolio diversification and concentration."


To build their credit model, BPU Banca would need to process and analyze hundreds of thousands of data points based on monthly internal and weekly market data. Developing the model in C or C++ would be too time-consuming.

They sought a computing environment that would eliminate tedious hand coding and enable them to present their results to upper management in a visually accessible form.


BPU Banca used MATLAB and the Statistics Toolbox to develop a Merton-based credit model that determines the distribution of losses and the VaR at different confidence intervals. They delivered their findings to upper management in an intuitive graphical format.

Modafferi used MATLAB to import both market data, such as stock and stock index quotes, and internal data, such as decade rates, losses given default, and exposures at default. He created a default model with MATLAB, aggregating the data by sector. The Statistics Toolbox enabled Modafferi to perform sector regression and correlation analyses to assess the effects of diversification and concentration of the credit portfolio.

He used MATLAB and the Statistics Toolbox to model and run Monte Carlo simulations to assess precise estimates of the loss distribution by analyzing the data convergence. The simulations enabled him to determine the entity of the losses at different confidence intervals over a specific time period.

Using MATLAB and the Statistics Toolbox, Modafferi developed a factor model that distinguishes between systematic and specific risk. Along with easing the computational burden, the model enabled Modafferi to obtain more efficient risk estimates and obtain more insight into the nature of the portfolio risk.

MATLAB helped Modafferi display the simulation results in analytical and graphical formats, including histograms, loss distributions, and convergence graphics. He delivered his findings as part of a quarterly risk management report that the bank management uses to make strategic decisions, such as rebalancing sectors in BPU’s portfolios.

Modafferi is also using MATLAB and related toolboxes to develop an internal pricing system that helps evaluate various portfolios of the trading and banking books as well as hedging policies to test and integrate external suites.


  • Fast, precise analysis of more than 700,000 credit risk sensitive portfolio positions. "It would have been very difficult to manage hundreds of thousands of positions in a Monte Carlo simulation framework where each position is considered both individually and as part of a group," explains Modafferi. "The MATLAB high-level matrix-based programming language allowed us to reduce a huge amount of computational effort, resulting in both speed and precision."
  • Reduction in algorithm development time. "MATLAB enabled us to save hours of development time in writing and optimizing our algorithms to minimize computational time," says Modafferi. "Implementing our model in other low-level programming languages would have required additional months of work."
  • Reliable analytical model. "With MathWorks tools, we designed an original and consistent model that considers scientific literature, best practices, real data, and the bank’s business peculiarities as negotiated instruments," says Modafferi. "With this, we’re confident in where results come from."


To identify and analyze potential portfolio credit risk


Use MATLAB and the Statistics Toolbox to develop a VaR model that enables fast computation and analysis of large data sets


  • Reduction in algorithm development time
  • Reliable analytical model

Products Used

Learn more about Banche Popolari Unite