Robust

class Robust(*args, **kwargs)

Bases: pybind11_object

Contains an M-estimator and various influence function.

This class implements an M-estimator with Tukey, Cauchy or Huber influence function [8] which allow uncertain measures to be less likely considered and in some cases completely rejected, thus inferring that the data is not normally distributed.

When using a robust estimate of the mean, it is usual to normalize the distribution to center the data around zero. In the case of a median operator, the normalized residue is given by:

\(\overline{r_i} = r_i - {Med}(r_i)\) where \({Med}(r_i)\) is the median value of the residue vector \(r\) .

The Median Absolute Deviation (MAD) representing one standard deviation of the normal distribution is given by:

\[\sigma = 1.48 \; {Med}(|\overline{r_i}|) \]

This class allows to set the minimum value of \(\sigma\) using setMinMedianAbsoluteDeviation() .

This estimated standard deviation \(\sigma\) can accordingly be used with a tuning variable for different influence functions.

Let us consider the weight function \(w(r)\) with \(r\) the residual vector of the parameters to estimate.

  • Using Huber influence function, with \(a\) a constant such as \(a=1.21 \; \sigma\) we have

    \[\begin{split}w(r_i) = \left\{ \begin{array}{ll} 1 & \mbox{if } |r_i| \leq a \\\frac{a}{|r_i|} & \mbox{else} \end{array} \right. \end{split}\]
  • Using Tukey influence function, with \(b\) a constant such as \(b=4.68 \; \sigma\) we have

    \[\begin{split}w(r_i) = \left\{ \begin{array}{ll} {\left(1 - {\left(\frac{r_i}{b}\right)}^2 \right)}^2 & \mbox{if } |r_i| \leq b \\0 & \mbox{else} \end{array} \right. \end{split}\]
  • Using Cauchy influence function, with \(c\) a constant such as \(c=2.38 \; \sigma\) we have

    \[w(r_i) = \frac{1}{(1 + {(r_i/c)}^2)} \]

Given the influence function and the residual vector, the weights are updated in MEstimator() .

Overloaded function.

  1. __init__(self: visp._visp.core.Robust) -> None

Default constructor.

  1. __init__(self: visp._visp.core.Robust, other: visp._visp.core.Robust) -> None

Copy constructor.

Methods

MEstimator

__init__

Overloaded function.

getMedianAbsoluteDeviation

Return residual vector Median Absolute Deviation (MAD).

getMinMedianAbsoluteDeviation

Return the min value used to threshold residual vector Median Absolute Deviation (MAD).

setMinMedianAbsoluteDeviation

Set minimal median absolute deviation (MAD) value corresponding to the minimal value of \(\sigma\) computed in MEstimator() with \(\sigma = 1.48{Med}(|r_i - {Med}(r_i)|)\) .

Inherited Methods

Operators

__doc__

__init__

Overloaded function.

__module__

Attributes

CAUCHY

HUBER

TUKEY

__annotations__

class RobustEstimatorType(self, value: int)

Bases: pybind11_object

Enumeration of influence functions.

Values:

  • TUKEY: Tukey influence function.

  • CAUCHY: Cauchy influence function.

  • HUBER: Huber influence function.

__and__(self, other: object) object
__eq__(self, other: object) bool
__ge__(self, other: object) bool
__getstate__(self) int
__gt__(self, other: object) bool
__hash__(self) int
__index__(self) int
__init__(self, value: int)
__int__(self) int
__invert__(self) object
__le__(self, other: object) bool
__lt__(self, other: object) bool
__ne__(self, other: object) bool
__or__(self, other: object) object
__rand__(self, other: object) object
__ror__(self, other: object) object
__rxor__(self, other: object) object
__setstate__(self, state: int) None
__xor__(self, other: object) object
property name : str
MEstimator(self, method: visp._visp.core.Robust.RobustEstimatorType, residues: visp._visp.core.ColVector, weights: visp._visp.core.ColVector) None
__init__(*args, **kwargs)

Overloaded function.

  1. __init__(self: visp._visp.core.Robust) -> None

Default constructor.

  1. __init__(self: visp._visp.core.Robust, other: visp._visp.core.Robust) -> None

Copy constructor.

getMedianAbsoluteDeviation(self) float

Return residual vector Median Absolute Deviation (MAD). This value is updated after a call to MEstimator() . It corresponds to value of \(\sigma = 1.48{Med}(|r_i - {Med}(r_i)|)\) . This value cannot be lower than the min value returned by getMinMedianAbsoluteDeviation() or set with setMinMedianAbsoluteDeviation() .

Note

See setMinMedianAbsoluteDeviation()

getMinMedianAbsoluteDeviation(self) float

Return the min value used to threshold residual vector Median Absolute Deviation (MAD). This value corresponds to the minimal value of \(\sigma\) computed in MEstimator() .

Note

See setMinMedianAbsoluteDeviation()

setMinMedianAbsoluteDeviation(self, mad_min: float) None

Set minimal median absolute deviation (MAD) value corresponding to the minimal value of \(\sigma\) computed in MEstimator() with \(\sigma = 1.48{Med}(|r_i - {Med}(r_i)|)\) .

Note

See getMinMedianAbsoluteDeviation()

Parameters:
mad_min: float

Minimal Median Absolute Deviation value. Default value is set to 0.0017 in the default constructor.