S - the type of argumentsT - the type of parametersU - the type of resultpublic abstract class ParameterizedFunction<S,T,U> extends Object
evaluate(S, T) method. The function can also be converted into a 1-D function
of the arguments or a 1-D function of the parameters.
For example, assume that there is a function $f(x, \overline{a})$ defined as:
$$
\begin{align*}
f(x, \overline{a}) = a_0 + a_1 x + a_2 x^2 + a_3 x^6
\end{align*}
$$
The evaluate(S, T) method takes the value $x$ and the parameters
$\overline{a}$ and returns the result. If the function is converted into a
function of the arguments, the resulting function $g(x)$ is:
$$
\begin{align*}
g(x) = a_0 + a_1 x + a_2 x^2 + a_3 x^6
\end{align*}
$$
with $\overline{a}$ constant. If the function is converted into a function
of the parameters, the resulting function $h(\overline{a})$ is:
$$
\begin{align*}
h(\overline{a}) = a_0 + a_1 x + a_2 x^2 + a_3 x^6
\end{align*}
$$
with $x$ constant.
This class is particularly useful when trying to fit the parameters of a model,
such as in a Nelson Siegel Svennson bond curve model.| Constructor and Description |
|---|
ParameterizedFunction() |
| Modifier and Type | Method and Description |
|---|---|
Function<S,U> |
asFunctionOfArguments(T params)
Uses the parameters to create a function.
|
Function<T,U> |
asFunctionOfParameters(S x)
Uses the parameters to create a function.
|
abstract U |
evaluate(S x,
T parameters)
Evaluates the function.
|
abstract int |
getNumberOfParameters()
Gets the number of parameters.
|
public abstract U evaluate(S x, T parameters)
x - the value at which the function is to be evaluatedparameters - the parameters of the functionpublic Function<T,U> asFunctionOfParameters(S x)
x - the value at which the function is to be evaluated, not nullpublic Function<S,U> asFunctionOfArguments(T params)
params - the parameters for which the function is to be evaluated, not nullpublic abstract int getNumberOfParameters()
Copyright 2009-Present by OpenGamma Inc. and individual contributors
Apache v2 licensed
Additional documentation can be found at strata.opengamma.io.