public interface WeightingFunction extends Named
If two functions f(x) and g(x) fit the data set (x_i,y_i) at the points x_a and x_b (i.e. f(x_a) = g(x_a) = y_a and f(x_b) = g(x_b) = y_b), then a weighted function h(x) = w(x)f(x) + (1-w(x))*g(x) with 0 <= w(x) <= 1 will also fit the points a and b
| Modifier and Type | Method and Description |
|---|---|
double |
getWeight(double y)
Gets the weight.
|
default double |
getWeight(double[] xs,
int index,
double x)
Gets the function weight for point x, based on the lower bound index.
|
static WeightingFunction |
of(String uniqueName)
Obtains an instance from the specified unique name.
|
static WeightingFunction of(String uniqueName)
uniqueName - the unique nameIllegalArgumentException - if the name is not knowndefault double getWeight(double[] xs,
int index,
double x)
xs - the independent data pointsindex - the index of the data point below xx - the x-point to find the weight fordouble getWeight(double y)
The condition that must be satisfied by all weight functions is that w(1) = 1, w(0) = 0 and dw(y)/dy <= 0 - i.e. w(y) is monotonically decreasing.
y - a value between 0 and 1Copyright 2009-Present by OpenGamma Inc. and individual contributors
Apache v2 licensed
Additional documentation can be found at strata.opengamma.io.