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
ConstructorsConstructorDescriptionFitByMedianStatistics(double pruneThreshold) Creates a new FitByMedianStatistics. -
Method Summary
Modifier and TypeMethodDescriptionvoidComputes the statistic error of the model to the data points.doubleReturns the computed statistical error.voidinit(DistanceFromModel<Model, Point> modelError, ArrayDeque<PointIndex<Point>> allPoints) This is called once to provide access to internal data structures of the owner.voidprune()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:StatisticalFitThis is called once to provide access to internal data structures of the owner.- Specified by:
initin 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:StatisticalFitComputes the statistic error of the model to the data points.- Specified by:
computeStatisticsin interfaceStatisticalFit<Model,Point>
-
prune
public void prune()Removes all samples which have an error larger than the specified percentile error.- Specified by:
prunein interfaceStatisticalFit<Model,Point>
-
getErrorMetric
public double getErrorMetric()Description copied from interface:StatisticalFitReturns the computed statistical error.- Specified by:
getErrorMetricin interfaceStatisticalFit<Model,Point> - Returns:
- The error.
-