Repository navigation
BUG: fix robust.norm.Hampel - #8801
Conversation
|
from #7603 (comment) at least dtype can be implemented with np.promote_types |
a421e4a to
2f1574e
Compare
|
only unrelated randomly failing test still style check failures aside: np.abs remove complex dtype update If I replace np.abs usage by cabs, then complex step derivatives works for numerical derivatives of rho and psi Note: this sign computation cannot be replaced by np.sign because np.sign is trivariate with np.sign(0) = 0 update2 The |
|
one more design decision: do we support scalar input in methods? |
2f1574e to
5394520
Compare
5394520 to
9b1c6d1
Compare
|
another minor bug I guess float for consistency across norms |
|
The remaining norms don't overlap with R robustbase AFAICS. I can add generic consistency tests using the definitions, so the RLM unit test would indirectly also verify the remaining norm methods. |
|
Also bug in AndrewsWave (and not yet investigate results consistency failure in TrimmedMean) weights looks correct with SAS I had to multiply the results in every method except weights to fix AdrewsWave. TrimmedMean was false alarm |
|
This should be finished now. maybe formulas in docstring need now corrections. |
|
still a bug scaling is a bit arbitrary. aside: update |
|
aside: I think this is the end, unless I missed some style failures. |
5ae4961 to
a7ac221
Compare
|
all green, I guess the doc build crash/error is an azur problem to fetch the data and not related to this PR |
|
I found now a reference that includes AndrewsWave in the same form as I changed it to. Khan, Dost Muhammad, Muhammad Ali, Zubair Ahmad, Sadaf Manzoor, and Sundus Hussain. “A New Efficient Redescending M-Estimator for Robust Fitting of Linear Regression Models in the Presence of Outliers.” Mathematical Problems in Engineering 2021 (November 22, 2021): e3090537. https://doi.org/10.1155/2021/3090537. |
|
Default parameter in SAS Note, the default args for Hampel are different from this in R robustbase
|
|
another reference to confirm the parameterization changes Eviews 10 manual p 422 |
|
another reference with 48 robust norms for M-estimators, rho and psi functions Menezes, D. Q. F. de, D. M. Prata, A. R. Secchi, and J. C. Pinto. 2021. “A Review on Robust M-Estimators for Regression Analysis.” Computers & Chemical Engineering 147 (April): 107254. https://doi.org/10.1016/j.compchemeng.2021.107254. They include tuning parameters for 95% and in appendix for 90%, 98%, 99% relative efficiency. However, their scaling factor * rho looks arbitrary, i.e. not fixed so that weight(0) = 1. |
this copies the hampel and biweight fixes from #1341 and adds additional fixes that the unit tests founc
closes #8800
closes #8697
closes #8696
one issue
using mask to fill results array needs a dtype for it.
zeros_like(z) does not work for int
zeros(shape, float) does not allow complex step derivative
we need at least float
However, complex step derivatives are not supported in
normsbecause of the widespread use of np.abs, which does not do the computation needed for cs derivatives