# configuration/strings/representation.strings.ts

> 135 lines of code and 35 definitions.

Tree: GovLab Patterns
Language: typescript
Layer: product
Canonical: https://banes-lab.com/anatomy/patterns#file-patterns-configuration-strings-representation-strings-ts
Source text: https://banes-lab.com/source/patterns/configuration/strings/representation.strings.ts.txt

Listed in [configuration/strings](https://banes-lab.com/api/source/patterns/configuration/strings.md), after [configuration/strings/report.strings.ts](https://banes-lab.com/source/patterns/configuration/strings/report.strings.ts.md) and before [configuration/strings/schema.strings.ts](https://banes-lab.com/source/patterns/configuration/strings/schema.strings.ts.md).

## Definitions

- `DISTRIBUTION_STRINGS` (lexical_declaration, line 1, exported)
- `freqExplained` (method_definition, line 6, exported)
- `freqObserved` (method_definition, line 9, exported)
- `seasonalityObserved` (method_definition, line 21, exported)
- `uniformExplained` (method_definition, line 27, exported)
- `uniformObserved` (method_definition, line 30, exported)
- `VECTOR_STRINGS` (lexical_declaration, line 36, exported)
- `anomalyExplained` (method_definition, line 37, exported)
- `autocorExplained` (method_definition, line 42, exported)
- `distributionExplained` (method_definition, line 47, exported)
- `distributionObserved` (method_definition, line 50, exported)
- `SEQUENCE_STRINGS` (lexical_declaration, line 55, exported)
- `predictionExplained` (method_definition, line 56, exported)
- `predictionObserved` (method_definition, line 59, exported)
- `runsObserved` (method_definition, line 63, exported)
- `transitionsExplained` (method_definition, line 66, exported)
- `transitionsObserved` (method_definition, line 71, exported)
- `GRID_STRINGS` (lexical_declaration, line 76, exported)
- `densityExplained` (method_definition, line 77, exported)
- `densityObserved` (method_definition, line 80, exported)
- `TREE_STRINGS` (lexical_declaration, line 85, exported)
- `structureExplained` (method_definition, line 90, exported)
- `structureObserved` (method_definition, line 93, exported)
- `GRAPH_STRINGS` (lexical_declaration, line 98, exported)
- `combinatoricsExplained` (method_definition, line 99, exported)
- `combinatoricsObserved` (method_definition, line 102, exported)
- `compositionExplained` (method_definition, line 105, exported)
- `compositionObserved` (method_definition, line 108, exported)
- `cooccurrenceObserved` (method_definition, line 112, exported)
- `orderedExplained` (method_definition, line 119, exported)
- `orderedObserved` (method_definition, line 122, exported)
- `uniformityExplained` (method_definition, line 127, exported)
- `uniformityObserved` (method_definition, line 130, exported)
- `NULL_MODEL_LABELS` (lexical_declaration, line 135, exported)
- `PREDICTION_METHODS` (lexical_declaration, line 142, exported)

## Contained in

- [configuration/strings](https://banes-lab.com/anatomy/patterns/folder-patterns-configuration-strings.md)

## Source

```typescript
export const DISTRIBUTION_STRINGS = {
    complexityExplained: "lower is more regular",
    complexityObserved: "compressibility of the value stream",
    driftExplained: "positive skews recent",
    driftObserved: "per-value position trend over the stream",
    freqExplained(entropy: string): string {
        return `entropy ${entropy} bits`;
    },
    freqObserved(count: string, distinct: string): string {
        return `${count} records over ${distinct} distinct values`;
    },
    predictionExplained(accuracy: string): string {
        return `predicting the mode is right ${accuracy} of the time on held-out history`;
    },
    predictionObserved(mode: string): string {
        return `most likely next value is ${mode}`;
    },
    recencyExplained: "largest gaps are most overdue",
    recencyObserved: "records since each value last appeared",
    seasonalityExplained: "record counts bucketed by month",
    seasonalityObserved(first: string, last: string): string {
        return `${first} to ${last}`;
    },
    temperatureExplained: "positive deviation runs hot",
    temperatureObserved: "recent-window frequency vs baseline",
    uniformDeparts: "departs from uniform",
    uniformExplained(p: string, verdict: string): string {
        return `p=${p}: ${verdict}`;
    },
    uniformObserved(chiSquare: string, dof: string): string {
        return `chi-square ${chiSquare} on ${dof} dof`;
    },
    uniformUniform: "consistent with a uniform null",
} as const;

export const VECTOR_STRINGS = {
    anomalyExplained(count: string): string {
        return `${count} beyond an independence null`;
    },
    anomalyObserved: "z-scored extreme values",
    autocorBeyond: "beyond chance",
    autocorExplained(verdict: string, p: string): string {
        return `${verdict} vs an independence null (p=${p})`;
    },
    autocorObserved: "first-lag autocorrelation",
    autocorWithin: "within chance",
    distributionExplained(min: string, max: string): string {
        return `range ${min} to ${max}`;
    },
    distributionObserved(mean: string, sd: string): string {
        return `mean ${mean}, sd ${sd}`;
    },
} as const;

export const SEQUENCE_STRINGS = {
    predictionExplained(accuracy: string): string {
        return `Markov next-state prediction is right ${accuracy} of the time on held-out history`;
    },
    predictionObserved(last: string, next: string): string {
        return `after ${last}, the next value is most likely ${next}`;
    },
    runsExplained: "distribution of consecutive-repeat run lengths",
    runsObserved(mean: string, longest: string): string {
        return `mean run ${mean}, longest ${longest}`;
    },
    transitionsExplained(verdict: string, p: string): string {
        return `sequence ${verdict} vs an independence null (p=${p})`;
    },
    transitionsHasMemory: "has memory",
    transitionsMemoryless: "is memoryless",
    transitionsObserved(ratio: string): string {
        return `change ratio ${ratio}`;
    },
} as const;

export const GRID_STRINGS = {
    densityExplained(cell: string, count: string): string {
        return `densest cell ${cell} (${count})`;
    },
    densityObserved(points: string, cells: string): string {
        return `${points} points over ${cells} cells`;
    },
} as const;

export const TREE_STRINGS = {
    compositionExplained: "most frequent keys and leaf value types",
    compositionObserved(keys: string, leaves: string): string {
        return `${keys} distinct keys over ${leaves} leaves`;
    },
    structureExplained(shapes: string, records: string): string {
        return `${shapes} distinct shapes over ${records} records`;
    },
    structureObserved(depth: string, branching: string): string {
        return `depth ${depth}, branching ${branching}`;
    },
} as const;

export const GRAPH_STRINGS = {
    combinatoricsExplained(rate: string): string {
        return `repeat rate ${rate}`;
    },
    combinatoricsObserved(sets: string): string {
        return `${sets} distinct member-sets`;
    },
    compositionExplained(ratio: string): string {
        return `high-half ratio ${ratio}`;
    },
    compositionObserved(ratio: string): string {
        return `odd ratio ${ratio}`;
    },
    cooccurrenceExplained: "most frequent co-occurring pairs",
    cooccurrenceObserved(members: string, degree: string): string {
        return `${members} members, mean degree ${degree}`;
    },
    liftExplained: "lift above the independence baseline is over-represented",
    liftObserved: "co-occurrence vs an independence null",
    membersDepart: "depart from uniform",
    membersUniform: "consistent with uniform",
    orderedExplained(symmetry: string): string {
        return `symmetry ${symmetry}`;
    },
    orderedObserved(adjacency: string): string {
        return `adjacency ${adjacency}`;
    },
    positionalExplained: "recurring consecutive-position patterns",
    positionalObserved: "modal value at each list position",
    uniformityExplained(verdict: string): string {
        return `members ${verdict}`;
    },
    uniformityObserved(chiSquare: string, dof: string): string {
        return `chi-square ${chiSquare} on ${dof} dof`;
    },
} as const;

export const NULL_MODEL_LABELS = {
    autocorrelation: "autocorrelation-independence",
    memberUniformity: "member-uniformity",
    transition: "transition-independence",
    uniformity: "uniformity",
} as const;

export const PREDICTION_METHODS = { markov: "held-out Markov", mode: "held-out mode" } as const;
```
