Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## de.jstacs.utils
Class Normalisation

    java.lang.Object
      de.jstacs.utils.Normalisation

    public class Normalisation

extends Object

This class can be used for normalisation of any `double` array or a part of a `double` array.

Author:
  Jens Keilwagen, Jan Grau

Constructor Summary
`Normalisation()`

Method Summary
`static double` | `getLogSum(double... lnVal)` Returns the logarithm of the sum of values `val[i]` given as `lnVal[i] = Math.log( val[i] )`.
`static double` | `getLogSum(int start, int end, double... lnVal)` Returns the logarithm of the sum of values `v[i]` given as `lnVal[i] = Math.log( val[i] )` between a start and end index.
`static double` | `logSumNormalisation(double[] d)` The method does a log-sum-normalisation on the array `d`, where the values of `d` are assumed to be logarithmised.
`static double` | `logSumNormalisation(double[] d, double offset)` The method does a log-sum-normalisation on the array `d`, where the values of `d` are assumed to be logarithmised.
`static double` | `logSumNormalisation(double[] d, int startD, int endD)` The method does a log-sum-normalisation on the values of the array `d` between start index `startD` and end index `endD`, where the values of `d` are assumed to be logarithmised.
`static double` | `logSumNormalisation(double[] d, int startD, int endD, double[] secondValues)` The method does a log-sum-normalisation on the values of the array `d` between start index `startD` and end index `endD`, where the values of `d` are assumed to be logarithmised.
`static double` | `logSumNormalisation(double[] d, int startD, int endD, double[] secondValues, double[] dest, int startDest)` The method does a log-sum-normalisation on the values of the array `d` between start index `startD` and end index `endD`, where the values of `d` are assumed to be logarithmised.
`static double` | `logSumNormalisation(double[] d, int startD, int endD, double[] dest, int startDest)` The method does a log-sum-normalisation on the values of the array `d` between start index `startD` and end index `endD`, where the values of `d` are assumed to be logarithmised.
`static double` | `logSumNormalisation(double[] d, int startD, int endD, double offset, double[] secondValues, double[] dest, int startDest)` The method does a log-sum-normalisation on the values of the array `d` between start index `startD` and end index `endD`, where the values of `d` are assumed to be logarithmised.
`static double` | `logSumNormalisation(double[] d, int startD, int endD, double offset, double[] dest, int startDest)` The method does a log-sum-normalisation on the values of the array `d` between start index `startD` and end index `endD`, where the values of `d` are assumed to be logarithmised.
`static void` | `normalisation(double[] d, double v)` The method does a normalisation on `d` using the value `v` for normalisation.
`static void` | `normalisation(double[] d, double v, double[] dest, int start)` The method does a normalisation on `d` writing the result to `dest` starting at position `start` while `d` remains unchanged.
`static void` | `normalisation(double[] d, double v, int start, int end)` The method does a sum normalisation on `d` between start index `start` and end index `end` using the value `v` for the normalisation.
`static double` | `sumNormalisation(double[] d)` The method does a sum-normalisation on `d`, i.e. divides all values in `d` by the sum over all values in `d` and returns the sum of the values.
`static double` | `sumNormalisation(double[] d, double[] dest, int start)` The method does a sum-normalisation on `d`, i.e. divides all values in `d` by the sum over all values in `d` and writes the result to `dest` starting at position `start` while `d` remains unchanged.

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### Normalisation

    public Normalisation()

Method Detail

### getLogSum

    public static double getLogSum(double... lnVal)

  Returns the logarithm of the sum of values `val[i]` given as `lnVal[i] = Math.log( val[i] )`.

  Parameters:
    `lnVal` - the logs of the values, i.e. `lnVal[i] = Math.log( val[i] )`
  Returns:
    the logarithm of the sum of values
  See Also:
    `getLogSum(int, int, double...)`

### getLogSum

    public static double getLogSum(int start,
                                   int end,
                                   double... lnVal)

  Returns the logarithm of the sum of values `v[i]` given as `lnVal[i] = Math.log( val[i] )` between a start and end index.

  Parameters:
    `start` - the first index in `lnVal` considered for the sum
    `end` - the index after the last index considered for the sum
    `lnVal` - the logs of the values, i.e. `lnVal[i] = Math.log( val[i] )`
  Returns:
    the logarithm of the sum of values between the start and end index

### logSumNormalisation

    public static double logSumNormalisation(double[] d)

  The method does a log-sum-normalisation on the array `d`, where the values of `d` are assumed to be logarithmised. Let and . Then after log-sum-normalisation, the array `d` contains the normalized original values, i.e., is set to . The method returns the log-sum of the values, .

  Parameters:
    `d` - the array with the logarithmised values that should be normalised
  Returns:
    the logarithm of the sum of the values
  See Also:
    `logSumNormalisation(double[], int, int, double[], int)`

