|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.commons.math.optimization.fitting.GaussianParametersGuesser
public class GaussianParametersGuesser
Guesses the parameters (a
, b
, c
, and d
)
of a ParametricGaussianFunction
based on the specified observed
points.
Field Summary | |
---|---|
private WeightedObservedPoint[] |
observations
Observed points. |
private double[] |
parameters
Resulting guessed parameters. |
Constructor Summary | |
---|---|
GaussianParametersGuesser(WeightedObservedPoint[] observations)
Constructs instance with the specified observed points. |
Method Summary | |
---|---|
private double[] |
basicGuess(WeightedObservedPoint[] points)
Guesses the parameters based on the specified observed points. |
private Comparator<WeightedObservedPoint> |
createWeightedObservedPointComparator()
Factory method creating Comparator for comparing
WeightedObservedPoint instances. |
private int |
findMaxY(WeightedObservedPoint[] points)
Finds index of point in specified points with the largest Y. |
private int |
findMinY(WeightedObservedPoint[] points)
Finds index of point in specified points with the smallest Y. |
private WeightedObservedPoint[] |
getInterpolationPointsForY(WeightedObservedPoint[] points,
int startIdx,
int idxStep,
double y)
Gets the two bounding interpolation points from the specified points suitable for determining X at the specified Y. |
double[] |
guess()
Guesses the parameters based on the observed points. |
private double |
interpolateXAtY(WeightedObservedPoint[] points,
int startIdx,
int idxStep,
double y)
Interpolates using the specified points to determine X at the specified Y. |
private boolean |
isBetween(double value,
double boundary1,
double boundary2)
Determines whether a value is between two other values. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private final WeightedObservedPoint[] observations
private double[] parameters
Constructor Detail |
---|
public GaussianParametersGuesser(WeightedObservedPoint[] observations)
observations
- observed points upon which should base guessMethod Detail |
---|
public double[] guess()
{a, b, c, d}
private double[] basicGuess(WeightedObservedPoint[] points)
points
- observed points upon which should base guess
{a, b, c, d}
private int findMinY(WeightedObservedPoint[] points)
points
- points to search
private int findMaxY(WeightedObservedPoint[] points)
points
- points to search
private double interpolateXAtY(WeightedObservedPoint[] points, int startIdx, int idxStep, double y) throws OutOfRangeException
points
- points to use for interpolationstartIdx
- index within points from which to start search for
interpolation bounds pointsidxStep
- index step for search for interpolation bounds pointsy
- Y value for which X should be determined
IllegalArgumentException
- if idxStep is 0
OutOfRangeException
- if specified y
is not within the
range of the specified points
private WeightedObservedPoint[] getInterpolationPointsForY(WeightedObservedPoint[] points, int startIdx, int idxStep, double y) throws OutOfRangeException
points
- points to use for interpolationstartIdx
- index within points from which to start search for
interpolation bounds pointsidxStep
- index step for search for interpolation bounds pointsy
- Y value for which X should be determined
IllegalArgumentException
- if idxStep is 0
OutOfRangeException
- if specified y
is not within the
range of the specified points
private boolean isBetween(double value, double boundary1, double boundary2)
value
- value to determine whether is between boundary1
and boundary2
boundary1
- one end of the rangeboundary2
- other end of the range
value
is between boundary1
and
boundary2
(inclusive); false otherwiseprivate Comparator<WeightedObservedPoint> createWeightedObservedPointComparator()
Comparator
for comparing
WeightedObservedPoint
instances.
Comparator
instance
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |