/** * Advanced Statistical Analysis * * Provides: * - Cross-correlation * - Auto-correlation * - Anomaly detection * - Statistical tests * - Numerical integration (Simpson, trapezoidal) */ /** Cross-correlation result */ export interface CorrelationResult { /** Correlation values at each lag */ correlation: Float32Array; /** Lag values */ lags: Float32Array; /** Maximum correlation value */ maxCorrelation: number; /** Lag at maximum correlation */ lagAtMax: number; } /** * Compute cross-correlation between two signals */ export declare function crossCorrelation(signal1: Float32Array | Float64Array, signal2: Float32Array | Float64Array, maxLag?: number): CorrelationResult; /** * Compute auto-correlation of a signal */ export declare function autoCorrelation(signal: Float32Array | Float64Array, maxLag?: number): CorrelationResult; /** Anomaly detection result */ export interface AnomalyResult { /** Indices of anomalous points */ indices: number[]; /** Anomaly scores for all points */ scores: Float32Array; /** Threshold used for detection */ threshold: number; } /** Anomaly detection options */ export interface AnomalyOptions { /** Detection method */ method?: 'zscore' | 'mad' | 'iqr' | 'isolation'; /** Threshold multiplier (default: 3 for zscore, 2.5 for mad, 1.5 for iqr) */ threshold?: number; /** Window size for local anomaly detection (default: use global) */ windowSize?: number; } /** * Detect anomalies in a signal */ export declare function detectAnomalies(data: Float32Array | Float64Array, options?: AnomalyOptions): AnomalyResult; /** * Trapezoidal integration */ export declare function trapezoidalIntegration(y: Float32Array | Float64Array, x?: Float32Array | Float64Array | number): number; /** * Simpson's rule integration (requires odd number of points) */ export declare function simpsonsIntegration(y: Float32Array | Float64Array, x?: Float32Array | Float64Array | number): number; /** * Cumulative integration (returns running integral) */ export declare function cumulativeIntegration(y: Float32Array | Float64Array, x?: Float32Array | Float64Array | number): Float32Array; /** T-test result */ export interface TTestResult { /** T-statistic */ tStatistic: number; /** Degrees of freedom */ degreesOfFreedom: number; /** Approximate p-value (two-tailed) */ pValue: number; /** Whether the difference is significant at 0.05 level */ significant: boolean; } /** * Two-sample t-test (Welch's t-test) */ export declare function tTest(sample1: Float32Array | Float64Array | number[], sample2: Float32Array | Float64Array | number[]): TTestResult;