Showing posts with label Regulatory Reporting & Risk Management. Show all posts
Showing posts with label Regulatory Reporting & Risk Management. Show all posts

Saturday, September 27, 2025

PIT PD Modeling Using Systematic Factor Approach

 Python Code and Data

: https://drive.google.com/drive/folders/1d7vkT9SeXlELPjRRKDU3qUezibQaUL-y?usp=sharing

Robust methodology to estimate Point-in-Time (PIT) Probability of Default (PD) for non-default obligors under IFRS9, combining obligor-level characteristics with macroeconomic indicators. The approach bridges regulatory compliance with practical portfolio forecasting.

Key Steps:

  1. TTC PD Calculation:

    • We start with a Through-the-Cycle (TTC) PD model at the obligor level, capturing borrower-specific risk factors such as financial ratios, credit history, and product attributes.

    • Macro variables (Macroeconomic Exposure Variables, MEVs) are averaged over a historical period to normalize for economic cycles, ensuring stability and compliance with regulatory TTC requirements.

  2. Systematic Factor Extraction (Credit Cycle Index):

    • To incorporate the impact of economic cycles on forward-looking PDs, we applied Principal Component Analysis (PCA) to a set of macroeconomic indicators.

    • The first principal component serves as a credit cycle index, representing the systematic risk factor that drives correlated changes in credit quality across obligors.

  3. Forecasted Credit Cycle:

    • Using macroeconomic forecasts for upcoming quarters, we projected the credit cycle index forward, maintaining the relationship with historical MEVs.

    • This allows us to translate macroeconomic expectations into a forward-looking credit environment.

  4. PIT PD Estimation via Vasicek Transformation:

    • The TTC PDs were adjusted to PIT PDs using a Vasicek-based single-factor model, incorporating a correlation coefficient (ρ) to reflect the sensitivity of obligors to the systematic credit cycle.

    • This transformation ensures that obligors’ forward-looking PDs respond dynamically to expected changes in the macroeconomic environment.

  5. Portfolio-Level Forecast:

    • The final output is a matrix of PIT PDs, with each obligor in rows and forecasted quarters in columns, allowing granular IFRS9 expected credit loss calculations while remaining aligned with Basel and EBA guidance.

Benefits of this Methodology:

  • Combines obligor-specific risk and macroeconomic trends for accurate PIT PD forecasting.

  • Compliant with IFRS9 and regulatory expectations for forward-looking credit risk modeling.

  • Avoids the need for future obligor-level forecasts, which are often unavailable.

  • Easily scalable to large portfolios for quarterly IFRS9 reporting.

Saturday, September 20, 2025

Estimating Obligor-Level PIT PDs in Low-Default Portfolios

 Excel Example:
https://docs.google.com/spreadsheets/d/1vx3K1YsKxPD3wIc229W2QcghbUIOSe55/edit?usp=sharing&ouid=115594792889982302405&rtpof=true&sd=true

In low-default portfolios, estimating Point-in-Time (PIT) probability of default (PD) at the obligor level is particularly challenging due to data scarcity. To address this, I implemented the Basel Committee’s BCR approach and extended it with idiosyncratic adjustments for borrower-level differentiation.

Portfolio Level

  • Macro Driver: GDP YoY is standardized into a Z-score.

  • Systematic Link: Vasicek’s single-factor model connects portfolio Through-the-Cycle (TTC) PDs to the macroeconomic cycle.

  • Calibration: Goal Seek ensures unconditional PIT PDs are consistent with observed default frequencies.

Obligor Level

  • Start from TTC PDs and apply PIT adjustments consistently across obligors.

  • To differentiate obligors within the same quarter, I introduced idiosyncratic shifts (e.g., Debt-to-Equity ratio).

  • This framework can be extended using Principal Component Analysis (PCA) across multiple borrower-level factors (leverage, liquidity, profitability, etc.) to extract orthogonal risk drivers for richer differentiation.

  • These shifts or factors adjust each obligor’s threshold in the Vasicek model, producing distinct PIT PDs.

  • Finally, obligor PITs are rescaled so their average aligns with the calibrated portfolio PIT.

 This approach ensures regulatory consistency at the portfolio level while producing economically intuitive obligor-level PDs — higher leverage or weaker fundamentals result in higher PIT PDs, while PCA allows multiple dimensions of risk to be captured systematically.

