Summarizing the previous article: we have a set of samples, mostly affected by errors having a Gaussian distribution. Zero or more of the samples may be outliers, that is affected by exceptional errors which do not fit in the Gaussian distribution. We want to find the parameters of a model fitting the samples, excluding the outliers, and we try with
With respect to existing statistical methods like RANSAC and LMedS, this new method has the advantage that the weights are not binary but are treated as true real numbers, so that a closed form solution is available.
This is a problem of constrained minimum which can be solved with the method of Lagrange multipliers.
The lagrangian function is
As usual, the system of equations to be solved is
This system of nonlinear equations can be easily solved, eg with some variant of the Newton method.
The initial approximation for the parameters can be obtained by preliminarly performing a least squares fitting on all the samples, including outliers, and a reasonable initial approximation for the weights is .
For , a null initial approximation should be avoided, as it can lead to a very slow convergence.