Skip to content

v0.5.1 - bug fix release

Latest

Choose a tag to compare

@mvds314 mvds314 released this 04 Sep 22:02

Bug fix release. Every fix ships with a test that was watched failing first.

Fixed

Wrong duality gap tolerance in the preprocessing path. fit() passed the preprocessing parameters positionally into a signature that takes eps first, so every argument landed one position early: the duality gap tolerance became 0.8 instead of 1e-6, Mm_factor became 3, and max_bad_fixup became 1e-6, which let the residual fix-up loop run at most once. The loose stopping rule silently returned a coarser solution, off by 2.7e-3 from the optimum where the corrected call is within 5e-8. This affects fit_method="preproc-ipm" and the automatic path for n >= 100000.

Hang on rank deficient design matrices. The solver factorizes X'X with a Cholesky decomposition and never checks LAPACK's info flag, so a collinear design either produced NaN coefficients, which the retry loop then chased forever by widening the tolerance, or coefficients of order 1e12 that were returned as an estimate. A dummy variable trap is an easy way to hit this. Both cases now raise LinAlgError, and the retry loop gives up after ten relaxations instead of looping without bound.

Uninitialized memory returned by invnormal outside (0, 1). _invnormal assigns its result in three branches that all require 0 < p < 1, so any other argument returned whatever was on the stack, for instance 6.95e-310 at p = 0 instead of -inf. cluster_cov reaches this through invnormal(theta ± h_nG) at extreme quantiles. It now returns -inf, +inf or NaN.

Out of bounds write in matrix_opaccum. The accumulator requires the rows of a group to be contiguous and writes one group boundary per group into a buffer of exactly G ints, but neither requirement was checked. Unsorted group labels silently returned a matrix that is not the sum over the clusters, and because a boundary is written for every run of equal labels, they also wrote past the end of that buffer, corrupting the heap. Both cases now raise ValueError. cluster_cov sorts before calling and was not affected.

Missing gaussian kernel. kernel="gau" is accepted by the validation and named in its own error message, but had no implementation, so it failed with KeyError: 'gau'.

Unknown fit_method silently ignored. A misspelled method skipped coefficient estimation entirely and surfaced later as AttributeError: 'QuantReg' object has no attribute 'params'. It now raises ValueError.

Tests

The suite grew from 6 tests to 23. The Python layer had no coverage at all before this release; QuantReg.fit, the preprocessing path, and cluster_cov are now covered, with statsmodels used as an independent oracle for the covariance estimators.

Full changelog: v0.5.0...v0.5.1