Factor Diffusion Index
Install and import#
npm install fintech-algorithmsimport { calculate } from "fintech-algorithms/market-breadth-and-internals/concentration-and-diffusion/factor-diffusion-index";Signature#
calculate(rows, tolerance)The same diffusion measure across factors rather than sectors — momentum, size, volatility — showing whether a move is broad across styles or concentrated in one.
Parameters#
| Name | Type | Notes |
|---|---|---|
rows | Row[] | One row per factor carrying its signal change. Rows carry a ready flag; a row that is not ready is excluded rather than treated as zero, because a missing count and a count of zero mean opposite things about market breadth. |
tolerance | number | Band within which a change counts as unchanged. min: 0 |
Returns#
{ status, value, improving, unchanged, deteriorating, total }
The diffusion value with its component counts.
Errors#
- When tolerance is negative — throws
Complexity: time O(n),
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#
[
{
"component_id": "Value",
"signal_change": 0.014,
"ready": true
},
{
"component_id": "Momentum",
"signal_change": 0.011,
"ready": true
},
{
"component_id": "Quality",
"signal_change": 0.007,
"ready": true
}
]Showing 3 of 8 elements.
0.002Call#
calculate(rows, tolerance)Returns#
object with 6 fields: status, value, improving, unchanged, deteriorating, total
{
"status": "resolved",
"value": 62.5,
"improving": 4,
"unchanged": 2,
"deteriorating": 2,
"total": 8
}Diagrams#
Calculation flow#
Calculation Flow — Factor Diffusion Index
flowchart LR
A["Point-in-time component snapshot"] --> B{"Complete, unique, finite?"}
B -->|"No"| X["Incomplete — withhold value"]
B -->|"Yes"| C["Apply Factor Diffusion Index contract"]
C --> D["Retain component audit trace"]
D --> E["Publish value, unit, parameter, and as-of"]
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#
- Claim-to-source map
- How to Compute Diffusion Indexes — The Conference Board
- MSCI Factor Indexes — MSCI