Friday, August 1, 2025

PD Model Development in Python:

 Python code and data link:

https://drive.google.com/drive/folders/1kC621QtmjG3C_2ok-I53fPYqDRf9r8RK?usp=sharing

A. Data Preparation

  • Import & Clean Data: Read factor data with ratings and defaults; handle missing values.

  • Target Variable Setup: Calculate yearly default rates and define the target (Default flag).

  • Data Split: Train-test split for robust model validation.

 B. Statistical Screening of Independent Variables

  • Stability Check (PSI): Ensure variable stability over time.

  • Discriminatory Power (KS-Stat): Select variables that distinguish well between default and non-default.

  • Predictive Power (IV & WoE): Retain only those with high predictive value.

  • Stationarity (ADF Test): Remove non-stationary series.

  • Multicollinearity (VIF): Drop highly correlated variables.

  • Partial Correlation: Remove redundant/confounding variables.

 C. Logistic Regression & Model Construction

  • Stepwise Logistic Regression: Based on p-values (< 0.01), build the core model.

  • PD Estimation: Generate scores and PD predictions with monotonicity checks.

  • Diagnostics: Autocorrelation (Durbin-Watson) and Heteroskedasticity (Breusch-Pagan) tests ensure statistical robustness.

D. Model Testing

  • Rating Assignment: Cluster PD outputs into buckets using K-means for interpretability.

  • Validation Tests:

    • Jeffreys Test and KS-Stat – Compare predicted vs actual default distributions.

E. Final Model Validation

  • Accuracy Checks: AUC-ROC, F1, Recall, Precision, Log Loss across Train/Test sets.

  • Cross-Validation: K-Fold CV for model generalization.

  • Regularization Checks:

    • Lasso Regression – Identifies non-contributing features.

    • Ridge Regression – Tests coefficient stability.

  • Model Comparison: Combine and review coefficients from Logit, Lasso, and Ridge models.

This pipeline balances statistical rigor with regulatory expectations, providing a ready-to-explain model for auditors, regulators, and internal committees. It’s a great base for both Basel and IFRS9/CECL-aligned PD model builds.

Saturday, January 25, 2025

Huber M-estimation (CCF for EAD):

 Huber M-estimation is a robust regression technique used to address the influence of outliers on model parameters. It is used to calculate CCF (Credit Conversion Factor) models for EAD (Exposure at Default).

Huber M-estimation ensures robust parameter estimation by minimizing the impact of extreme observations (e.g., outliers in utilization rates, credit line drawdowns, or other key drivers).

Huber M-estimation uses a loss function (1) that transitions from squared error to absolute error depending on a threshold 𝛿:
δ based on the expected distribution of residuals.

e.g. δ=m * Stdev of errors
- If ∣ri∣≤m * Stdev, weight wi=1

- If ∣ri∣>m * Stdev the weight wi= m * Stdev / ∣ri∣


Steps:
Y (CCF) =β0​+ β1​X+ ϵ,
fit the Ordinary Least Squares (OLS) regression:
β^​=(X^TX)^−1 * X^TY
residuals ri=yi−y^i

Define the Huber loss function (1) to calculate weights.

Using weights, modify the regression:
β^​=(X^T*W*X)^−1X^T*W*Y

Friday, December 15, 2023

Modeling Low Default Portfolio

The BCR Approach (Modeling Low Default Portfolio):


Benjamin, Cathcart and Ryan proposed adjustments to the Pluto & Tasche or called Confidence Based Approach that is widely applied by banks.

Pluto& Tasche propose a methodology for generating grade level PDs by the most prudent estimation, the BCR approach concentrates on estimating a portfolio-wide PD that then apply to grade level estimates and result in capital requirements.

- Independent case: The conservative portfolio estimate as in the BCR setting is therefore given by the solution of (1).


- Dependent Case: Assumed that there is a single normally distributed risk-factor Y to which all assets are correlated and that each asset has the correlation √ρ with the risk factor Y.

For a given value of the common factory=Y the conditional probability of default given a realization of the systematic factor Y is given by (2). The probability of default is equivalent to finding p such that the above is true.


- Multi-Period: Multi-period case:

The, the conditional probability of default given a realization of the systematic factor for t years as in the Vasicek model (3)


Estimation Method:

