Class SimpleCurveFitter.ParameterGuesser
- java.lang.Object
-
- org.apache.commons.math4.legacy.fitting.SimpleCurveFitter.ParameterGuesser
-
- Direct Known Subclasses:
GaussianCurveFitter.ParameterGuesser,HarmonicCurveFitter.ParameterGuesser
- Enclosing class:
- SimpleCurveFitter
public abstract static class SimpleCurveFitter.ParameterGuesser extends Object
Guesses the parameters.
-
-
Constructor Summary
Constructors Constructor Description ParameterGuesser()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected intfindMaxY(WeightedObservedPoint[] points)Finds index of point in specified points with the largest Y.abstract double[]guess(Collection<WeightedObservedPoint> obs)Computes an estimation of the parameters.protected doubleinterpolateXAtY(WeightedObservedPoint[] points, int startIdx, int idxStep, double y)Interpolates using the specified points to determine X at the specified Y.protected List<WeightedObservedPoint>sortObservations(Collection<WeightedObservedPoint> unsorted)Sort the observations.
-
-
-
Constructor Detail
-
ParameterGuesser
public ParameterGuesser()
-
-
Method Detail
-
guess
public abstract double[] guess(Collection<WeightedObservedPoint> obs)
Computes an estimation of the parameters.- Parameters:
obs- Observations.- Returns:
- the guessed parameters.
-
sortObservations
protected List<WeightedObservedPoint> sortObservations(Collection<WeightedObservedPoint> unsorted)
Sort the observations.- Parameters:
unsorted- Input observations.- Returns:
- the input observations, sorted.
-
findMaxY
protected int findMaxY(WeightedObservedPoint[] points)
Finds index of point in specified points with the largest Y.- Parameters:
points- Points to search.- Returns:
- the index in specified points array.
-
interpolateXAtY
protected double interpolateXAtY(WeightedObservedPoint[] points, int startIdx, int idxStep, double y)
Interpolates using the specified points to determine X at the specified Y.- Parameters:
points- Points to use for interpolation.startIdx- Index within points from which to start the search for interpolation bounds points.idxStep- Index step for searching interpolation bounds points.y- Y value for which X should be determined.- Returns:
- the value of X for the specified Y.
- Throws:
ZeroException- ifidxStepis 0.OutOfRangeException- if specifiedyis not within the range of the specifiedpoints.
-
-