# Dechow-Dichev Accrual Quality

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

Full page: https://docs.thefintechbuilder.com/fundamental-analysis-and-valuation/quality-and-distress/dechow-dichev-accrual-quality/
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 { dechowDichevAccrualQuality } from "fintech-algorithms/fundamental-analysis-and-valuation/quality-and-distress/dechow-dichev-accrual-quality";
```

## Signature

```ts
dechowDichevAccrualQuality(data)
```

Runs the firm-specific Dechow-Dichev regression of scaled working-capital accruals on lagged, current and leading operating cash flow, and reports the residual standard deviation as the accrual-quality measure.

## Parameters

| Name | Type | Required | Notes |
| --- | --- | --- | --- |
| `data` | `{ observations: { period: string; cfo_scaled: number; working_capital_accrual_scaled: number }[] }` | yes | `observations` must be an array of at least seven period records ordered in time. Each record needs a unique non-empty `period` label, a `cfo_scaled` value and a `working_capital_accrual_scaled` value. The first and last records are used only as the lag and lead for their neighbours, so the regression is fitted on the interior periods. |

## Returns

`{ state: string; method: string; coefficients: { intercept: number; cfo_t_minus_1: number; cfo_t: number; cfo_t_plus_1: number }; estimation_periods: string[]; fitted_accruals: number[]; residuals: number[]; accrual_quality: number; interpretation: string; available_after_period: string }`

`coefficients` holds the fitted intercept and the three cash-flow slopes. `estimation_periods` lists the interior period labels actually regressed, with `fitted_accruals` and `residuals` aligned to it. `accrual_quality` is the residual standard deviation using degrees of freedom equal to the observation count less the four coefficients, so a larger value means lower quality, which `interpretation` restates. `available_after_period` is the label of the final observation, since the last interior fit needs its lead. `method` is `dechow-dichev-2002-firm-specific` and `state` is `calculated`.

## Errors

- When data is not a plain object — throws TypeError
- When cfo_scaled or working_capital_accrual_scaled is missing or not a finite number — throws TypeError
- When observations is not an array, holds fewer than seven records, or contains a non-object entry — throws RangeError
- When a period label is empty or repeated — throws RangeError
- When the regression design matrix is singular — throws RangeError

## Complexity

Time `O(n)`, space `O(n)`.

## 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
{
  "observations": [
    {
      "period": "Y1",
      "cfo_scaled": 0.082,
      "working_capital_accrual_scaled": 0.011
    },
    {
      "period": "Y2",
      "cfo_scaled": 0.064,
      "working_capital_accrual_scaled": 0.018
    },
    {
      "period": "Y3",
      "cfo_scaled": 0.091,
      "working_capital_accrual_scaled": -0.006
    }
  ]
}
```

### Call

```ts
dechowDichevAccrualQuality(data)
```

### Returns

object with 9 fields: state, method, coefficients, estimation_periods, fitted_accruals, residuals, accrual_quality, interpretation, …

```json
{
  "state": "calculated",
  "method": "dechow-dichev-2002-firm-specific",
  "coefficients": {
    "intercept": 0.03644529821051595,
    "cfo_t_minus_1": 0.04149503236651636,
    "cfo_t": -0.5247590858810153,
    "cfo_t_plus_1": 0.06807435790812336
  },
  "estimation_periods": ["Y2", "Y3", "Y4", "Y5", "Y6", "Y7"],
  "fitted_accruals": [
    0.012458075937824543,
    -0.0054526017115175875,
    0.022705476699814174,
    -0.011870859874287619,
    0.00953492500736294,
    -0.0031794130798601925
  ],
  "residuals": [
    0.005541924062175456,
    -0.0005473982884824126,
    -0.0017054766998141728,
    -0.0001291401257123813,
    -0.0005349250073629404,
    0.00017941307986019247
  ],
  "accrual_quality": 0.003108868359945476,
  "interpretation": "higher residual dispersion means lower accrual quality",
  "available_after_period": "Y10"
}
```

## Other exports

`calculate`, `altmanZScore`, `piotroskiFScore`, `beneishMScore`, `sloanAccrualMeasure`, `ohlsonOScore`, `zmijewskiXScore`, `springateSScore`, `tafflerZScore`, `fulmerHScore`, `groverGScore`, `dechowFScoreForMisstatementRisk`, `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/dechow-dichev-accrual-quality/
- Implementation source: https://github.com/IslamBaraka90/Fintech-Algorithms-Library/blob/main/src/fundamental-analysis-and-valuation/quality-and-distress/dechow-dichev-accrual-quality/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
