/**
 * correlation.ts — Pairwise correlation calculations and matrix construction.
 * Implements Pearson, Spearman (rank), and Kendall (concordance) correlations,
 * plus eigenvalue decomposition for PCA-style risk analysis.
 * Pure functions, zero external dependencies.
 */
/** Supported correlation methods */
export type CorrelationMethod = 'pearson' | 'spearman' | 'kendall';
/**
 * Pearson product-moment correlation coefficient between two arrays.
 * Measures linear dependence. Range: [-1, 1].
 *
 * @param x - First array of observations
 * @param y - Second array of observations (same length as x)
 * @returns Pearson correlation coefficient
 */
export declare function pearsonCorrelation(x: number[], y: number[]): number;
/**
 * Spearman rank correlation coefficient between two arrays.
 * Measures monotonic (not necessarily linear) dependence.
 * Computed as Pearson correlation of the rank-transformed data.
 *
 * @param x - First array of observations
 * @param y - Second array of observations (same length as x)
 * @returns Spearman rank correlation coefficient in [-1, 1]
 */
export declare function spearmanCorrelation(x: number[], y: number[]): number;
/**
 * Kendall's tau-b rank correlation coefficient between two arrays.
 * Measures ordinal association (concordance vs discordance of pairs).
 * Handles ties via the tau-b correction.
 *
 * @param x - First array of observations
 * @param y - Second array of observations (same length as x)
 * @returns Kendall's tau-b in [-1, 1]
 */
export declare function kendallCorrelation(x: number[], y: number[]): number;
/**
 * Build a full pairwise correlation matrix from multiple return series.
 *
 * @param returnSeries - Array of return arrays, one per asset. All must have the same length.
 * @param method - Correlation method: 'pearson', 'spearman', or 'kendall'. Default 'pearson'.
 * @returns A symmetric n x n correlation matrix where n = returnSeries.length.
 *          Diagonal elements are 1.0.
 */
export declare function buildCorrelationMatrix(returnSeries: number[][], method?: CorrelationMethod): number[][];
/**
 * Compute eigenvalues of a real symmetric matrix using the QR algorithm
 * with implicit shifts (Wilkinson shift). Returns eigenvalues sorted descending.
 *
 * Eigenvalues of the correlation matrix are useful for PCA-style analysis:
 * - A dominant first eigenvalue means a strong common factor (market risk).
 * - If the first eigenvalue explains 80%+ of total variance, the portfolio
 *   is poorly diversified.
 *
 * @param matrix - A real symmetric n x n matrix
 * @returns Array of eigenvalues sorted in descending order
 */
export declare function computeEigenvalues(matrix: number[][]): number[];
//# sourceMappingURL=correlation.d.ts.map