Library/Market Breadth and Internals/Concentration and Diffusion

D04-F05-A05 / Complete engineering topic

Factor Diffusion Index

A production-minded guide to Factor Diffusion Index.

D04 · MARKET BREADTH AND INTERNALS
D04-F05-A05Canonical / Tested / Open
D04 / D04-F05
Key concepts

The governed definitions this build depends on. Read them first if a term is unfamiliar.

The operational question

Market breadth is not one idea. A headline move can be driven by a few constituents, a weight vector can be concentrated before any return occurs, and a signal can spread across sectors or factor sleeves without those components being independent. Factor Diffusion Index owns one precise question: how broadly is a declared signal improving across a fixed set of factor sleeves?

Several factor sleeves can improve together because they share holdings. This diagnostic counts participation while keeping that overlap limitation visible. That is a diagnostic and governance outcome, not a forecast, recommendation, legal classification, or promise of diversification.

Intuition before notation

Treat each factor sleeve as one component of a breadth panel; the output describes cross-factor participation, not a provider factor index. Sector diffusion spans industry groups; factor diffusion spans systematic strategy sleeves whose holdings may overlap heavily.

Where the method sits in Concentration and Diffusion

The family map prevents a category error. Contribution combines beginning weight and realized return. HHI and effective N inspect the weight vector before returns. Diffusion scores direction across a fixed component panel. Choosing the wrong branch may produce valid arithmetic that answers the wrong question.

Freeze the series identity

The selected formula is:

Dfactor=100N++0.5N0ND_{\mathrm{factor}}=100\frac{N_+ + 0.5N_0}{N}

Apply the declared signal, horizon, direction convention, and tolerance to each factor sleeve, then average 1/0.5/0 scores. Factor identities, construction methods, return basis, currency, horizon, availability time, and tolerance are part of the series identity. The relevant primary source establishes the underlying convention; the exact diagnostic, translated universe, and parameters remain package choices where stated.

The snapshot needs unique identifiers, finite values, complete coverage, and one point-in-time methodology. as_of is not enough in production: retain observation, availability, and knowledge times plus source owner, revision, and finality. A later corrected roster or classification must not overwrite what was knowable at the earlier cutoff.

Required input

FieldTypeUnit and rule
as_ofISO datecommon observation cutoff; retain availability and knowledge time separately
component_idstringunique fixed factor sleeve with a declared provider/methodology identity
signal_changefinite numberdecimal change for one synchronized sleeve signal, horizon, direction convention, return basis, and currency
readybooleanfalse means cross-factor coverage is incomplete
tolerancenonnegative numberdecimal deadband; exact +/- tolerance is unchanged

Output and refusal behavior

Return value from 0 to 100 and class counts. The score describes equal-sleeve directional participation only; it is not a provider factor index, diversification ratio, or independence statistic.

The reference API deliberately matches sector-diffusion arithmetic while enforcing factor-sleeve identity in the data contract. The lab changes tolerance and scenarios without pretending the votes are independent.

Read the mathematics, not only the score

The 1/0.5/0 transform is identical to sector diffusion, but the component identity is a fixed factor-sleeve methodology. Exact tolerance equality is unchanged, and every sleeve receives one vote regardless of assets or holdings overlap.

  • 0 <= D_factor <= 100 and class counts sum to the fixed sleeve count.
  • Exact +tolerance and -tolerance observations are unchanged.
  • Replacing a provider methodology, factor definition, currency, horizon, or signal creates a new series.
  • A high score does not imply independent exposures: Value, Quality, Momentum, and other sleeves may own many of the same securities.

The output must travel with its series identity and diagnostic trace. A bare number strips away the universe, methodology, horizon, tolerance, and evidence status needed to interpret it.

Work the synthetic example

The following is labelled synthetic and all arithmetic is author-derived:

