Expand description
Regression — simple and multiple OLS, verification diagnostics, influence, selection, design helpers, and discrete-Y wrappers.
Multiple OLS with residuals/fitted and the Ch.4 verification battery live here so Civics receipts can fail closed on hetero / autocorr / non-normal / VIF / RESET without auto-deleting outliers (flag only).
Structs§
- Arch
LmResult - ARCH-LM: regress e_t² on lag-1..q of e².
- BoxPearce
Result - Box–Pearce / residual AC F-style: first-lag autocorrelation squared × (n−1).
- Breusch
Pagan Result - Breusch–Pagan heteroscedasticity: regress e² on the same design (no intercept double-count — uses predictors only when design includes intercept column).
- Chow
Result - Chow structural-break test at
break_index(second subsample starts here). - Dummy
Design - Durbin
Watson Result - Durbin–Watson statistic on ordered residuals.
- Influence
Measures - Influence
Row - Per-observation influence diagnostics.
- Jarque
Bera Result - Jarque–Bera normality of residuals.
- LdaFit
Summary - Linear
Regression - Ordinary-least-squares fit of
y = intercept + slope·x. - Logit
FitSummary - Mahalanobis
Outliers - Multiple
Ols - Fitted multiple OLS (
y = Xβ) with inferential output and residual vector. - Ramsey
Reset Result - Ramsey RESET: augment with powers of fitted ŷ.
- Runs
Result - Wald–Wolfowitz runs test on residual signs (above/below median).
- Spurious
Guard - Stepwise
Result - Stepwise
Step - Symmetry
Result - Residual symmetry: one-sample t of (residuals − median) vs 0 is weak; here: skewness t-approx and mean-vs-median absolute gap.
- Univariate
Outlier Screen - Univariate pre-flight: mean vs median gap, 2σ/3σ z-score indices.
- Verification
Flag - Named verification failure / warning for a fitted model.
- Verification
Report - Verify
Options - Thresholds: α for tests; VIF soft/hard.
- VifResult
- Per-predictor VIF from the design columns excluding intercept.
Enums§
Functions§
- arch_lm
- ARCH Lagrange-multiplier test on
residualsat lagq. - box_
pearce_ ac - Box-Pierce autocorrelation test on
residuals. - breusch_
pagan designis row-majorn × k(same as MultipleOls.design). Uses all columns ofdesignas regressors for e² (including intercept). LM = n·R² ~ χ²(k−1).- chow_
test - Chow structural-break test between two subsamples.
- design_
dummies - One-hot dummies with first category as reference (dropped).
- durbin_
watson ?::durbin_watson.- fit_
lda_ 2class - Two-or-more class LDA;
yare integer class labels. - fit_
logit - Logit fit.
- influence_
measures - Compute influence from a fitted
MultipleOls(uses its design + residuals). - jarque_
bera - JB = n/6 · (S² + K²/4); asymptotic χ²(2).
Noneif n < 4 or zero variance. - mahalanobis_
outliers - Sample Mahalanobis outliers for row-major
n × dmatrixx. - multiple_
ols - Fit OLS of
y(lengthn) on row-majorn × ppredictorsx. ReturnsNoneon shape mismatch,n ≤ params, or singular Gram matrix. - ramsey_
reset - Powers 2..=power_max of fitted values added to original predictors.
- residual_
runs - Runs test on residual signs.
- residual_
symmetry - Symmetry diagnostic on residuals.
- seasonal_
dummies - Additive seasonal dummies for period
period(e.g. 4 or 12); drops season 0. - simple_
linear_ regression - Simple linear regression of
yonx.Noneif the lengths differ,n < 3(needn−2 ≥ 1residual degrees of freedom for inference), orxhas zero variance (slope undefined). - spurious_
regression_ guard - Guard for bivariate time-series OLS. Pass
x_series = Nonefor y-only check. - stepwise_
backward - Backward elimination: drop the predictor with largest p-value while
p >
exit_alpha, bounded bymax_steps. Always recordsexploratory: true. - transform_
series - Element-wise transform;
Noneif any domain violation (e.g. log of ≤0). - univariate_
outlier_ screen - Univariate outlier screen.
- verify_
regression_ model - Run REG-03..07 (+ RESET, symmetry, runs, ARCH-LM, optional spurious) on a fit.
- vif_
columns xis row-majorn × ppredictors (no intercept column). VIF_j = 1/(1−R²_j).