Changelog¶
0.6.1 (2026-11-26)¶
Fixed¶
Fit
LTSRegressor,SRegressor,MMRegressor,RankRegressor,ScoreMatchingRegressorand the four robust GLMs on centred columns scaled to unit spread, and map coefficients and covariances back. Columns with large means (about 1e7) were rejected as singular or gave wrong coefficients and standard errors without a warning; Mallows and score matching already lost accuracy at means of 1e4.mm_testfollows.NonlinearMRegressorno longer stops at the starting value when parameters are large (about 1e10): steps are scaled by the Jacobian, and the Jacobian of the standard errors uses central differences with relative steps.halfspace_depthstandardizes the columns first: with very different scales the smallest column was taken as a null direction in three or more dimensions, and the depth nearly doubled.plots.distance_distancecomputes the classical distances from the correlation matrix, which keeps columns of very different scales accurate.The bandwidth selectors and the KDE tests sphere the data through the correlation matrix, so valid columns of very different units are no longer rejected as singular.
The three outlyingness detectors ignore the infinite ratios of directions with zero scale, as robustbase’s
adjOutlyingness. On discrete data (Likert items), more than half the projections tie on many directions, and up to all observations were flagged;StahelDonohothen failed with aLinAlgError.PenaPrietoskips zero-MAD directions in the same way and stops trimming before the retained observations lie on a hyperplane; it failed with aLinAlgErroron many Likert and small-integer samples.MVErefines every candidate ellipsoid once before ranking them, as rrcov. With 40% of outliers, ranking raw elemental ellipsoids often missed the clean solution that R finds.
0.6.0 (2026-11-20)¶
Added¶
Add
density.kde_permutation_test, a two-sample test using the integrated squared difference of Gaussian KDEs with a common bandwidth.Add
density.kde_multiscale_test, a two-sample test with joint permutation calibration across several Gaussian bandwidths.Add a known log-mean
offsettoMallowsPoissonRegressor.fitandpredictfor unequal exposures. Preserve logistic tail probabilities and withhold Mallows Poisson inference above the numerical predictor cap.Add
datasetswith five classic data sets of robust statistics (stars of CYG OB1, Hawkins–Bradu–Kass, wood gravity, stack loss and hemophilia), and a guide that recovers their documented outliers with summaries, tests and diagnostic plots.Show an executable example for every function on the diagnostic plots page, including the bagplot, clustering, density and coefficient plots.
Faster¶
Fit
RankRegressorfrom a BFGS pilot and a linear program on the closest residual pairs only, with the other pairs as a linear term (Portnoy & Koenker 1997). A certificate that no excluded pair changes sign keeps the fit exact; n = 2000 takes about a second instead of minutes.Reuse the implicit Qn selector for the Wilcoxon scale on large samples, with linear auxiliary memory and the same treatment of ties. Use condensed SciPy distances and NumPy partitioning for small samples.
Fixed¶
Fix
rank_anovaanddrop_testresults that depended on the group labels or contrasts: when the rank fit is not unique, return the minimizer with the smallest residual sum of squares.Validate response alignment and design nesting in
rank.drop_test. Handle one residual degree of freedom and report unavailable inference when the residual scale cannot be estimated.Accept NumPy scalar shifts in
signed_rank_testwithout overflow warnings and reject booleans.Preserve paired signed-rank differences when large terms cancel or a partial sum overflows. Reject differences that overflow float64.
Reject degenerate normal calibration in
kde_testand validate fixed bandwidths independently of their scale. Normalize KDE derivatives without forming the determinant.Preserve log-concave density and CDF calculations at extreme scales. Handle small samples and exact fits in score matching regression.
Test covariance rank on the correlation scale so changes in measurement units do not create spurious singular fits. Compute PCA residuals before restoring the original coordinate origin.
Preserve finite univariate estimates at extreme scales. Compute halfspace depth within the affine span of lower-dimensional data and calibrate outlyingness using the finite training scores.
Keep TCLUST assignments, weights and likelihood consistent at the iteration limit and report
converged_. Fit in normalized units.Validate the data and tested columns in
mm_test. Compute nonlinear regression and diagnostic OLS uncertainty without squaring the design’s condition number and reject unidentified OLS reference intervals.Share the package’s MAD between scale estimation, Stahel–Donoho projections and outlyingness cutoffs. Preserve finite medians when intermediate sums or deviations overflow.
Scale the shared least absolute deviations solver internally so that changing regression units preserves the optimization problem numerically.
Use SciPy’s trimmed mean, softmax, ordinal ranks and cumulative trapezoidal integrals. Reuse OGK’s tau location from
locationand share the adjusted fences, score weights and zero-scale division rules.
0.5.0 (2026-11-19)¶
Add
density:KernelDensity, kernel density estimation with a normal kernel and a full bandwidth matrix, with its gradient, Hessian and highest density levels; the plug-in and smoothed cross-validation bandwidth selectorsplugin_bandwidthandscv_bandwidth, for the density or its first or second derivative; andkde_test, a two-sample test of equal densities in any dimension.Add
shape:LogConcaveDensity, the maximum likelihood estimate of a univariate log-concave density, andScoreMatchingRegressor, linear regression with a convex loss estimated by antitonic score matching, with standard errors andsummary().Add
plots.hdr_plot,plots.log_concave_plotandplots.score_plot.Add
plots.coefficient_plot(estimates and intervals of several fits, with least squares as reference),plots.dd_plot(depth-depth plot of two samples) andplots.ctl_curves(trimmed likelihood curves for choosing the number of clusters and the trimming level, as R’sctlcurves).Plot layout: the legends of
tolerance_ellipse,bagplotanddiscriminant_plotmove under the axes instead of covering the data;distance_distanceleaves room for its labels;adjusted_boxplotshows each medcouple under its box name;bagplotlabels its axes x₁ and x₂, as the other plots.rank.RankRegressorand the new regressor share one least absolute deviations solver (the dual linear program).
0.4.0 (2026-11-18)¶
Add
cluster.TClust: robust clustering by trimming with eigenvalue restrictions (TCLUST), including trimmed k-means, andplots.cluster_plot.Add
regression.mm_test: robust deviance and Wald tests of nested MM regressions, as R’sanova.lmrob.Add
rank.rank_anova: one-way analysis of variance by ranks, as Rfit’soneway.rfit.
0.3.0 (2026-11-18)¶
Add
rank:RankRegressor, rank-based linear regression with Wilcoxon scores (Jaeckel’s dispersion minimized exactly by linear programming), with standard errors,summary()anddrop_testfor nested models; andrank_sum_testandsigned_rank_test, exact Wilcoxon tests conditional on ties and zeros (Wilcox or Pratt zeros).Add
covariance.PenaPrieto, the Peña–Prieto kurtosis and specific directions (KSD) estimator of location and scatter for many variables, with Maronna’s observation directions.Add
exact=Truetodepth.halfspace_depth: exact depth in any dimension by the recursive algorithm of Dyckerhoff and Mozharovskyi (2016).Fix bivariate
depth.halfspace_depthreturning a depth one count too low when the query lies between two observations on a line (for example exact integer data): opposite offsets now share one line angle. This also affects the bagplot depth regions of such data.
0.2.0 (2026-11-16)¶
Add Python 3.15 to the Linux, Windows and macOS CI matrix and compatibility metadata.
Audit the implemented formulas against primary theory and independent numerical checks; document assumptions, computational variants and remaining limits.
Correct ROBPCA’s published subset size and preserve it in the final MCD; retain infinite outlyingness for off-hyperplane points when projection scale is zero, and reject unidentified or numerically degenerate components.
Reject undefined Hotelling moment calibrations and singular MANOVA statistics; preserve every original group through trimming.
Correct MT transformation minima near zero and differentiate its clipped numerical objective; capped fits report non-convergence and unavailable inference. Exclude
c<=1; larger constants still require the documented regularity assumptions.Reject rank-deficient nonlinear model Jacobians. Document the independent, symmetric, homoscedastic error assumptions of nonlinear covariance.
Correct univariate depth boundaries, narrow bivariate angular cells and bag interpolation with nonzero inner segments. Prevent representable Hodges–Lehmann/Pn results from overflowing during pairwise averaging.
Add robust logistic and Poisson GLMs: Mallows, Bianco–Yohai (with optional leverage trimming) and MT, with sandwich inference and coefficient tables.
Add nonlinear Huber M regression, final-residual scale and covariance, model-output validation and explicit convergence diagnostics.
Add halfspace depth, regression depth, the bivariate Tukey median, bagplot statistics and
plots.bagplot, including degenerate bags.Add directional outlyingness with side-specific robust scales.
Add independent definition checks, scikit-learn checks and method guides; preserve frozen software outputs as supplementary regression fixtures.
Add
multivariate: robust principal components (ROBPCAandProjectionPursuitPCA), robust discriminant analysis (RobustLDAandRobustQDA), the robust one-sample Hotelling testhotelling_t2and the robust one-waymanova, with model assumptions and approximation limits.Add
covariance.StahelDonoho, the Stahel-Donoho estimator of location and scatter with the weights of Maronna and Yohai (1995).Add
plots.pca_outlier_map,plots.scree_plotandplots.biplotfor robust PCA,plots.discriminant_plotfor classification regions,plots.distance_qq(chi-square quantile plot of robust distances),plots.residual_plot(residuals against fitted values) andplots.residual_qq(normal quantile plot of regression residuals).Fix
plots.outlier_mapaccepting a response whose length differs from the number of rows ofX.plots.distance_distance,plots.tolerance_ellipseandplots.outlier_mapraiseValueErrorfor a singular robust covariance instead of drawing a 97.5% reference that does not apply.Fix
scale.medcouple,lmcandrmcreturningNaNfor finite values close to the largest float.covariance.h_alpha_nraisesValueErrorwhenn <= pinstead of returning a subset larger than the sample.
0.1.3 (2026-11-12)¶
Add
outliers.StahelDonohoOutlyingnessandoutliers.AdjustedOutlyingness, scikit-learn outlier detectors with projection depth scores and explicit projection-tie handling.Add
regression.LTSRegressor: least trimmed squares regression with FAST-LTS, reweighting and small-sample corrections.Add
regression.SRegressor(FAST-S) andregression.MMRegressor, with documented tuning and scale equations.MMRegressorreports heteroskedasticity-robust standard errors, t values and p-values (Croux, Dhaene & Hoorelbeke 2003) and an R-stylesummary().Add the Zenodo DOI to the README and
CITATION.cff.Add
plots: regression outlier maps, distance-distance plots, tolerance ellipses, adjusted boxplots and outlyingness plots, with Matplotlib axes support, class counts, infinite-score markers and separated labels.Use sample covariance (
n−1) for classical plotting distances and ellipses.Add an executable diagnostic gallery, API reference and pre-release validation notes covering definitions and documented differences from R.
Clarify that projection depth is zero for infinite outlyingness.
Matplotlib is now a dependency.
Show total downloads in the README badge; pypistats reads 0 for the monthly count during a package’s first month.
0.1.2 (2026-11-12)¶
Add a roadmap of planned methods.
Add a page that maps robustbase, rrcov and base R functions to robustmodels.
Give documentation pages descriptive titles, a sitemap and search descriptions.
Credit the author by full name and ORCID, and expand the PyPI keywords.
0.1.1 (2026-11-11)¶
Stabilize univariate MCD window variances in the presence of extreme outliers.
Finish slow M-scale iterations with a bracketed root solver.
Select MRCD’s common regularization weight according to the published rule.
Reject MM tuning combinations that violate the loss-ordering condition.
Warn when M-location reaches its iteration limit without convergence.
Add method citations and clarify finite-sample, complexity and optimization limits.
Redesign the PyPI overview with worked examples and an estimator selection guide.
Move development and release instructions to
CONTRIBUTING.md.Test every line and branch, require 100% coverage in CI, and report it to Codecov.
Add coverage and download badges.
Link Tarr’s thesis through its permanent University of Sydney handle.
Add
CITATION.cff.
0.1.0 (2026-11-09)¶
First release.
scale:mad,qn,sn,pn,tau_scale,m_scale,medcouple,lmc,rmc. Qn, Sn and Pn apply finite-sample corrections by default (Pn: Tarr 2014, Appendix B.3); passfinite_correction=Falseto disable them.location:hodges_lehmann,m_location,tau_location,trimmed_mean,winsorized_mean.covariance:MCD(FAST-MCD and DetMCD),MRCD,MVE,OGK,SEstimator,MMEstimator, with the scikit-learn estimator interface.Input and tuning parameters are validated; invalid values raise
ValueErrornaming the parameter.Documentation at https://omarbecerrasierra.github.io/robustmodels/, with a user guide and a reference for every function and class; its examples run as tests.
CI tests the installed wheel on Python 3.10 to 3.14 and publishes tagged releases to PyPI with trusted publishing.