export type CovarianceType = 'full' | 'tied' | 'diag' | 'spherical'; /** * Covariance container per covariance type: * - 'full': k × d × d (number[][][]) * - 'tied': d × d (number[][]) * - 'diag': k × d (number[][]) * - 'spherical': k (number[]) */ export type Covariances = number[][][] | number[][] | number[]; export interface GaussianSufficientStats { /** effective number of samples per component (Σᵢ respᵢₖ + 10·eps) */ nk: number[]; /** k × d weighted means */ means: number[][]; /** per-type covariance container (regCovar already added to diagonals) */ covariances: Covariances; } /** * Weighted Gaussian parameter estimates from responsibilities — the M-step of * EM (and the sufficient statistics of variational Bayes). */ export declare function estimateGaussianParameters(X: number[][], resp: number[][], regCovar: number, covarianceType: CovarianceType): GaussianSufficientStats; /** * n × k matrix of log N(xᵢ | μₖ, Σₖ). 'full'/'tied' go through a Cholesky * factor (log-det from the diagonal, quadratic form by triangular solve); * 'diag'/'spherical' use closed forms. */ export declare function estimateLogGaussianProb(X: number[][], means: number[][], covariances: Covariances, covarianceType: CovarianceType): number[][]; /** * Per-component log-determinant of the precision Cholesky factor, * i.e. −½·log det Σₖ (sklearn's `_compute_log_det_cholesky`). 'tied' is * replicated across the k components. */ export declare function computeLogDetCholesky(covariances: Covariances, covarianceType: CovarianceType, nComponents: number, nFeatures: number): number[]; /** * Initial responsibilities: one-hot k-means labels or normalized uniform * random rows. The k-means run is seeded from the fit-local RNG so nInit * restarts differ but a seeded fit stays fully deterministic. */ export declare function initializeResponsibilities(X: number[][], nComponents: number, initParams: 'kmeans' | 'random', rng: () => number): number[][];