regressioninc.linear.robust module#
Functions to enable robust linear regression
- regressioninc.linear.robust.mad(arr: ndarray, c: float = 0.6744897501960817, center: float | None = None) float[source]#
The Median Absolute Deviation from the center
There is no immediately obvious median for complex data. Therefore, the absolute value is taken before calculating out the median.
- Parameters:
arr (np.ndarray) – The data of which to take the
c (float, optional) – A scaling factor, by default Gaussian.ppf(3 / 4.0)
center (Optional[float], optional) – The center from which to calculate the median deviation, by default None. If it is None, the geometric median of the data will be used.
- Returns:
mad = median(abs(a - center))/c
- Return type:
float