Skip to main content

Module regression

Module regression 

Source
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§

ArchLmResult
ARCH-LM: regress e_t² on lag-1..q of e².
BoxPearceResult
Box–Pearce / residual AC F-style: first-lag autocorrelation squared × (n−1).
BreuschPaganResult
Breusch–Pagan heteroscedasticity: regress e² on the same design (no intercept double-count — uses predictors only when design includes intercept column).
ChowResult
Chow structural-break test at break_index (second subsample starts here).
DummyDesign
DurbinWatsonResult
Durbin–Watson statistic on ordered residuals.
InfluenceMeasures
InfluenceRow
Per-observation influence diagnostics.
JarqueBeraResult
Jarque–Bera normality of residuals.
LdaFitSummary
LinearRegression
Ordinary-least-squares fit of y = intercept + slope·x.
LogitFitSummary
MahalanobisOutliers
MultipleOls
Fitted multiple OLS (y = Xβ) with inferential output and residual vector.
RamseyResetResult
Ramsey RESET: augment with powers of fitted ŷ.
RunsResult
Wald–Wolfowitz runs test on residual signs (above/below median).
SpuriousGuard
StepwiseResult
StepwiseStep
SymmetryResult
Residual symmetry: one-sample t of (residuals − median) vs 0 is weak; here: skewness t-approx and mean-vs-median absolute gap.
UnivariateOutlierScreen
Univariate pre-flight: mean vs median gap, 2σ/3σ z-score indices.
VerificationFlag
Named verification failure / warning for a fitted model.
VerificationReport
VerifyOptions
Thresholds: α for tests; VIF soft/hard.
VifResult
Per-predictor VIF from the design columns excluding intercept.

Enums§

TransformKind

Functions§

arch_lm
ARCH Lagrange-multiplier test on residuals at lag q.
box_pearce_ac
Box-Pierce autocorrelation test on residuals.
breusch_pagan
design is row-major n × k (same as MultipleOls.design). Uses all columns of design as 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; y are 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). None if n < 4 or zero variance.
mahalanobis_outliers
Sample Mahalanobis outliers for row-major n × d matrix x.
multiple_ols
Fit OLS of y (length n) on row-major n × p predictors x. Returns None on 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 y on x. None if the lengths differ, n < 3 (need n−2 ≥ 1 residual degrees of freedom for inference), or x has zero variance (slope undefined).
spurious_regression_guard
Guard for bivariate time-series OLS. Pass x_series = None for y-only check.
stepwise_backward
Backward elimination: drop the predictor with largest p-value while p > exit_alpha, bounded by max_steps. Always records exploratory: true.
transform_series
Element-wise transform; None if 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
x is row-major n × p predictors (no intercept column). VIF_j = 1/(1−R²_j).