### logSumNormalisation

    public static double logSumNormalisation(double[] d,
                                             int startD,
                                             int endD)

  The method does a log-sum-normalisation on the values of the array `d` between start index `startD` and end index `endD`, where the values of `d` are assumed to be logarithmised. Let and . Then after log-sum-normalisation, the part of the array `d` between start index `startD` and end index `endD` contains the normalized original values, i.e., is set to . The method returns the log-sum of the values, .

  Parameters:
    `d` - the array with the logarithms of the values that should be normalised
    `startD` - the first index in `d` considered for the log-sum-normalisation
    `endD` - the index after the last index in `d` considered for the log-sum-normalisation
  Returns:
    the logarithm of the sum of the values between `startD` and `endD`
  See Also:
    `logSumNormalisation(double[], int, int, double[], int)`

### logSumNormalisation

    public static double logSumNormalisation(double[] d,
                                             int startD,
                                             int endD,
                                             double[] secondValues)

  The method does a log-sum-normalisation on the values of the array `d` between start index `startD` and end index `endD`, where the values of `d` are assumed to be logarithmised. In addition to `d` another array of values `secondValues` is considered for the normalization constant, but not normalized itself. Let and . Then after log-sum-normalisation, the part of the array `d` starting at index `startD` contains the normalized original values, i.e., is set to . The method returns the log-sum of the values, . The method overwrites the values of `d` starting at position `startD`!. `secondValues` will be changed during log-sum-normalisation and will not be written to `d`.

  Parameters:
    `d` - the array with the logarithmised values that should be normalised
    `startD` - the first index in `d` considered for the log-sum-normalisation
    `endD` - the index after the last index in `d` considered for the log-sum-normalisation
    `secondValues` - second array with additional values, the whole array is considered for the log-sum-normalisation
  Returns:
    the logarithm of the sum of the values of `d` between `startD` and `endD` and the values of `secondValue`

### logSumNormalisation

    public static double logSumNormalisation(double[] d,
                                             int startD,
                                             int endD,
                                             double[] dest,
                                             int startDest)

  The method does a log-sum-normalisation on the values of the array `d` between start index `startD` and end index `endD`, where the values of `d` are assumed to be logarithmised. Let and . Then after log-sum-normalisation, the part of the array `dest` starting at index `startDest` contains the normalized original values, i.e., is set to where . The method returns the log-sum of the values, . The method writes the result of `d` in `dest` starting at position `startDest` while `d` remains unchanged. `secondValues` will be changed during log-sum-normalisation and will not be written to `dest`.

  Parameters:
    `d` - the array with the logarithmised values that should be normalised
    `startD` - the first index in `d` considered for the log-sum-normalisation
    `endD` - the index after the last index in `d` considered for the log-sum-normalisation
    `dest` - the destination array for the normalised values
    `startDest` - the start index of the destination array
  Returns:
    the logarithm of the sum of the values of `d` between `startD` and `endD`

### logSumNormalisation

    public static double logSumNormalisation(double[] d,
                                             int startD,
                                             int endD,
                                             double[] secondValues,
                                             double[] dest,
                                             int startDest)

  The method does a log-sum-normalisation on the values of the array `d` between start index `startD` and end index `endD`, where the values of `d` are assumed to be logarithmised. In addition to `d` another array of values `secondValues` is considered for the normalization constant, but not normalized itself. Let and . Then after log-sum-normalisation, the part of the array `dest` starting at index `startDest` contains the normalized original values, i.e., is set to where . The method returns the log-sum of the values, . The method writes the result of `d` in `dest` starting at position `startDest` while `d` remains unchanged. `secondValues` will be changed during log-sum-normalisation and will not be written to `dest`.

  Parameters:
    `d` - the array with the logarithmised values that should be normalised
    `startD` - the first index in `d` considered for the log-sum-normalisation
    `endD` - the index after the last index in `d` considered for the log-sum-normalisation
    `secondValues` - second array with additional values, the whole array is considered for the log-sum-normalisation
    `dest` - the destination array for the normalised values
    `startDest` - the start index of the destination array
  Returns:
    the logarithm of the sum of the values of `d` between `startD` and `endD` and the values of `secondValue`

### logSumNormalisation

    public static double logSumNormalisation(double[] d,
                                             double offset)

  The method does a log-sum-normalisation on the array `d`, where the values of `d` are assumed to be logarithmised. Let and . Then after log-sum-normalisation, the array `d` contains the normalized original values, i.e., is set to . The method returns the log-sum of the values, .

  Parameters:
    `d` - the array with the logarithmised values that should be normalised
    `offset` - the offset on the log-values which is used to get more accurate results in the normalization. Typically, this is set to the maximum of the log-values.
  Returns:
    the logarithm of the sum of the values
  See Also:
    `logSumNormalisation(double[], int, int, double[], int)`

