Class 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$.
    • 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$
      • inverseTransformGradient

        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:
        the gradient
      • transformGradient

        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:
        the gradient
        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$
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object