import type { Die } from '../core/dies.js';
import { type TestDef } from '../renderer/buildWaferMap.js';
/** Minimal per-test identity carried on a correlation matrix's axes. */
export interface CorrelationTestInfo {
    testNumber: number;
    label: string;
    unit?: string;
}
export interface CorrelationCell {
    xIndex: number;
    yIndex: number;
    r: number | null;
}
export interface CorrelationMatrix {
    tests: CorrelationTestInfo[];
    cells: CorrelationCell[];
}
/**
 * Pearson correlation matrix for every test in `testDefs` across every die
 * in `dies`.
 *
 * Running-accumulator algorithm: one die-walk, 6 Float64 accumulators per
 * upper-triangle pair (count, sumX, sumY, sumXX, sumYY, sumXY). No pair
 * arrays stored — O(N²) memory, O(N×D + N²) time.
 */
export declare function buildCorrelationMatrix(dies: Die[], testDefs: TestDef[]): CorrelationMatrix;
export interface CorrelationSummary {
    /** Filtered matrix — tests trimmed to [minTests, maxTests] by significance. */
    matrix: CorrelationMatrix;
    /** Upper-triangle pairs with |r| ≥ 0.7 (across the full input matrix). */
    strongPairs: number;
    /** Upper-triangle pairs with 0.4 ≤ |r| < 0.7 (across the full input matrix). */
    moderatePairs: number;
    /** Upper-triangle pairs with |r| < threshold that were excluded from display. */
    hiddenWeakPairs: number;
    /** Strongest pair by |r|, or null if no non-null off-diagonal cells exist. */
    strongestPair: {
        xLabel: string;
        yLabel: string;
        r: number;
    } | null;
}
/**
 * Filter a correlation matrix to tests involved in significant pairs, clamped to
 * [minTests, maxTests]. Pairs are ranked by |r|; the threshold gates which pairs
 * count as "significant" for display selection, but all pair counts are computed
 * over the full input matrix for the summary line. Original test-number order is
 * preserved so matrix axes stay sorted.
 */
export declare function filterCorrelationMatrix(matrix: CorrelationMatrix, { threshold, minTests, maxTests }?: {
    threshold?: number;
    minTests?: number;
    maxTests?: number;
}): CorrelationSummary;
//# sourceMappingURL=correlation.d.ts.map