# Zmijewski X-Score

`D18-F04-A06` · Fundamental Analysis and Valuation → Quality and Distress · archetype `record-transform` · difficulty 2/5 · verification **verified**

Full page: https://docs.thefintechbuilder.com/fundamental-analysis-and-valuation/quality-and-distress/zmijewski-x-score/
Agent skill: `npx skills add IslamBaraka90/Fintech-Algorithms-Library` — https://docs.thefintechbuilder.com/guides/agent-skill/

## 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

```ts
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

| Name | Type | Required | Notes |
| --- | --- | --- | --- |
| `data` | `{ total_assets: number; total_liabilities: number; current_assets: number; current_liabilities: number; net_income: number }` | yes | 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

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`:

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

### Call

```ts
zmijewskiXScore(data)
```

### Returns

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

```json
{
  "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

`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.

## Verification and provenance

Tier: **verified** (via D).

The worked example below is the figure published in this algorithm's article, replayed and asserted by the test suite on every build. The arithmetic cannot drift without the build failing.

Both tiers guarantee the signature. Full explanation: https://docs.thefintechbuilder.com/guides/verification/

Generated from the docs.json payload shipped inside fintech-algorithms@0.13.0.
The signature and parameter list are checked against the compiled implementation at build time,
so a description that contradicts the code fails the build rather than reaching this file.

## Links

- Article (how it works, step by step): https://thefintechbuilder.com/fundamental-analysis-and-valuation/quality-and-distress/zmijewski-x-score/
- Implementation source: https://github.com/IslamBaraka90/Fintech-Algorithms-Library/blob/main/src/fundamental-analysis-and-valuation/quality-and-distress/zmijewski-x-score/impl.ts
- Package on npm: https://www.npmjs.com/package/fintech-algorithms
- Domain index for agents: https://docs.thefintechbuilder.com/fundamental-analysis-and-valuation/llms.txt
