# Model Applicability and Variant Router

`D18-F09-A04` · Fundamental Analysis and Valuation → Integrated Equity Scoring · archetype `record-transform` · difficulty 3/5 · verification **verified**

Full page: https://docs.thefintechbuilder.com/fundamental-analysis-and-valuation/integrated-equity-scoring/model-applicability-and-variant-router/
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 { modelApplicabilityAndVariantRouter } from "fintech-algorithms/fundamental-analysis-and-valuation/integrated-equity-scoring/model-applicability-and-variant-router";
```

## Signature

```ts
modelApplicabilityAndVariantRouter(data)
```

Tests each requested scoring model against a frozen applicability rule for the target and returns the variant to run, a reroute, or an unsupported marker for labels the router does not know.

## Parameters

| Name | Type | Required | Notes |
| --- | --- | --- | --- |
| `data` | `{ target: { is_public?: boolean; sector?: string; market_cap?: number; annual_periods?: number; dividends_known?: boolean; total_assets?: number; framework?: string }; requested_models: string[] }` | yes | `target` supplies the scope facts the rules read — `is_public`, `sector`, `market_cap`, `annual_periods`, `dividends_known`, `total_assets` and `framework` — and `requested_models` names the models to route. The recognised labels are `altman_z_original`, `piotroski_f`, `beneish_m`, `ohlson_o`, `dividend_safety` and `balance_sheet_resilience`; any other label routes as unsupported. |

## Returns

`{ state: string; method: string; routes: Array<{ model: string; status: string; variant: string | null; population?: string; reason: string }>; eligible_count: number; requested_count: number; coverage: number }`

One route per requested model. `status` is `eligible`, `reroute` or `unsupported`; `variant` names the frozen convention to use when eligible and is null otherwise; `population` states the contract a known label targets. `eligible_count` over `requested_count` gives `coverage`, and `state` is `routed` when at least one model is eligible, otherwise `abstain`.

## Errors

- When target is missing or not an object, or requested_models is not a nonempty list — throws TypeError
- When a requested model name is not text — throws TypeError

## 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
{
  "target": {
    "id": "TGT",
    "sector": "industrial",
    "is_public": true,
    "annual_periods": 3,
    "framework": "US-GAAP",
    "total_assets": 1000,
    "market_cap": 2000,
    "dividends_known": true
  },
  "requested_models": [
    "altman_z_original",
    "piotroski_f",
    "beneish_m",
    "ohlson_o",
    "dividend_safety",
    "balance_sheet_resilience"
  ]
}
```

### Call

```ts
modelApplicabilityAndVariantRouter(data)
```

### Returns

object with 6 fields: state, method, routes, eligible_count, requested_count, coverage

```json
{
  "state": "routed",
  "method": "explicit-model-applicability-router",
  "routes": [
    {
      "model": "altman_z_original",
      "status": "eligible",
      "variant": "Use D18-F04-A01 original public-manufacturer coefficients",
      "population": "public industrial manufacturer",
      "reason": "all required scope facts pass"
    },
    {
      "model": "piotroski_f",
      "status": "eligible",
      "variant": "Use D18-F04-A02 nine-signal contract",
      "population": "non-financial issuer with two annual periods",
      "reason": "all required scope facts pass"
    },
    {
      "model": "beneish_m",
      "status": "eligible",
      "variant": "Use D18-F04-A03 eight-index contract",
      "population": "non-financial issuer with two annual periods",
      "reason": "all required scope facts pass"
    }
  ],
  "eligible_count": 6,
  "requested_count": 6,
  "coverage": 1
}
```

## Other exports

`calculate`, `pointInTimeStockScoringInputAssembly`, `stockScoringPeerCohortResolver`, `fundamentalMetricDirectionAndPeerNormalization`, `accountingFinancialHealthComposite`, `earningsQualityComposite`, `dividendSafetyScore`, `balanceSheetResilienceScore`, `distressModelEnsemble`, `crossModelConflictAndDoubleCountingResolver`, `overallExplainableStockScore`, `scoreConfidenceMissingDataPenaltyAndAbstention`, `marketWideStockScreeningAndRanking`, `stockScoreHistoryMigrationAndChangeAttribution`. 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/integrated-equity-scoring/model-applicability-and-variant-router/
- Implementation source: https://github.com/IslamBaraka90/Fintech-Algorithms-Library/blob/main/src/fundamental-analysis-and-valuation/integrated-equity-scoring/model-applicability-and-variant-router/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