### logSumNormalisation

    public static double logSumNormalisation(double[] d,
                                             int startD,
                                             int endD,
                                             double offset,
                                             double[] dest,
                                             int startDest)

  The method does a log-sum-normalisation on the values of the array `d` between start index `startD` and end index `endD`, where the values of `d` are assumed to be logarithmised. Let and . Then after log-sum-normalisation, the part of the array `dest` starting at index `startDest` contains the normalized original values, i.e., is set to where . The method returns the log-sum of the values, . The method writes the result of `d` in `dest` starting at position `startDest` while `d` remains unchanged. `secondValues` will be changed during log-sum-normalisation and will not be written to `dest`.

  Parameters:
    `d` - the array with the logarithmised values that should be normalised
    `startD` - the first index in `d` considered for the log-sum-normalisation
    `endD` - the index after the last index in `d` considered for the log-sum-normalisation
    `offset` - the offset on the log-values which is used to get more accurate results in the normalization. Typically, this is set to the maximum of the log-values.
    `dest` - the destination array for the normalised values
    `startDest` - the start index of the destination array
  Returns:
    the logarithm of the sum of the values of `d` between `startD` and `endD`

### logSumNormalisation

    public static double logSumNormalisation(double[] d,
                                             int startD,
                                             int endD,
                                             double offset,
                                             double[] secondValues,
                                             double[] dest,
                                             int startDest)

  The method does a log-sum-normalisation on the values of the array `d` between start index `startD` and end index `endD`, where the values of `d` are assumed to be logarithmised. In addition to `d` another array of values `secondValues` is considered for the normalization constant, but not normalized itself. Let and . Then after log-sum-normalisation, the part of the array `dest` starting at index `startDest` contains the normalized original values, i.e., is set to where . The method returns the log-sum of the values, . The method writes the result of `d` in `dest` starting at position `startDest` while `d` remains unchanged. `secondValues` will be changed during log-sum-normalisation and will not be written to `dest`.

  Parameters:
    `d` - the array with the logarithmised values that should be normalised
    `startD` - the first index in `d` considered for the log-sum-normalisation
    `endD` - the index after the last index in `d` considered for the log-sum-normalisation
    `offset` - the offset on the log-values which is used to get more accurate results in the normalization. Typically, this is set to the maximum of the log-values.
    `secondValues` - second array with additional values, the whole array is considered for the log-sum-normalisation
    `dest` - the destination array for the normalised values
    `startDest` - the start index of the destination array
  Returns:
    the logarithm of the sum of the values of `d` between `startD` and `endD` and the values of `secondValue`

### sumNormalisation

    public static double sumNormalisation(double[] d)

  The method does a sum-normalisation on `d`, i.e. divides all values in `d` by the sum over all values in `d` and returns the sum of the values.

  Parameters:
    `d` - the array with the values that should be normalised
  Returns:
    the sum of the values of `d`
  See Also:
    `sumNormalisation(double[], double[], int)`

### sumNormalisation

    public static double sumNormalisation(double[] d,
                                          double[] dest,
                                          int start)

  The method does a sum-normalisation on `d`, i.e. divides all values in `d` by the sum over all values in `d` and writes the result to `dest` starting at position `start` while `d` remains unchanged. The sum of the values of `d` will be returned.

  Parameters:
    `d` - the array with the values that should be normalised
    `dest` - the destination array for the normalised values
    `start` - the start index of the destination array
  Returns:
    the sum of the values of `d`

### normalisation

    public static void normalisation(double[] d,
                                     double v)

  The method does a normalisation on `d` using the value `v` for normalisation.

  Parameters:
    `d` - the array with the values that should be normalised
    `v` - the value for the normalisation
  See Also:
    `normalisation(double[], double, double[], int)`

### normalisation

    public static void normalisation(double[] d,
                                     double v,
                                     double[] dest,
                                     int start)

  The method does a normalisation on `d` writing the result to `dest` starting at position `start` while `d` remains unchanged. The value `v` is used for the normalisation.

  Parameters:
    `d` - the array with the values that should be normalised
    `v` - the value for normalisation
    `dest` - the destination array for the normalised values
    `start` - the start index of the destination array

### normalisation

    public static void normalisation(double[] d,
                                     double v,
                                     int start,
                                     int end)

  The method does a sum normalisation on `d` between start index `start` and end index `end` using the value `v` for the normalisation.

  Parameters:
    `d` - the array with the values that should be normalised
    `v` - the value for normalisation
    `start` - the first index in `d` considered for the log-sum-normalisation
    `end` - the index after the last index in `d` considered for the log-sum-normalisation

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD