0
$\begingroup$

I see that in various non-linear least squares minimization libraries a robust loss function is used to reduce the influence of outliers. See rho in here or here. This rho is applied to the squared residuals.

Now, I'm using the Levenberg Marquardt implementation available in the C++ Eigen library, which is based on MINPACK lmdif (I'm using finite differences to compute the jacobian). This implementation of LM doesn't support for providing an external robust loss function. What I've done, instead, is to apply a robust loss function, such as Cauchy or Huber, directly to the residuals just after I calculate them in my error function and return this to the minimizer. So I'm applying rho before the residuals are squared (inside the minimizer). This seems to work for some tests I've done but I'm not sure if that is correct or may give me some problems (I wonder how this affects the jacobian if it's calculated with finite differences).

Is what I'm doing Ok? or is there a better way of making a simple LM minimizer(read MINPACK lmdif) robust to outliers?

$\endgroup$
0
$\begingroup$

Now I think maybe this wasn't the best place for my question. In anycase, I thought to post my findings as an answer.

From my experiments, applying a loss function directly to the residuals seems to work fine. Some people suggested that it may affect the rate of converge, but I still get the correct results.

An alternative I have tried is to use Iteratively Reweighted Least Squares using the LM as a least squares backend. This worked well in that I managed to downweight the outliers (however not removing their influence completely). But in practice, it didn't work as well as applying a loss function directly to the residuals, and it was slower (due to the repeated iterations of LM).

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.