Back to FabImage Library website
You are here: Start » Function Reference » Data Classification » Regression Analysis » LinearRegression_M

LinearRegression_M
Header: | FIL.h |
---|---|
Namespace: | fil |
Module: | FoundationPro |
Computes linear regression of given point set using selected M-estimator for outlier suppression.
Syntax
C++
C#
void fil::LinearRegression_M ( const ftl::Array<float>& inYValues, ftl::Optional<const ftl::Array<float>&> inXValues, fil::MEstimator::Type inOutlierSuppression, float inClippingFactor, int inIterationCount, ftl::Optional<const fil::LinearFunction&> inInitialLinearFunction, fil::LinearFunction& outLinearFunction, ftl::Array<float>& outEstimatedValues, ftl::Array<float>& outResiduals, ftl::Optional<ftl::Array<float>&> outYInliers = ftl::NIL, ftl::Optional<ftl::Array<float>&> outXInliers = ftl::NIL )
Parameters
Name | Type | Range | Default | Description | |
---|---|---|---|---|---|
![]() |
inYValues | const Array<float>& | Sequence of ordinates | ||
![]() |
inXValues | Optional<const Array<float>&> | NIL | Sequence of abscissae, or {0, 1, 2, ...} by default | |
![]() |
inOutlierSuppression | MEstimator::Type | |||
![]() |
inClippingFactor | float | 0.675 - 6.0 | 2.5f | Multitude of standard deviation within which points are considered inliers |
![]() |
inIterationCount | int | 0 - ![]() |
5 | Number of iterations of outlier suppressing algorithm |
![]() |
inInitialLinearFunction | Optional<const LinearFunction&> | NIL | Initial approximation of the output linear function (if available) | |
![]() |
outLinearFunction | LinearFunction& | Linear function approximating the given point set | ||
![]() |
outEstimatedValues | Array<float>& | The result of application of the computed function to the X values | ||
![]() |
outResiduals | Array<float>& | Difference between an input Y value and the corresponding estimated value | ||
![]() |
outYInliers | Optional<Array<float>&> | NIL | Coordinate of the inlying points of the best line | |
![]() |
outXInliers | Optional<Array<float>&> | NIL | Coordinate of the inlying points of the best line |
Optional Outputs
The computation of following outputs can be switched off by passing value ftl::NIL
to these parameters: outYInliers, outXInliers.
Read more about Optional Outputs.
Errors
List of possible exceptions:
Error type | Description |
---|---|
DomainError | Inconsistent size of arrays in LinearRegression_M. |