# Score Confidence, Missing-Data Penalty, and Abstention

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

Full page: https://docs.thefintechbuilder.com/fundamental-analysis-and-valuation/integrated-equity-scoring/score-confidence-missing-data-penalty-and-abstention/
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 { scoreConfidenceMissingDataPenaltyAndAbstention } from "fintech-algorithms/fundamental-analysis-and-valuation/integrated-equity-scoring/score-confidence-missing-data-penalty-and-abstention";
```

## Signature

```ts
scoreConfidenceMissingDataPenaltyAndAbstention(data)
```

Turns component coverage, data staleness and conflict count into a confidence figure, penalises the base score for what is missing or contested, and decides whether the score should be withheld.

## Parameters

| Name | Type | Required | Notes |
| --- | --- | --- | --- |
| `data` | `{ base_score: number; required_components: number; available_components: number; stale_days: number; conflict_count: number; max_conflicts: number; minimum_components: number }` | yes | `base_score` is the score to adjust and must be between 0 and 100. `available_components` over `required_components` gives coverage and may not exceed it; `conflict_count` is measured against `max_conflicts` and may not exceed it; `minimum_components` is the abstention floor applied to `available_components`; `stale_days` ages the inputs. All counts are truncated to integers. |

## Returns

`{ state: string; method: string; base_score: number; coverage: number; missing_penalty: number; staleness_penalty: number; conflict_penalty: number; confidence: number; adjusted_score: number; abstain: boolean; reason: string }`

`coverage` is available over required and `missing_penalty` one minus it. `staleness_penalty` is stale days over 365 capped at one and scaled by 0.2, and `conflict_penalty` is conflicts over the maximum capped at one and scaled by 0.2. `confidence` multiplies coverage by one minus each penalty; `adjusted_score` is the base score less 15 times the missing penalty and 10 times the conflict penalty, clamped to 0 to 100. `abstain` is true when available components fall below `minimum_components` or confidence falls below 0.6, which also sets `state` to `abstain` rather than `usable-with-confidence`.

## Errors

- When any of the seven inputs is not a finite number — throws TypeError
- When base_score is below 0 or above 100 — throws RangeError
- When required_components, max_conflicts or minimum_components is not positive — throws RangeError
- When available_components, conflict_count or stale_days is negative — throws RangeError
- When available_components exceeds required_components, or conflict_count exceeds max_conflicts — 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
{
  "base_score": 76.26,
  "required_components": 6,
  "available_components": 6,
  "stale_days": 20,
  "conflict_count": 1,
  "max_conflicts": 4,
  "minimum_components": 4
}
```

### Call

```ts
scoreConfidenceMissingDataPenaltyAndAbstention(data)
```

### Returns

object with 11 fields: state, method, base_score, coverage, missing_penalty, staleness_penalty, conflict_penalty, confidence, …

```json
{
  "state": "usable-with-confidence",
  "method": "coverage-staleness-conflict-confidence-gate",
  "base_score": 76.26,
  "coverage": 1,
  "missing_penalty": 0,
  "staleness_penalty": 0.010958904109589041,
  "conflict_penalty": 0.05,
  "confidence": 0.9395890410958904,
  "adjusted_score": 75.76,
  "abstain": false,
  "reason": "coverage and confidence gates passed"
}
```

## Other exports

`calculate`, `pointInTimeStockScoringInputAssembly`, `stockScoringPeerCohortResolver`, `fundamentalMetricDirectionAndPeerNormalization`, `modelApplicabilityAndVariantRouter`, `accountingFinancialHealthComposite`, `earningsQualityComposite`, `dividendSafetyScore`, `balanceSheetResilienceScore`, `distressModelEnsemble`, `crossModelConflictAndDoubleCountingResolver`, `overallExplainableStockScore`, `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/score-confidence-missing-data-penalty-and-abstention/
- Implementation source: https://github.com/IslamBaraka90/Fintech-Algorithms-Library/blob/main/src/fundamental-analysis-and-valuation/integrated-equity-scoring/score-confidence-missing-data-penalty-and-abstention/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
