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

Zmijewski X-Score

Install and import#

bash
npm install fintech-algorithms
ts
import { zmijewskiXScore } from "fintech-algorithms/fundamental-analysis-and-valuation/quality-and-distress/zmijewski-x-score";

Signature#

zmijewskiXScore(data)

Computes Zmijewski's 1984 three-variable probit index from return on assets, leverage and the current ratio, and converts it to a distress probability through the standard normal CDF.

Parameters#

NameTypeNotes
data{ total_assets: number; total_liabilities: number; current_assets: number; current_liabilities: number; net_income: number }One accounting record. net_income over total_assets gives ROA, total_liabilities over total_assets gives leverage, and current_assets over current_liabilities gives the current ratio.

Returns#

{ state: string; method: string; variables: { roa: number; leverage: number; current_ratio: number }; x_score: number; probit_probability: number; screen: string; index_cutoff: number }

variables holds the three inputs to the index. x_score applies the intercept -4.336 with coefficients -4.513 on ROA, 5.679 on leverage and 0.004 on the current ratio. probit_probability is the normal CDF of that index, computed with a rational approximation to erf. index_cutoff is 0 and screen is distress-side when the index is above zero and non-distress-side otherwise. method is zmijewski-1984-probit and state is calculated.

Errors#

  • When data is not a plain object — throws TypeError
  • When any field read is missing or not a finite number — throws TypeError
  • When total_assets or current_liabilities is zero or negative — throws RangeError
  • When total_liabilities is negative — throws RangeError

Complexity: time O(1), space O(1).

Worked example#

executed Captured by running this function on the input its own test provides. Real output of real code — but not asserted against a published figure.

Input#

data
{
  "total_assets": 1000,
  "total_liabilities": 550,
  "current_assets": 450,
  "current_liabilities": 250,
  "net_income": 80
}

Call#

zmijewskiXScore(data)

Returns#

object with 7 fields: state, method, variables, x_score, probit_probability, screen, index_cutoff

{
  "state": "calculated",
  "method": "zmijewski-1984-probit",
  "variables": {
    "roa": 0.08,
    "leverage": 0.55,
    "current_ratio": 1.8
  },
  "x_score": -1.5663899999999997,
  "probit_probability": 0.0586286812026503,
  "screen": "non-distress-side",
  "index_cutoff": 0
}

Other exports#

This module also exports calculate, altmanZScore, piotroskiFScore, beneishMScore, sloanAccrualMeasure, ohlsonOScore, springateSScore, tafflerZScore, fulmerHScore, groverGScore, dechowFScoreForMisstatementRisk, dechowDichevAccrualQuality, modifiedJonesDiscretionaryAccrualModel. 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#

Zmijewski X-Score — evidence clock
Zmijewski X-Score — model anatomy
Zmijewski X-Score — system map
Zmijewski X-Score — threshold and interpretation
Zmijewski X-Score — variant boundaries

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 Quality and Distress family#