Class GaussianFittingFunction
- java.lang.Object
-
- elki.math.linearalgebra.fitting.GaussianFittingFunction
-
- All Implemented Interfaces:
FittingFunction
public class GaussianFittingFunction extends java.lang.Object implements FittingFunction
Gaussian function for parameter fittingBased loosely on fgauss in the book "Numerical Recipies".
We did not bother to implement all optimizations at the benefit of having easier to use parameters. Instead of position, amplitude and width used in the book, we use the traditional Gaussian parameters mean, standard deviation and a linear scaling factor (which is mostly useful when combining multiple distributions) The cost are some additional computations such as a square root and probably a slight loss in precision. This could of course have been handled by an appropriate wrapper instead.Due to their license, we cannot use their code, but we have to implement the mathematics ourselves. We hope the loss in precision isn't big.
They are also arranged differently: the book uses
amplitude, position, width
whereas we usemean, stddev, scaling
.
But we're obviously using essentially the same mathematics.The function also can use a mixture of gaussians, just use an appropriate number of parameters (which obviously needs to be a multiple of 3)
- Since:
- 0.2
- Author:
- Erich Schubert
-
-
Field Summary
Fields Modifier and Type Field Description static GaussianFittingFunction
STATIC
Static instance
-
Constructor Summary
Constructors Constructor Description GaussianFittingFunction()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description FittingFunctionResult
eval(double x, double[] params)
Compute the mixture of Gaussians at the given position
-
-
-
Field Detail
-
STATIC
public static final GaussianFittingFunction STATIC
Static instance
-
-
Method Detail
-
eval
public FittingFunctionResult eval(double x, double[] params)
Compute the mixture of Gaussians at the given position- Specified by:
eval
in interfaceFittingFunction
- Parameters:
x
- Current coordinateparams
- Function parameters parameters- Returns:
- Array consisting of y value and parameter gradients
-
-