Class SumToOne


  • public class SumToOne
    extends Object
    For a set of N-1 "fit" parameters, produces N "model" parameters that sum to one.
    • Constructor Detail

      • SumToOne

        public SumToOne​(int n)
        For a set of N-1 "fit" parameters, produces N "model" parameters that sum to one.
        Parameters:
        n - The number of "model" parameters, N
    • Method Detail

      • transform

        public double[] transform​(double[] fitParms)
        Transform from the N-1 "fit" parameters to the N "model" parameters.
        Parameters:
        fitParms - The N-1 "fit" parameters
        Returns:
        The N "model" parameters
      • transform

        public DoubleArray transform​(DoubleArray fitParms)
        Transform from the N-1 "fit" parameters to the N "model" parameters.
        Parameters:
        fitParms - The N-1 "fit" parameters
        Returns:
        The N "model" parameters
      • inverseTransform

        public double[] inverseTransform​(double[] modelParms)
        Inverse transform from the N "model" parameters to the N-1 "fit" parameters. Used mainly to find the start position of a optimisation routine.
        Parameters:
        modelParms - The N "model" parameters. These must sum to one
        Returns:
        The N-1 "fit" parameters
      • inverseTransform

        public DoubleArray inverseTransform​(DoubleArray modelParms)
        Inverse transform from the N "model" parameters to the N-1 "fit" parameters. Used mainly to find the start position of a optimisation routine.
        Parameters:
        modelParms - The N "model" parameters. These must sum to one
        Returns:
        The N-1 "fit" parameters
      • jacobian

        public double[][] jacobian​(double[] fitParms)
        The N by N-1 Jacobian matrix between the N "model" parameters (that sum to one) and the N-1 "fit" parameters.
        Parameters:
        fitParms - The N-1 "fit" parameters
        Returns:
        The N by N-1 Jacobian matrix
      • jacobian

        public DoubleMatrix jacobian​(DoubleArray fitParms)
        The N by N-1 Jacobian matrix between the N "model" parameters (that sum to one) and the N-1 "fit" parameters.
        Parameters:
        fitParms - The N-1 "fit" parameters
        Returns:
        The N by N-1 Jacobian matrix
      • getSet

        protected static int[][] getSet​(int n)