FunctionFitter

public static class FunctionFitter
Provides fitting of standard function shapes through arbitrary (x,y) samples.

Methods

Fit

#
public static Function Fit(Point2d[] samples, FitKind kind, FitMetric metric, FitTrimming trimming, double threshold, out int[] indices)
Fit a function of a specific kind through a set of samples, discarding poorly fitted samples between fitting rounds.
samples (Point2d[])Samples to fit. Samples with non-finite coordinates are ignored.
kind (FitKind)Kind of function to fit.
metric (FitMetric)Error metric to minimise.
trimming (FitTrimming)Mechanism for discarding poorly fitted samples.
threshold (double)Trimming threshold, interpreted by the trimming mechanism.
indices (out int[])Indices of the samples used in the final fit, in ascending order.
Fitted function, or null if the samples do not suffice or no fit could be computed.

Fit

#
public static Function Fit(Point2d[] samples, FitKind kind, FitMetric metric)
Fit a function of a specific kind through a set of samples.
samples (Point2d[])Samples to fit. Samples with non-finite coordinates are ignored.
kind (FitKind)Kind of function to fit.
metric (FitMetric)Error metric to minimise.
Fitted function, or null if the samples do not suffice or no fit could be computed.