Campbell-Hilscher-Szilagyi Distress Probability
Install and import#
npm install fintech-algorithmsimport { campbellHilscherSzilagyiDistressProbability } from "fintech-algorithms/credit-risk-and-default/probability-of-default/campbell-hilscher-szilagyi-distress-probability";Signature#
campbellHilscherSzilagyiDistressProbability(nimtaavg, tlmta, exretavg, sigma, rsize, cashmta, market_to_book, log_price)Evaluates the published Campbell, Hilscher and Szilagyi twelve-month-lag logit with its eight accounting and market inputs, returning the failure log-odds, the distress probability, and each variable's contribution. The coefficients are fixed inside the function, not supplied by the caller.
Parameters#
| Name | Type | Notes |
|---|---|---|
nimtaavg | number | Geometrically weighted average net income over market-valued total assets. |
tlmta | number | Total liabilities over market-valued total assets. min: 0 |
exretavg | number | Geometrically weighted average excess return over the market index. |
sigma | number | Annualised volatility of daily equity returns over the prior quarter. min: 0 |
rsize | number | Relative size, the log of the firm's share of total market capitalisation. |
cashmta | number | Cash and short-term investments over market-valued total assets. min: 0 |
market_to_book | number | The firm's market-to-book ratio. |
log_price | number | Log of the share price, truncated above in the source study before it reaches this function. |
Returns#
{ published_intercept: number; score_contributions: Record<string, number>; failure_log_odds: number; distress_probability: number; state: string; reason: string }
published_intercept is the paper's constant of -9.164 and score_contributions maps each input name to its value times the published coefficient. failure_log_odds is the intercept plus those contributions and distress_probability is the logistic transform of it. state is published-score-replication and reason names the table the coefficients come from.
Errors#
- When any argument is not a finite number — throws Error
- When sigma, tlmta, or cashmta 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.0150.62-0.040.48-8.50.081.82.3Call#
campbellHilscherSzilagyiDistressProbability(nimtaavg, tlmta, exretavg, sigma, rsize, cashmta, market_to_book, log_price)Returns#
object with 6 fields: published_intercept, score_contributions, failure_log_odds, distress_probability, state, reason
{
"published_intercept": -9.164,
"score_contributions": {
"nimtaavg": 0.30396,
"tlmta": 0.87792,
"exretavg": 0.28516,
"sigma": 0.67728,
"rsize": 0.3825,
"cashmta": -0.17056,
"market_to_book": 0.135,
"log_price": -0.1334
},
"failure_log_odds": -6.80614,
"distress_probability": 0.00110573352,
"state": "published-score-replication",
"reason": "chs-table-4-twelve-month-lag-coefficients"
}Other exports#
This module also exports
logisticPdModel, probitPdModel, throughTheCyclePd, pointInTimePd, mertonDistanceToDefault, 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#
Campbell-Hilscher-Szilagyi Distress Probability calculation flow
flowchart LR
S1["Verify the paper version failure label coefficient row"]
S2["Validate all eight inputs and their scoretime availabi"]
S3["Multiply each variable by its published coefficient"]
S4["Add the 9164 intercept and apply the logistic transfor"]
S5["Return contributions score probability and an explicit"]
S1 --> S2
S2 --> S3
S3 --> S4
S4 --> S5
S5 --> D{"any lag feature winsorization or coefficient mismatch inva"}
D --> O["distress_probability + diagnostics"]
O --> A["Audit: failurelogodds equals 9164 plus every reported contributio"]
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#
- In Search of Distress Risk — John Y. Campbell, Jens Hilscher, and Jan Szilagyi
- Supervisory Guidance on Model Risk Management — OCC, Board of Governors of the Federal Reserve System, and FDIC
- Evidence boundary