|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.apache.commons.math.optimization.fitting.ParametricGaussianFunction
public class ParametricGaussianFunction
A Gaussian function. Specifically:
f(x) = a + b*exp(-((x - c)^2 / (2*d^2)))
The parameters have the following meaning:
| Field Summary | |
|---|---|
private static long |
serialVersionUID
Serializable version Id. |
| Constructor Summary | |
|---|---|
ParametricGaussianFunction()
Constructs an instance. |
|
| Method Summary | |
|---|---|
double[] |
gradient(double x,
double[] parameters)
Computes the gradient vector for a four variable version of the function where the parameters, a, b, c, and d, are considered the variables, not x. |
private void |
validateParameters(double[] parameters)
Validates parameters to ensure they are appropriate for the evaluation of the value and gradient methods. |
double |
value(double x,
double[] parameters)
Computes value of function f(x) for the specified x and parameters a, b, c, and d. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
private static final long serialVersionUID
| Constructor Detail |
|---|
public ParametricGaussianFunction()
| Method Detail |
|---|
public double value(double x,
double[] parameters)
throws ZeroException
value in interface ParametricRealFunctionx - x valueparameters - values of a, b, c, and
d
java.lang.IllegalArgumentException - if parameters is invalid as
determined by validateParameters(double[])
ZeroException - if parameters values are
invalid as determined by validateParameters(double[])
public double[] gradient(double x,
double[] parameters)
throws ZeroException
The components of the computed gradient vector are the partial derivatives of f(a, b, c, d) with respect to each variable. That is, the partial derivative of f(a, b, c, d) with respect to a, the partial derivative of f(a, b, c, d) with respect to b, the partial derivative of f(a, b, c, d) with respect to c, and the partial derivative of f(a, b, c, d) with respect to d.
gradient in interface ParametricRealFunctionx - x value to be used as constant in f(a, b, c,
d)parameters - values of a, b, c, and
d for computation of gradient vector of f(a, b, c,
d)
java.lang.IllegalArgumentException - if parameters is invalid as
determined by validateParameters(double[])
ZeroException - if parameters values are
invalid as determined by validateParameters(double[])
private void validateParameters(double[] parameters)
throws ZeroException
value and gradient methods.
parameters - values of a, b, c, and
d
java.lang.IllegalArgumentException - if parameters is
null or if parameters does not have
length == 4
ZeroException - if parameters[3]
(d) is 0
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||