type Vec = readonly number[] | Float64Array; /** * Ranks of the data with tie handling (SciPy `rankdata`, default `'average'`): * tied values receive the mean of the ranks they span. Ranks are 1-based. */ export declare function rankdata(x: Vec): number[]; /** * Spearman rank correlation coefficient ρ — the Pearson correlation of the * rank-transformed inputs (ties broken by average ranks via {@link rankdata}). * Unlike Pearson, it measures any MONOTONIC relationship, so a monotonic * non-linear pair (e.g. `y = x²` on positives) gives ρ = 1. Result is in [−1, 1]. * * @throws if the inputs differ in length or a rank vector is constant. */ export declare function spearman(x: Vec, y: Vec): number; /** Geometric mean: `exp(mean(ln x))` (stable form). All entries must be > 0. */ export declare function gmean(x: Vec): number; /** Harmonic mean: `n / Σ(1/xᵢ)`. All entries must be > 0. */ export declare function hmean(x: Vec): number; /** Raw or central k-th moment. `central` (default true) subtracts the mean first. */ export declare function moment(x: Vec, k: number, central?: boolean): number; /** * Skewness (third standardized moment). Population estimator by default * (SciPy `bias=true`); pass `{ bias: false }` for the sample-corrected G₁. */ export declare function skewness(x: Vec, opts?: { bias?: boolean; }): number; /** * Kurtosis. Excess kurtosis by default (SciPy `fisher=true`, subtracts 3); * pass `{ fisher: false }` for Pearson's kurtosis. Population estimator by * default; `{ bias: false }` applies the sample correction. */ export declare function kurtosis(x: Vec, opts?: { fisher?: boolean; bias?: boolean; }): number; /** Interquartile range: `Q3 − Q1` via `quantileSeq`. */ export declare function iqr(x: Vec): number; /** Standard error of the mean: `sampleStd / √n`. */ export declare function sem(x: Vec): number; /** * Z-scores: `(xᵢ − mean) / std`, using population std (SciPy `zscore` default, * `ddof=0`). Returns an array the same length as the input. */ export declare function zscore(x: Vec): number[]; /** * Covariance. * - `cov(x, y)` → scalar sample covariance of two equal-length vectors. * - `cov(matrix)` → covariance matrix; rows are observations, columns are * variables (NumPy `rowvar=false`). `ddof` defaults to 1 (sample). */ export declare function cov(x: Vec | number[][], y?: Vec, ddof?: number): number | number[][]; /** * Correlation-coefficient matrix from {@link cov} (rows = observations, * columns = variables). Diagonal is 1; off-diagonals are Pearson r. */ export declare function corrcoef(matrix: number[][]): number[][]; /** * Kendall's τ_b rank correlation coefficient — a tie-corrected measure of * ordinal association based on the difference between concordant and discordant * pairs. Complements {@link spearman} (rank Pearson) and Pearson `corr`. * Returns τ_b = (P − Q) / √((n₀ − n₁)(n₀ − n₂)), matching `scipy.stats.kendalltau` * (`variant='b'`, its default), where n₀ = n(n−1)/2 and n₁/n₂ are the tie-pair * counts in x and y respectively. * * @example kendallTau([1,2,3,4,5], [2,1,4,3,5]) // 0.6 */ export declare function kendallTau(x: Vec, y: Vec): number; /** Result of a simple linear regression with inference. */ export interface LinRegressResult { slope: number; intercept: number; rValue: number; pValue: number; stdErr: number; interceptStdErr: number; } /** * OLS simple linear regression **with inference** — `y ≈ slope·x + intercept`, * plus the correlation coefficient, the slope p-value (t-test, df = n−2), and * the slope/intercept standard errors. Matches `scipy.stats.linregress`. */ export declare function linregress(x: Vec, y: Vec): LinRegressResult; /** A correlation coefficient with its two-tailed significance p-value. */ export interface CorrelationTestResult { coefficient: number; pValue: number; } /** Pearson correlation **test** (coefficient + two-tailed p, t-test). `scipy.stats.pearsonr`. */ export declare function pearsonr(x: Vec, y: Vec): CorrelationTestResult; /** Spearman rank-correlation **test** (rho + two-tailed p, t-test). `scipy.stats.spearmanr`. */ export declare function spearmanr(x: Vec, y: Vec): CorrelationTestResult; /** * Kendall's τ **test** — τ_b coefficient and two-tailed p via the normal * approximation `z = 3τ√(n(n−1)) / √(2(2n+5))` (standard large-sample form; * scipy's small-n exact p is version/table-specific). */ export declare function kendalltau(x: Vec, y: Vec): CorrelationTestResult; /** Result of {@link kendallTauTest}: the τ_b coefficient plus its p-value. */ export interface KendallTauTestResult { tau: number; pValue: number; } /** * Kendall's τ **test** (hypothesis-test naming convenience) — identical to * {@link kendalltau} (τ_b coefficient + two-tailed normal-approximation * p-value), just returning `{ tau, pValue }` instead of `{ coefficient, * pValue }` to match the `*Test` result-object convention used by * `mannWhitneyTest`/`kolmogorovSmirnovTest`/etc. Does not duplicate the * coefficient/p-value logic — delegates to `kendalltau`. * * @example kendallTauTest([1,2,3,4,5], [1,2,3,4,5]) // { tau: 1, pValue: } */ export declare function kendallTauTest(x: Vec, y: Vec): KendallTauTestResult; /** Peak-to-peak / statistical range: max − min. (`np.ptp`; `range` is taken.) */ export declare function ptp(x: Vec): number; /** Coefficient of variation: population-std / mean (`scipy.stats.variation`, ddof=0). */ export declare function variation(x: Vec): number; /** Trimmed mean — drop `proportion` of the sorted data from each tail. `scipy.stats.trim_mean`. */ export declare function trimmedMean(x: Vec, proportion: number): number; /** Summary statistics bundle (`scipy.stats.describe`): sample variance (ddof=1); biased Fisher skew/kurtosis. */ export interface DescribeResult { nobs: number; min: number; max: number; mean: number; variance: number; skewness: number; kurtosis: number; } /** * Return summary statistics of `x`, as `scipy.stats.describe` does. * * The variance is the sample variance (ddof = 1). The skewness and the excess kurtosis are * the biased estimates. * * @throws Error if `x` is empty. */ export declare function describe(x: Vec): DescribeResult; /** Histogram counts and bin edges (`np.histogram`) — `bins` equal-width bins over [min, max]. */ export interface HistogramResult { counts: number[]; edges: number[]; } /** * Count the values of `x` in `bins` equal-width bins from the minimum to the maximum. * * The last bin includes the maximum. If all values are equal, the range is that value * plus and minus 0.5. * * @throws Error if `x` is empty, or if `bins` is not a positive integer. */ export declare function histogram(x: Vec, bins?: number): HistogramResult; export {}; //# sourceMappingURL=descriptive-stats.d.ts.map