Class UncoupledParameterTransforms

  • All Implemented Interfaces:
    NonLinearParameterTransforms

    public class UncoupledParameterTransforms
    extends Object
    implements NonLinearParameterTransforms
    For a set of n function parameters, this takes n ParameterLimitsTransform (which can be the NullTransform which does NOT transform the parameter) which transform a constrained function parameter (e.g. must be between -1 and 1) to a unconstrained fit parameter. It also takes a BitSet (of length n) with an element set to true if that parameter is fixed - a set of n startValues must also be provided, with only those corresponding to fixed parameters being used (i.e. the parameter is fixed at the startValue). The purpose is to allow an optimiser to work with unconstrained parameters without modifying the function that one wishes to optimise.
    • Constructor Detail

      • UncoupledParameterTransforms

        public UncoupledParameterTransforms​(DoubleArray startValues,
                                            ParameterLimitsTransform[] transforms,
                                            BitSet fixed)
        Parameters:
        startValues - fixed parameter values (if no parameters are fixed this is completely ignored)
        transforms - Array of ParameterLimitsTransform (which can be the NullTransform which does NOT transform the parameter) which transform a constrained function parameter (e.g. must be between -1 and 1) to a unconstrained fit parameter.
        fixed - BitSet with an element set to true if that parameter is fixed
    • Method Detail

      • getNumberOfFittingParameters

        public int getNumberOfFittingParameters()
        Specified by:
        getNumberOfFittingParameters in interface NonLinearParameterTransforms
        Returns:
        The number of fitting parameters (equals the number of model parameters minus the number of fixed parameters)
      • transform

        public DoubleArray transform​(DoubleArray functionParameters)
        Transforms from a set of function parameters (some of which may have constrained range and/or be fixed) to a (possibly smaller) set of unconstrained fitting parameters. Note: If a parameter is fixed, it is its value as provided by startValues not the value given here that will be returned by inverseTransform (and thus used in the function).
        Specified by:
        transform in interface NonLinearParameterTransforms
        Parameters:
        functionParameters - The function parameters
        Returns:
        The fitting parameters
      • inverseTransform

        public DoubleArray inverseTransform​(DoubleArray fittingParameters)
        Transforms from a set of unconstrained fitting parameters to a (possibly larger) set of function parameters (some of which may have constrained range and/or be fixed).
        Specified by:
        inverseTransform in interface NonLinearParameterTransforms
        Parameters:
        fittingParameters - The fitting parameters
        Returns:
        The function parameters
      • jacobian

        public DoubleMatrix jacobian​(DoubleArray functionParameters)
        Calculates the Jacobian of the transform from function parameters to fitting parameters - the i,j element will be the partial derivative of i^th fitting parameter with respect. to the j^th function parameter
        Specified by:
        jacobian in interface NonLinearParameterTransforms
        Parameters:
        functionParameters - The function parameters
        Returns:
        matrix of partial derivative of fitting parameter with respect to function parameters
      • inverseJacobian

        public DoubleMatrix inverseJacobian​(DoubleArray fittingParameters)
        Calculates the Jacobian of the transform from fitting parameters to function parameters - the i,j element will be the partial derivative of i^th function parameter with respect. to the j^th fitting parameter
        Specified by:
        inverseJacobian in interface NonLinearParameterTransforms
        Parameters:
        fittingParameters - The fitting parameters
        Returns:
        matrix of partial derivative of function parameter with respect to fitting parameters
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object