Repository navigation
ENH: robust add MQuantileNorm - #3183
Conversation
|
as a point for quantile regression optimization: running examples with random numbers, I see quite often convergence failures but where the predictions still look good and sometimes iteration limit reached |
|
no unit tests a brief google search finds this https://www.rdocumentation.org/packages/expectreg/ VGAM seems to have expectiles for specific distributions |
|
idea: generic unit test for Norm, testing for consistency with numerical derivatives. then this could be merged |
|
looks like there is a new package in R for m-quantile regression Mqrcm expectreg didn't get resurrected, still in archive with problems in c/cpp code |
|
bump for 0.14 just adding this as robust norm doesn't require a lot of unit testing. actual usage can be left to other PRs |
|
The R package expectreg might be a good reference for unit tests. |
|
Thanks, |
4ea057d to
3870cef
Compare
|
rebased and force pushed, no merge conflicts or problems with rebase old example script files I converted the former to notebook
|
|
aside: what's a better location? |
3870cef to
ec7b933
Compare
|
amended with style fixes, mainly too many empty lines |
|
a bit strange: This seems to be a problem or feature related to HuberT and not to MQuantileNorm. |
|
related: HuberT with t=1e-6 has problems with cov m and var_psiprime are both zero I guess this happens if we don't have any residuals in the t neighborhood of zero, (in quadratic segment) |
|
docstrings fixed should be ready to merge when green |
work in progress, I opened the PR so I don't loose track of this
This is currently just a RobustNorm class.
no unit tests yet, and might not have correct standard errors when used in RLM.
currently I only checked that the prediction is close to quantile regression with HuberT(t=small) e.g. small=1e-6. It "works" for expectiles when t is set very large, i.e. all observations are in the quadratic least squares range.
The prediction when using splines seems to become wigly very soon as the number of knots increases (unpenalized, just plain patsy), even more so in quantile regression and its M-quantile approximation than in least-squares expectiles.
There are several R packages mentioned in some of the articles but I have not yet looked at any of them.
background and status:
This should work as smooth alternative for the optimization in quantile regression. I wanted to add this for some time because it avoids the problem with residuals that are zero or around zero in quantile regression. e.g. #2377 and #2485
Just adding the norm is ok, it works for prediction. Full support for MQuantileRegression or asymmetric least squares requires more work, especially checking the cov_params and scale estimates.
For usability, we also need additional post-estimation features, like recovering quantiles and expected shortfall for risk analysis from the expectiles or M-quantiles.
spline application in general: we need to merge penalized splines, GAM and extend to RLM following a similar pattern as for GLM.
other extensions: quantile sheets and non-crossing M-quantiles. e.g. simple example had crossing 0.25 and 0.75 M-quantile with misspecified, quadratic M-quantile function. (splines don't seem to cross, at least not in the example)
References
(some of them)
Nychka et al. have epsilon approximation to quantile regression in appendix
(they use penalization splines with a knot at each observation point and parameterize in terms of the value of the spline at the observation point, i.e. not in terms of basis functions)
Bianchi, Annamaria, and Nicola Salvati. 2015. “Asymptotic Properties and Variance Estimators of the M-Quantile Regression Coefficients Estimators.” Communications in Statistics - Theory and Methods 44 (11): 2416–29. doi:10.1080/03610926.2013.791375.
Breckling, Jens, and Ray Chambers. 1988. “M-Quantiles.” Biometrika 75 (4): 761–71. doi:10.2307/2336317.
Jones, M. C. 1994. “Expectiles and M-Quantiles Are Quantiles.” Statistics & Probability Letters 20 (2): 149–53. doi:10.1016/0167-7152(94)90031-0.
Newey, Whitney K., and James L. Powell. 1987. “Asymmetric Least Squares Estimation and Testing.” Econometrica 55 (4): 819–47. doi:10.2307/1911031.
Nychka, Doug, Gerry Gray, Perry Haaland, David Martin, and Michael O’Connell. 1995. “A Nonparametric Regression Approach to Syringe Grading for Quality Improvement.” Journal of the American Statistical Association 90 (432): 1171–78. doi:10.2307/2291509.
Reiss, Philip T., and Lei Huang. 2012. “Smoothness Selection for Penalized Quantile Regression Splines.” The International Journal of Biostatistics 8 (1). doi:10.1515/1557-4679.1381.