public class DoubleRangeLimitTransform extends Object implements ParameterLimitsTransform
If a model parameter $x$ is constrained to be between two values $a \geq x \geq b$, the function to transform it to an unconstrained variable is $y$ is given by $$ \begin{align*} y &= \tanh^{-1}\left(\frac{x - m}{s}\right)\\ m &= \frac{a + b}{2}\\ s &= \frac{b - a}{2} \end{align*} $$ with the inverse transform $$ \begin{align*} x &= s\tanh(y) + m\\ \end{align*} $$
ParameterLimitsTransform.LimitType| Constructor and Description |
|---|
DoubleRangeLimitTransform(double lower,
double upper)
Creates an instance.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(Object obj) |
int |
hashCode() |
double |
inverseTransform(double y)
If $y > 25$, this returns $b$.
|
double |
inverseTransformGradient(double y)
If $|y| > 25$, this returns 0.
|
double |
transform(double x)
A function to transform a constrained model parameter (y) to an unconstrained fitting parameter (y*) - i.e.
|
double |
transformGradient(double x)
The gradient of the function used to transform from a model parameter that is only allows
to take certain values, to a fitting parameter that can take any value.
|
public DoubleRangeLimitTransform(double lower,
double upper)
lower - Lower limitupper - Upper limitIllegalArgumentException - If the upper limit is not greater than the lower limitpublic double inverseTransform(double y)
inverseTransform in interface ParameterLimitsTransformy - Fitting parameterpublic double transform(double x)
transform in interface ParameterLimitsTransformx - Model parameterIllegalArgumentException - If $x > b$ or $x < a$public double inverseTransformGradient(double y)
inverseTransformGradient in interface ParameterLimitsTransformy - fitting parameterpublic double transformGradient(double x)
transformGradient in interface ParameterLimitsTransformx - Model parameterIllegalArgumentException - If $x > b$ or $x < a$Copyright 2009-Present by OpenGamma Inc. and individual contributors
Apache v2 licensed
Additional documentation can be found at strata.opengamma.io.