LinearRegression_M


Computes linear regression of given point set using selected M-estimator for outlier suppression.

Syntax

C++
C#
Python
 
def LinearRegression_M(
	inYValues: list[float],
	inIterationCount: int,
	/,
	*,
	inXValues: list[float] | None = None,
	inOutlierSuppression: MEstimator = MEstimator.Huber,
	inClippingFactor: float = 2.5,
	inInitialLinearFunction: LinearFunction | None = None
)
-> (
	outLinearFunction: LinearFunction,
	outEstimatedValues: list[float],
	outResiduals: list[float],
	outYInliers: list[float],
	outXInliers: list[float]
)

Parameters

Name Type Range Default Description
Input value inYValues list[float] Sequence of ordinates
Input value inXValues list[float] | None None Sequence of abscissae, or {0, 1, 2, ...} by default
Input value inOutlierSuppression MEstimator MEstimator.Huber
Input value inClippingFactor float 0.675 - 6.0 2.5 Multitude of standard deviation within which points are considered inliers
Input value inIterationCount int 0 - Number of iterations of outlier suppressing algorithm
Input value inInitialLinearFunction LinearFunction | None None Initial approximation of the output linear function (if available)
Output value outLinearFunction LinearFunction Linear function approximating the given point set
Output value outEstimatedValues list[float] The result of application of the computed function to the X values
Output value outResiduals list[float] Difference between an input Y value and the corresponding estimated value
Output value outYInliers list[float] Coordinate of the inlying points of the best line
Output value outXInliers list[float] Coordinate of the inlying points of the best line