Steps of Execution:

1-     Draw N samples from N(λ,Σ) where λ is a zero vector with the same length as the time period and Σ is the correlation matrix as in the Vasicek model.

2-     Equation (4)



3-     Find p such that f(p) is close to zero using the following iteration:

-         Set the number of iterations:

n = log2((phigh−plow)/δ) where [plow, phigh]is the interval p is believed to be in and δ is the accepted error.

-         For n number of iterations, the midpoint, pmid, of the interval is calculated. It is then checked if f(pmid)>0 or<0.

If it’s the first case the lower bound is set equal to the midpoint, in the second case the higher bound is set equal to the midpoint.

-         When the n iterations are done the estimated probability of default is set to the final midpoint



 

Sunday, August 27, 2023

Python Generic Code (Probability of Default Model Development, Validation and Testing):

Python Generic Code (Probability of Default Model Development, Validation and Testing):
In the link below:

1- PD_Factors.csv: CSV with factors and required data
2- PD_Model_Generic_Python (Doc and PDF): Python generic code (as in steps)
3- PD_Estimate_Steps_Python: Steps in word as in Screenshot below





Friday, August 20, 2021

Asymptotic Single Risk Factor Model (ASRF):

 Key assumptions: asymptoticity, a single risk factor, and normality.

PD assumptions and violations:

Probability of observing D defaults over N (total number of exposures in the credit portfolio) independent random draws follows a binomial distribution.
PD ASRF model Binomial Distribution assumptions:
  i.  Each asset in the rating grade has default probability P.
 ii.  Each pair of assets has default correlation ρ
iii.  The conditional correlation between any two assets is constant even if the number of defaults increases.
iv.   Normal distribution assumption for the systematic factor
 
ASRF model assumptions may get violated:

Assumptions (i) and (ii):
Let x1, ..,xn be random indicator variables representing the default behavior of the assets where xj =1 indicates the default of asset j. Define as the probability of default of asset j given that assets 1 to j-1 are known to have defaulted.
Assumptions (i) and (ii) imply that:
P1 = P and P2 = P + (1 - P )*ρ
When assets are independent ρ = 0 than these assumptions lead to the Binomial distribution with Pj = P.
However, If ρ > 0, then x1, ..,xn are not independent than the assumption of Binomial distribution is violated.
Assumption (iii):
If the conditional correlation between any two assets increase as the number of defaults increases will lead to increase in default probability.
The increasing default probability given other defaults results in fatter tails of the Correlated Binomial distribution. Contrast assumption (3) with the Binomial distribution where the independence assumption implies that ρj = ρ for all j=1,..,n assets
 
Assumption (iv):
Systematic factor may follows an autoregressive process.

Thursday, August 5, 2021

Modeling Low Default Portfolio Dependent Case:

 Modeling Low Default Portfolio Dependent Case:


VASCIEK MODEL: Dependence between the default is explained by by Vasicek model.

By using conditional probability from the Vasicek model in the case where there are no defaults, the probability of default is the solution of below equations:




Friday, July 23, 2021

Low Default Portfolio (PD)

 Modeling Low Default Portfolio (Independent Default Events):

Pluto and Tasche method for calculating probability of default for portfolios with none or very few observations of defaults.
One-sided upper confidence bound as an estimator of PD.

Assumptions:
- n >0 borrowers in the portfolio.
- At the end of the observation period 0≤ d < n defaults are observed among the n borrowers.
- Default events are independent, hence the number of defaults in a portfolio is binomially distributed:
nCr * p^r * ((1-p)^(n-r)
n is the total number of borrowers, r is the total number of defaults and p is the probability of default.
PD to be logical, it should have the following characteristic:
p1 <= p2 <=p3 <=p4..........
It also means that p1=p2=p3=p4=p5...... In this scenario, all the 500 borrowers belong to the same risk characteristic, i.e. homogenous borrowers.

E.g: 
https://drive.google.com/file/d/1OmGmQV-AsYPsfdRYowSy1bkZArgEFMvN/view?usp=sharing




R3 chase - Pursuit

PIT PD Modeling Using Systematic Factor Approach

 Python Code and Data : https://drive.google.com/drive/folders/1d7vkT9SeXlELPjRRKDU3qUezibQaUL-y?usp=sharing Robust methodology to estimate ...