## Class SingleRangeLimitTransform

• java.lang.Object
• com.opengamma.strata.math.impl.minimization.SingleRangeLimitTransform
• All Implemented Interfaces:
ParameterLimitsTransform

public class SingleRangeLimitTransform
extends Object
implements ParameterLimitsTransform
If a model parameter $x$ is constrained to be either above or below some level $a$ (i.e. $x > a$ or $x < a$), the function to transform it to an unconstrained variable $y$ is given by \begin{align*} y = \begin{cases} \ln(e^{x-a} - 1)\quad & x > a\\ a - \ln(e^{a-x} - 1)\quad & x < a \end{cases} \end{align*} with inverse transform \begin{align*} x = \begin{cases} a + \ln(e^y + 1)\quad & x > a\\ a - \ln(e^y + 1)\quad & x < a \end{cases} \end{align*} For large $y > 50$, this becomes \begin{align*} y = \begin{cases} x - a\quad & x > a\\ a - x\quad & x < a \end{cases} \end{align*} with inverse transform \begin{align*} x = \begin{cases} a + y\quad & x > a\\ a - y\quad & x < a \end{cases} \end{align*} so any value of $y$ will give a value of $x$.

• ### Nested classes/interfaces inherited from interface com.opengamma.strata.math.impl.minimization.ParameterLimitsTransform

ParameterLimitsTransform.LimitType
• ### Constructor Summary

Constructors
Constructor Description
SingleRangeLimitTransform​(double a, ParameterLimitsTransform.LimitType limitType)
Creates an instance.
• ### Method Summary

All Methods
Modifier and Type Method Description
boolean equals​(Object obj)
int hashCode()
double inverseTransform​(double y)
A function to transform an unconstrained fitting parameter (y*) to a constrained model parameter (y) - i.e.
double inverseTransformGradient​(double y)
The gradient of the function used to transform from a fitting parameter that can take any value, to a model parameter that is only allows to take certain values.
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.
• ### Methods inherited from class java.lang.Object

clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
• ### Constructor Detail

• #### SingleRangeLimitTransform

public SingleRangeLimitTransform​(double a,
ParameterLimitsTransform.LimitType limitType)
Creates an instance.
Parameters:
a - The limit level
limitType - Type of the limit for the parameter
• ### Method Detail

• #### inverseTransform

public double inverseTransform​(double y)
A function to transform an unconstrained fitting parameter (y*) to a constrained model parameter (y) - i.e. y = f^-1(y*)
Specified by:
inverseTransform in interface ParameterLimitsTransform
Parameters:
y - Fitting parameter
Returns:
Model parameter
• #### transform

public double transform​(double x)
A function to transform a constrained model parameter (y) to an unconstrained fitting parameter (y*) - i.e. y* = f(y)
Specified by:
transform in interface ParameterLimitsTransform
Parameters:
x - Model parameter
Returns:
Fitting parameter
Throws:
IllegalArgumentException - If the value of $x$ is not consistent with the limit (e.g. the limit is $x > a$ and $x$ is less than $a$

public double inverseTransformGradient​(double y)
The gradient of the function used to transform from a fitting parameter that can take any value, to a model parameter that is only allows to take certain values.
Specified by:
inverseTransformGradient in interface ParameterLimitsTransform
Parameters:
y - fitting parameter
Returns:

public 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.
Specified by:
transformGradient in interface ParameterLimitsTransform
Parameters:
x - Model parameter
Returns:
IllegalArgumentException - If the value of $x$ is not consistent with the limit (e.g. the limit is $x > a$ and $x$ is less than $a$
public int hashCode()
hashCode in class Object
public boolean equals​(Object obj)
equals in class Object