Skip to content

Huberized TVR #171

@pavelkomarov

Description

@pavelkomarov

This one is pretty easy to code. We can replace cvxpy.sum_squares(y - x) in TVR with sigma**2 * cvxpy.sum(cvxpy.huber((y - x)/sigma, M)), where sigma is calculated robustly with median_absolute_deviation as in the integration constant estimation code in utility.py and in evaluate.robust_rme. We might also want to add a huber_const like in kalman_smooth.convex_smooth so the Huber can't flatten out too much as $M \to 0$.

This adds a hyperparameter to the method, $M$, which raises its total to 3 (along with order and $\gamma$). Would need some changes in the default optimization dict at the top of _optimize.py too. But M shouldn't be too hard to optimize over if the $\sigma$ normalization and huber_const are used, because M=0 is an $\ell_1$ norm, M=float('inf') is an $\ell_2$ norm, and M = 2 or 6 or whatever has a standard interpretation of becoming linear at that many sigma from the mean error, such that by $6\sigma$ there are really hardly any inliers that would be treated by the linear region of the Huber, so they get the fit benefits of being treated with the parabolic region. I've accounted for this notion in the default optimization dictionary for robustdiff by letting huberM start at values [0., 2, 6]. (Note the period is important so it's treated as a continuous float by the optimizer and not cast back to discrete ints.)

With that understanding, the code changes are small, and the heaviest part of the work comes after, running experiments using notebook 4 (probably modified to not rerun absolutely everybody) to see how this thing improves on the previous design. More than likely it would slay at the outlier case, but we gotta make sure. Note that when there are outliers, optimize has a huberM of its own and uses evaluate.robust_rme in its loss calculations by default, but with huberM=6 (which shows no serious difference with huberM=float('inf'), interestingly). That should maybe be brought lower to something like 2 if outliers are expected. I believe a ternary to make this selection is already in situ within notebook 4.

Metadata

Metadata

Assignees

Labels

enhancementNew feature or improvement

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions