import { type Value } from './program'; import { type FieldStats, type NumberAggregateStats, type Percentiles } from './program-stats-types'; export declare function constantStats(value: Value): FieldStats; export declare function computePercentiles(cdf: Map): Percentiles; export declare function computeSkewness(dist: Map, mean: number, stddev: number): number; export declare function computeKurtosis(dist: Map, mean: number, stddev: number): number; /** * Compute the aggregate stats for an array of FieldStats whose elements are * all numeric. Returns null if any element is not numeric or the array is * empty. * * The pooled distribution treats the array as a mixture: each element * contributes 1/n of its probability mass to the pooled distribution. Mean * and variance are computed from the pooled distribution (equivalent to: * pooled_mean = avg of means, pooled_E[X^2] = avg of E[X^2_i], pooled_var = * pooled_E[X^2] - pooled_mean^2). */ export declare function computeAggregateIfNumeric(elements: FieldStats[]): NumberAggregateStats | null; /** * Suggest a "nice" bucket size that produces at most maxBuckets buckets * for a value range. Uses 1, 2, 5 multipliers of powers of 10. */ export declare function suggestBucketSize(min: number, max: number, maxBuckets?: number): number; /** * Re-bin a distribution into buckets of the given size. Each bucket k contains * the sum of probabilities of values in [(k-1)*bucketSize+1, k*bucketSize]. * Returns a new Map. Use bucketSize=1 for no binning. */ export declare function binDistribution(dist: Map, bucketSize: number): Map; export declare function normalizeMap(m: Map): Map; export declare function sortFrequenciesDesc(freqs: Map): Map; export declare function computeMode(dist: Map): number[]; export declare function buildCdf(dist: Map): Map; export declare function numberStatsFromDistribution(dist: Map): FieldStats; export declare function cloneFieldStats(stats: FieldStats): FieldStats;