ComponentSignal changeClassScore
Value1.400%improving1
Momentum1.100%improving1
Quality0.700%improving1
Low Size0.300%improving1
Low Volatility0.000%unchanged0.5
High Yield-0.200%unchanged0.5
Growth-0.600%deteriorating0
Profitability-0.900%deteriorating0

The exact expected result is:

JSON
{
  "status": "resolved",
  "value": 62.5,
  "improving": 4,
  "unchanged": 2,
  "deteriorating": 2,
  "total": 8
}

The canonical distribution and decision boundary

The visual keeps the distribution beside the aggregate. That matters because two identical aggregate values can conceal different component states. The values are synthetic teaching inputs; the displayed result is author-derived arithmetic.

Compare nearby methods

VariantComponent universe or voteBest useMain limitation
Equal-sleeve diffusion (selected)one vote per fixed factor sleeveaudit breadth across declared strategiesoverlapping holdings mean votes are not independent
Asset-weighted factor diffusionweight sleeves by assets or allocationdescribe a specific portfolioallocation changes alter the series
Constituent-level factor breadthclassify securities within one factorinspect internal participationanswers a different within-sleeve question
Continuous factor averageaverage raw sleeve signalsretain magnitudecan be dominated by one sleeve and is not diffusion

The comparison is part of the contract. A different numerator, denominator, component universe, weighting rule, tolerance, or signal horizon is not a cosmetic option—it defines a different series.

Implementation walkthrough

The reference algorithm validates before aggregating:

Plain text
validate a fixed set of provider/methodology-identified factor sleeves
validate synchronized signal, return basis, currency, horizon, and tolerance
classify each sleeve with strict tolerance boundaries
assign scores 1, 0.5, or 0 and average equal votes
return value, class counts, and sleeve-level trace

Validate provider and methodology identity before arithmetic, preserve sleeve-level classes, and route independence questions to covariance rather than the diffusion score.

Python and TypeScript consume the same JSON fixture and return the same resolved fields. Invalid or incomplete input raises rather than being repaired. The playground deliberately translates its failure fixture into a visible withheld state because its job is to teach the refusal boundary.

Guided lab

Open the guided playground. Start from the informative canonical state, switch to Comparison, then Failure / boundary. Use Back and Step to inspect how each component enters the result. Change the tolerance and compare broad factor participation, a split panel, and an incomplete sleeve set. Reset restores the exact canonical state, and reduced-motion Play advances one deterministic observation without starting a timer.

The calculation flow shows why point-in-time validation precedes aggregation.

Put the diagnostic into an operating workflow

Use the panel to ask whether a declared signal is improving across the same strategy sleeves. Pair it with holdings-overlap or covariance analysis before making any statement about diversification.

A robust dashboard retains the input snapshot, formula version, parameters, component trace, and refusal reason. It should make methodology or taxonomy changes visible as breaks in series identity rather than quietly splicing them into history.

Edge cases and misuse boundaries

Do not imply independence among factors, mix provider constructions, or call a high reading a forecast of aggregate market return. Missing components are neither zero nor unchanged. A different roster, taxonomy, factor provider, share-class policy, currency, return basis, horizon, or tolerance defines a different series.

Main takeaway: Cross-factor participation is useful, but equal votes across overlapping sleeves are not independent bets.

Passing implementation tests proves that the code matches the selected definition. It does not prove association with future returns, usefulness after costs, causation, or suitability for an investment decision.

Evidence and historical boundary

The source records in REFERENCES.md establish only the claims mapped to them. They do not establish the synthetic numbers or silently define this package's translated universe and parameters.

A named historical case is deferred until fixed licensed factor-sleeve methodologies, complete same-basis signals, availability timestamps, holdings-overlap evidence, revisions, and redistribution permission. Deferral is a publication boundary, not a missing-data invitation: the public tutorial uses a transparent synthetic case rather than an irreproducible observed value.

Summary and handoff

