fintech-algorithms
Using a coding agent? Give it the skill: npx skills add IslamBaraka90/Fintech-Algorithms-Library What it does →

Through-the-Cycle PD

Install and import#

bash
npm install fintech-algorithms
ts
import { throughTheCyclePd } from "fintech-algorithms/credit-risk-and-default/probability-of-default/through-the-cycle-pd";

Signature#

throughTheCyclePd(annual_obligors, annual_defaults, current_year_index, minimum_years)

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#

annual_obligors
[1000, 1050, 980, 1100, 1080, 1120]

Showing 6 of 8 elements.

annual_defaults
[8, 11, 20, 15, 7, 25]

Showing 6 of 8 elements.

current_year_index
5
minimum_years
5

Call#

throughTheCyclePd(annual_obligors, annual_defaults, current_year_index, minimum_years)

Returns#

object with 8 fields: annual_default_rates, through_the_cycle_pd, pooled_default_rate, current_observed_default_rate, cycle_gap, observation_years, state, reason

{
  "annual_default_rates": [
    0.008,
    0.010476190476,
    0.020408163265,
    0.013636363636,
    0.006481481481,
    0.022321428571
  ],
  "through_the_cycle_pd": 0.013181297202,
  "pooled_default_rate": 0.013163972286,
  "current_observed_default_rate": 0.022321428571,
  "cycle_gap": 0.00914013137,
  "observation_years": 8,
  "state": "current-above-long-run",
  "reason": "simple-average-of-annual-one-year-rates"
}

Other exports#

This module also exports logisticPdModel, probitPdModel, pointInTimePd, 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#

Through-the-Cycle PD — article hero
Through-the-Cycle PD — evidence clock
Through-the-Cycle PD — formula anatomy
Through-the-Cycle PD — method comparison
Through-the-Cycle PD — system map
Through-the-Cycle PD — validation layers

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.

Read the article →

References#

The rest of the Probability of Default family#