Class FitByMedianStatistics<Model,Point>
java.lang.Object
org.ddogleg.fitting.modelset.distance.FitByMedianStatistics<Model,Point>
- All Implemented Interfaces:
StatisticalFit<Model,Point>
public class FitByMedianStatistics<Model,Point> extends Object implements StatisticalFit<Model,Point>
Computes the median error and prunes points if they have more than the specified percentile
error.
-
Constructor Summary
Constructors Constructor Description FitByMedianStatistics(double pruneThreshold)
Creates a new FitByMedianStatistics. -
Method Summary
Modifier and Type Method Description void
computeStatistics()
Computes the statistic error of the model to the data points.double
getErrorMetric()
Returns the computed statistical error.void
init(DistanceFromModel<Model,Point> modelError, ArrayDeque<PointIndex<Point>> allPoints)
This is called once to provide access to internal data structures of the owner.void
prune()
Removes all samples which have an error larger than the specified percentile error.
-
Constructor Details
-
FitByMedianStatistics
public FitByMedianStatistics(double pruneThreshold)Creates a new FitByMedianStatistics.- Parameters:
pruneThreshold
- Fraction of samples that are not pruned.
-
-
Method Details
-
init
public void init(DistanceFromModel<Model,Point> modelError, ArrayDeque<PointIndex<Point>> allPoints)Description copied from interface:StatisticalFit
This is called once to provide access to internal data structures of the owner.- Specified by:
init
in interfaceStatisticalFit<Model,Point>
- Parameters:
modelError
- Computes the error between a point and the modelallPoints
- Contains all the points which are currently considered part of the model.
-
computeStatistics
public void computeStatistics()Description copied from interface:StatisticalFit
Computes the statistic error of the model to the data points.- Specified by:
computeStatistics
in interfaceStatisticalFit<Model,Point>
-
prune
public void prune()Removes all samples which have an error larger than the specified percentile error.- Specified by:
prune
in interfaceStatisticalFit<Model,Point>
-
getErrorMetric
public double getErrorMetric()Description copied from interface:StatisticalFit
Returns the computed statistical error.- Specified by:
getErrorMetric
in interfaceStatisticalFit<Model,Point>
- Returns:
- The error.
-