/** Options for `ols`. */ export interface OlsOptions { /** Prepend a column of ones (default true). */ intercept?: boolean; } /** Result of `ols`: the coefficients and their inference statistics. */ export interface OlsResult { /** Fitted coefficients (intercept first, if included). */ coefficients: number[]; /** Standard error of each coefficient. */ stderr: number[]; /** t-statistic for each coefficient (H0: coefficient = 0). */ tValues: number[]; /** Two-sided p-value for each coefficient's t-statistic. */ pValues: number[]; /** Coefficient of determination. */ r2: number; /** R² adjusted for the number of predictors. */ adjR2: number; /** Overall model F-statistic (H0: all slope coefficients = 0). */ fStat: number; /** Residuals y - Xβ. */ residuals: number[]; } /** * Multiple linear regression `y ≈ Xβ` by ordinary least squares (normal equations), * with full inference: standard errors, t/p-values per coefficient, R²/adjusted-R², * the overall model F-statistic, and residuals. * * @param X - Design matrix (rows = observations, cols = predictors) * @param y - Response vector (length = number of observations) * @param opts - `intercept` (default true) prepends a column of ones to X * * @example * ols([[1, 1], [2, 0], [3, 1], [4, 0]], [6, 5, 10, 9]) * // => coefficients ~= [1, 2, 3] (y = 1 + 2*x1 + 3*x2), r2 = 1 */ export declare function ols(X: number[][], y: number[], opts?: OlsOptions): OlsResult; //# sourceMappingURL=ols.d.ts.map