Point-in-Time PD
Install and import#
npm install fintech-algorithmsimport { pointInTimePd } from "fintech-algorithms/credit-risk-and-default/probability-of-default/point-in-time-pd";Signature#
pointInTimePd(through_the_cycle_pd_value, borrower_log_odds_shift, macro_factor_z, macro_sensitivity, alert_threshold)Overlays a borrower-specific shift and a macro shift on the log-odds of a through-the-cycle default probability, returning the resulting point-in-time probability and the size of each shift.
Parameters#
| Name | Type | Notes |
|---|---|---|
through_the_cycle_pd_value | number | The long-run default probability used as the baseline. Converted to log-odds before the overlays are applied. exclusive_min: 0 · exclusive_max: 1 |
borrower_log_odds_shift | number | An additive adjustment in log-odds space carrying borrower-specific information. Positive values raise the probability. |
macro_factor_z | number | The macroeconomic factor value for the period, multiplied by macro_sensitivity to give the macro shift. |
macro_sensitivity | number | How strongly the log-odds respond to the macro factor. This package's convention requires it to be zero or greater. min: 0 |
alert_threshold | number | The probability at or above which the borrower is flagged, compared with the point-in-time probability using a greater-than-or-equal test. exclusive_min: 0 · exclusive_max: 1 |
Returns#
{ through_the_cycle_pd: number; baseline_log_odds: number; borrower_log_odds_shift: number; macro_log_odds_shift: number; point_in_time_pd: number; cycle_uplift: number; alert_threshold: number; state: string; reason: string }
baseline_log_odds is the log-odds of the supplied long-run probability and macro_log_odds_shift is sensitivity times factor. point_in_time_pd is the logistic transform of the baseline plus both shifts, and cycle_uplift is that probability minus the long-run one. state is at-or-above-alert or below-alert, and reason records that this overlay is a declared package convention rather than a universal regulatory or accounting formula.
Errors#
- When any argument is not a finite number — throws Error
- When through_the_cycle_pd_value or alert_threshold is not strictly between zero and one — throws Error
- When macro_sensitivity is negative — throws Error
Complexity: time O(1),
space O(1).
Worked example#
verified This is the worked example published in the article, replayed by the test suite on every run. The output cannot drift.
Input#
0.030.250.80.550.06Call#
pointInTimePd(through_the_cycle_pd_value, borrower_log_odds_shift, macro_factor_z, macro_sensitivity, alert_threshold)Returns#
object with 9 fields: through_the_cycle_pd, baseline_log_odds, borrower_log_odds_shift, macro_log_odds_shift, point_in_time_pd, cycle_uplift, alert_threshold, state, …
{
"through_the_cycle_pd": 0.03,
"baseline_log_odds": -3.476098689835,
"borrower_log_odds_shift": 0.25,
"macro_log_odds_shift": 0.44,
"point_in_time_pd": 0.058080015587,
"cycle_uplift": 0.028080015587,
"alert_threshold": 0.06,
"state": "below-alert",
"reason": "declared-log-odds-overlay-not-universal-ifrs-or-regulatory-formula"
}Other exports#
This module also exports
logisticPdModel, probitPdModel, throughTheCyclePd, mertonDistanceToDefault, campbellHilscherSzilagyiDistressProbability, bharathShumwayNaiveDistanceToDefault, calculate. Every module additionally exports run as an alias of its
primary function, and a meta object carrying its catalog id, domain, family,
shape and article URL.
Diagrams#
Calculation flow#
Point-in-Time PD calculation flow
flowchart LR
S1["Freeze target horizon TTC anchor scenario vintage and "]
S2["Convert TTC PD to baseline logodds"]
S3["Calculate borrower and macro shifts separately"]
S4["Add shifts and apply a stable sigmoid"]
S5["Return PIT PD uplift contributions threshold state and"]
S1 --> S2
S2 --> S3
S3 --> S4
S4 --> S5
S5 --> D{"the TTC anchor must lie strictly inside 01 and scenario di"}
D --> O["point_in_time_pd + diagnostics"]
O --> A["Audit: macrofactorz 0 and borrower shift 0 reproduces TTC PD"]
How it works#
This page states the contract — how to call it correctly. The article explains the concept: why it works, and where it breaks.
References#
- A survey of cyclical effects in credit risk measurement models — Linda Allen and Anthony Saunders
- IFRS 9 Financial Instruments — International Accounting Standards Board
- IRB approach: minimum requirements to use IRB approach — Basel Committee on Banking Supervision
- Supervisory Guidance on Model Risk Management — OCC, Board of Governors of the Federal Reserve System, and FDIC
- Evidence boundary