You can now calculate D_{\mathrm{factor}}=100\frac{N_+ + 0.5N_0}{N}, identify the series-defining choices, interpret its edge regimes, preserve the audit trace, and reject incomplete snapshots. Continue with Covariance.

Primary sources and exact limitations are recorded in REFERENCES.md.

Calculation Flow — Factor Diffusion Index

Purpose: validate series identity before producing the diagnostic.

Rendering system map…

Takeaway: Missing evidence is a state, never a zero contribution or neutral component.

ReferencesPrimary sources and evidence notes

Expand the source trail, evidence role, and limitations behind the engineering choices.

Claim-to-source map

Material claimEvidenceClassification
Diffusion can score increase/unchanged/decrease as 1/0.5/0TCB-DIFFsourced transform
Named factor sleeves are rules-based provider objectsMSCI-FACTORSsourced provider scope
Equal sleeve votes and the 0.2% tolerancedefinition contractpackage application and parameter choice
Canonical valuesdatasets/canonical-fixture.jsonsynthetic input and author-derived calculation

Every external source ID mapped above is expanded below. Provider or institutional conventions are not presented as universal laws; package translations and parameters remain labelled as implementation choices.

TCB-DIFF — How to Compute Diffusion Indexes

  • Organization or authors: The Conference Board
  • Source type: Institutional technical methodology
  • Publication or effective date: 2012 technical-note convention
  • Version: Web methodology accessed 2026-07-26
  • URL or DOI: https://www.conference-board.org/data/bci/index.cfm?id=2180
  • Accessed: 2026-07-26
  • Jurisdiction: Global methodology unless the limitation states otherwise
  • Supports: Diffusion scoring of 1 for increase, 0.5 for unchanged, 0 for decrease, divided by component count and multiplied by 100.
  • Limitations: The source applies the convention to business-cycle components; sector and factor application here is an explicit package choice.

MSCI-FACTORS — MSCI Factor Indexes

  • Organization or authors: MSCI
  • Source type: Official index-provider overview
  • Publication or effective date: Current page accessed 2026-07-26
  • Version: Current web overview
  • URL or DOI: https://www.msci.com/indexes/factor-indexes/msci-factor-indexes
  • Accessed: 2026-07-26
  • Jurisdiction: Global methodology unless the limitation states otherwise
  • Supports: Factor indexes are rules-based and may represent Value, Low Size, Low Volatility, High Yield, Quality, Momentum, and Growth.
  • Limitations: Does not define a Factor Diffusion Index; the cross-factor diffusion transform is package-selected and must not be attributed to MSCI.
factor_diffusion_index.ts
type Row = Record<string, unknown>;
const numberValue = (value: unknown, name: string): number => {
  if (typeof value !== "number" || !Number.isFinite(value)) throw new Error(`${name} must be a finite number`);
  return value;
};
const validateRows = (rows: Row[], weighted: boolean): void => {
  if (!rows.length) throw new Error("rows must not be empty");
  const seen = new Set<string>();
  for (const row of rows) {
    const key = row[weighted ? "security_id" : "component_id"];
    if (typeof key !== "string" || !key || seen.has(key)) throw new Error("component identifiers must be nonempty and unique");
    seen.add(key);
    if (row.ready === false) throw new Error("incomplete_component");
  }
};

export function calculate(rows: Row[], tolerance = 0.002) {
  validateRows(rows, false); tolerance=numberValue(tolerance,"tolerance");
  if (tolerance < 0) throw new Error("tolerance must be nonnegative");
  const changes=rows.map(row=>numberValue(row.signal_change,"signal_change"));
  const improving=changes.filter(x=>x>tolerance).length, deteriorating=changes.filter(x=>x < -tolerance).length, unchanged=rows.length-improving-deteriorating;
  return {status:"resolved", value:100*(improving+0.5*unchanged)/rows.length, improving, unchanged, deteriorating, total:rows.length};
}
Full-height labplaygroundOpen full screen