|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.apache.commons.math3.optimization.fitting.GaussianFitter.ParameterGuesser
public static class GaussianFitter.ParameterGuesser
Guesses the parameters norm, mean, and sigma
of a Gaussian.Parametric
based on the specified observed points.
| Field Summary | |
|---|---|
private double |
mean
Mean. |
private double |
norm
Normalization factor. |
private double |
sigma
Standard deviation. |
| Constructor Summary | |
|---|---|
GaussianFitter.ParameterGuesser(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 int |
findMaxY(WeightedObservedPoint[] points)
Finds index of point in specified points with the largest 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()
Gets an estimation of the parameters. |
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. |
private WeightedObservedPoint[] |
sortObservations(WeightedObservedPoint[] unsorted)
Sort the observations. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
private final double norm
private final double mean
private final double sigma
| Constructor Detail |
|---|
public GaussianFitter.ParameterGuesser(WeightedObservedPoint[] observations)
observations - Observed points from which to guess the
parameters of the Gaussian.
NullArgumentException - if observations is
null.
NumberIsTooSmallException - if there are less than 3
observations.| Method Detail |
|---|
public double[] guess()
private WeightedObservedPoint[] sortObservations(WeightedObservedPoint[] unsorted)
unsorted - Input observations.
private double[] basicGuess(WeightedObservedPoint[] points)
points - Observed points, sorted.
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 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.
ZeroException - 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 interpolation.startIdx - Index within points from which to start search for
interpolation bounds points.idxStep - Index step for search for interpolation bounds points.y - Y value for which X should be determined.
ZeroException - 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 test whether it is between boundary1
and boundary2.boundary1 - One end of the range.boundary2 - Other end of the range.
true if value is between boundary1 and
boundary2 (inclusive), false otherwise.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||