org.eclipse.january.dataset

## Class Stats

- java.lang.Object
- - org.eclipse.january.dataset.Stats

-     public class Stats
      extends Object

  Statistics class TODO Where is mode? http://en.wikipedia.org/wiki/Mode_(statistics)

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `Stats()`

  - ### Method Summary

    All Methods Static Methods Concrete Methods Deprecated Methods
    Modifier and Type | Method and Description
    --- | ---
    `static Object` | `averageDeviation(Dataset a)`
    `static Dataset` | `covariance(Dataset a)` See `covariance(Dataset a, Dataset b, boolean rowvar, boolean bias, Integer ddof)` with b = null, rowvar = true, bias = false and ddof = null.
    `static Dataset` | `covariance(Dataset a, boolean rowvar, boolean bias, Integer ddof)` See `covariance(Dataset a, Dataset b, boolean rowvar, boolean bias, Integer ddof)` with b = null.
    `static Dataset` | `covariance(Dataset a, Dataset b)` See `covariance(Dataset a, Dataset b, boolean rowvar, boolean bias, Integer ddof)` with b = null, rowvar = true, bias = false and ddof = null
    `static Dataset` | `covariance(Dataset a, Dataset b, boolean rowvar, boolean bias, Integer ddof)` Calculate the covariance matrix (array) of a concatenated with b.
    `static Dataset` | `cumulativeProduct(Dataset a, boolean... ignoreInvalids)`
    `static Dataset` | `cumulativeProduct(Dataset a, int axis, boolean... ignoreInvalids)`
    `static Dataset` | `cumulativeSum(Dataset a, boolean... ignoreInvalids)`
    `static Dataset` | `cumulativeSum(Dataset a, int axis, boolean... ignoreInvalids)`
    `static Object` | `iqr(Dataset a)` Interquartile range: Q3 - Q1
    `static Dataset` | `iqr(Dataset a, int axis)` Interquartile range: Q3 - Q1
    `static Object` | `kurtosis(Dataset a, boolean... ignoreInvalids)`
    `static Dataset` | `kurtosis(Dataset a, int axis, boolean... ignoreInvalids)`
    `static Object` | `median(Dataset a)`
    `static Dataset` | `median(Dataset a, int axis)`
    `static double[]` | `outlierValues(Dataset a, Dataset mask, boolean value, double lo, double hi, int length)` Calculate approximate outlier values.
    `static double[]` | `outlierValues(Dataset a, double lo, double hi, int length)` Calculate approximate outlier values.
    `static Object` | `product(Dataset a, boolean... ignoreInvalids)`
    `static Dataset` | `product(Dataset a, int[] axes, boolean... ignoreInvalids)`
    `static Dataset` | `product(Dataset a, int axis, boolean... ignoreInvalids)`
    `static double[]` | `quantile(Dataset a, double... values)` Calculate quantiles of dataset which is defined as the inverse of the cumulative distribution function (CDF)
    `static double` | `quantile(Dataset a, double q)` Calculate quantile of dataset which is defined as the inverse of the cumulative distribution function (CDF)
    `static Dataset[]` | `quantile(Dataset a, int axis, double... values)` Calculate quantiles of dataset which is defined as the inverse of the cumulative distribution function (CDF)
    `static double` | `residual(Dataset a, Dataset b)` The residual is the sum of squared differences
    `static Object` | `skewness(Dataset a, boolean... ignoreInvalids)`
    `static Dataset` | `skewness(Dataset a, int axis, boolean... ignoreInvalids)`
    `static Object` | `sum(Dataset a, boolean... ignoreInvalids)`
    `static Object` | `typedProduct(Class<? extends Dataset> clazz, Dataset a, boolean... ignoreInvalids)`
    `static <T extends Dataset> T` | `typedProduct(Class<T> clazz, Dataset a, int[] axes, boolean... ignoreInvalids)`
    `static <T extends Dataset> T` | `typedProduct(Class<T> clazz, Dataset a, int axis, boolean... ignoreInvalids)`
    `static Object` | `typedProduct(Dataset a, int dtype, boolean... ignoreInvalids)` Deprecated. Please use the class-based method `typedProduct(Class, Dataset, boolean...)`
    `static Dataset` | `typedProduct(Dataset a, int dtype, int[] axes, boolean... ignoreInvalids)` Deprecated. Please use the class-based method `typedProduct(Class, Dataset, int[], boolean...)`
    `static Dataset` | `typedProduct(Dataset a, int dtype, int axis, boolean... ignoreInvalids)` Deprecated. Please use the class-based method `typedProduct(Class, Dataset, int, boolean...)`
    `static Object` | `typedSum(Class<? extends Dataset> clazz, Dataset a, boolean... ignoreInvalids)`
    `static <T extends Dataset> T` | `typedSum(Class<T> clazz, Dataset a, int[] axes, boolean... ignoreInvalids)`
    `static <T extends Dataset> T` | `typedSum(Class<T> clazz, Dataset a, int axis, boolean... ignoreInvalids)`
    `static Object` | `typedSum(Dataset a, int dtype, boolean... ignoreInvalids)` Deprecated. Please use the class-based method `typedSum(Class, Dataset, boolean...)`
    `static Dataset` | `typedSum(Dataset a, int dtype, int axis, boolean... ignoreInvalids)` Deprecated. Please use the class-based method `typedSum(Class, Dataset, int, boolean...)`
    `static double` | `weightedResidual(Dataset a, Dataset b, Dataset w)` The residual is the sum of squared differences

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### Stats

          public Stats()

  - ### Method Detail

    - #### quantile

          public static double quantile(Dataset a,
                                        double q)

      Calculate quantile of dataset which is defined as the inverse of the cumulative distribution function (CDF)
      Parameters:
        `a` - dataset
        `q` - quantile
      Returns:
        point at which CDF has value q

    - #### quantile

          public static double[] quantile(Dataset a,
                                          double... values)

      Calculate quantiles of dataset which is defined as the inverse of the cumulative distribution function (CDF)
      Parameters:
        `a` - dataset
        `values` - quantiles
      Returns:
        points at which CDF has given values

    - #### quantile

          public static Dataset[] quantile(Dataset a,
                                           int axis,
                                           double... values)

      Calculate quantiles of dataset which is defined as the inverse of the cumulative distribution function (CDF)
      Parameters:
        `a` - dataset
        `axis` - to reduce along
        `values` - quantiles
      Returns:
        points at which CDF has given values

    - #### median

          public static Dataset median(Dataset a,
                                       int axis)

      Parameters:
        `a` - dataset
        `axis` - to reduce along
      Returns:
        median

    - #### median

          public static Object median(Dataset a)

      Parameters:
        `a` - dataset
      Returns:
        median

    - #### iqr

          public static Object iqr(Dataset a)

      Interquartile range: Q3 - Q1
      Parameters:
        `a` - dataset
      Returns:
        range

    - #### iqr

          public static Dataset iqr(Dataset a,
                                    int axis)

      Interquartile range: Q3 - Q1
      Parameters:
        `a` - dataset
        `axis` - to reduce along
      Returns:
        range

    - #### skewness

          public static Object skewness(Dataset a,
                                        boolean... ignoreInvalids)

      Parameters:
        `a` - dataset
        `ignoreInvalids` - see `IDataset.max(boolean...)`
      Returns:
        skewness
      Since:
        2.0

    - #### kurtosis

          public static Object kurtosis(Dataset a,
                                        boolean... ignoreInvalids)

      Parameters:
        `a` - dataset
        `ignoreInvalids` - see `IDataset.max(boolean...)`
      Returns:
        kurtosis
      Since:
        2.0

    - #### skewness

          public static Dataset skewness(Dataset a,
                                         int axis,
                                         boolean... ignoreInvalids)

      Parameters:
        `a` - dataset
        `axis` - to reduce along
        `ignoreInvalids` - see `Dataset.max(int, boolean...)`
      Returns:
        skewness along axis in dataset
      Since:
        2.0

    - #### kurtosis

          public static Dataset kurtosis(Dataset a,
                                         int axis,
                                         boolean... ignoreInvalids)

      Parameters:
        `a` - dataset
        `axis` - to reduce along
        `ignoreInvalids` - see `Dataset.max(int, boolean...)`
      Returns:
        kurtosis along axis in dataset
      Since:
        2.0

    - #### sum

          public static Object sum(Dataset a,
                                   boolean... ignoreInvalids)

      Parameters:
        `a` - dataset
        `ignoreInvalids` - see `IDataset.max(boolean...)`
      Returns:
        sum of dataset
      Since:
        2.0

    - #### typedSum

          public static Object typedSum(Class<? extends Dataset> clazz,
                                        Dataset a,
                                        boolean... ignoreInvalids)

      Parameters:
        `clazz` - dataset class
        `a` - dataset
        `ignoreInvalids` - see `IDataset.max(boolean...)`
      Returns:
        typed sum of dataset
      Since:
        2.3

    - #### typedSum

          @Deprecated
          public static Object typedSum(Dataset a,
                                                    int dtype,
                                                    boolean... ignoreInvalids)

      Deprecated. Please use the class-based method `typedSum(Class, Dataset, boolean...)`
      Parameters:
        `a` - dataset
        `dtype` - dataset type
        `ignoreInvalids` - see `IDataset.max(boolean...)`
      Returns:
        typed sum of dataset
      Since:
        2.0

    - #### typedSum

          public static <T extends Dataset> T typedSum(Class<T> clazz,
                                                       Dataset a,
                                                       int axis,
                                                       boolean... ignoreInvalids)

      Type Parameters:
        `T` - dataset sub-interface
      Parameters:
        `clazz` - dataset sub-interface
        `a` - dataset
        `axis` - to reduce along
        `ignoreInvalids` - see `Dataset.max(int, boolean...)`
      Returns:
        typed sum of items along axis in dataset
      Since:
        2.3

    - #### typedSum

          public static <T extends Dataset> T typedSum(Class<T> clazz,
                                                       Dataset a,
                                                       int[] axes,
                                                       boolean... ignoreInvalids)

      Type Parameters:
        `T` - dataset sub-interface
      Parameters:
        `clazz` - dataset sub-interface
        `a` - dataset
        `axes` - to reduce over
        `ignoreInvalids` - see `Dataset.max(int, boolean...)`
      Returns:
        typed sum of items along axes in dataset
      Since:
        2.3

    - #### typedSum

          @Deprecated
          public static Dataset typedSum(Dataset a,
                                                     int dtype,
                                                     int axis,
                                                     boolean... ignoreInvalids)

      Deprecated. Please use the class-based method `typedSum(Class, Dataset, int, boolean...)`
      Parameters:
        `a` - dataset
        `dtype` - dataset type
        `axis` - to reduce along
        `ignoreInvalids` - see `Dataset.max(int, boolean...)`
      Returns:
        typed sum of items along axis in dataset
      Since:
        2.0

    - #### product

          public static Object product(Dataset a,
                                       boolean... ignoreInvalids)

      Parameters:
        `a` - dataset
        `ignoreInvalids` - see `IDataset.max(boolean...)`
      Returns:
        product of all items in dataset
      Since:
        2.0

    - #### product

          public static Dataset product(Dataset a,
                                        int axis,
                                        boolean... ignoreInvalids)

      Parameters:
        `a` - dataset
        `axis` - to reduce along
        `ignoreInvalids` - see `Dataset.max(int, boolean...)`
      Returns:
        product of items along axis in dataset
      Since:
        2.0

    - #### product

          public static Dataset product(Dataset a,
                                        int[] axes,
                                        boolean... ignoreInvalids)

      Parameters:
        `a` - dataset
        `axes` - to reduce over
        `ignoreInvalids` - see `Dataset.max(int, boolean...)`
      Returns:
        product of items along axes in dataset
      Since:
        2.2

    - #### typedProduct

          @Deprecated
          public static Object typedProduct(Dataset a,
                                                        int dtype,
                                                        boolean... ignoreInvalids)

      Deprecated. Please use the class-based method `typedProduct(Class, Dataset, boolean...)`
      Parameters:
        `a` - dataset
        `dtype` - dataset type
        `ignoreInvalids` - see `IDataset.max(boolean...)`
      Returns:
        typed product of all items in dataset
      Since:
        2.0

    - #### typedProduct

          public static Object typedProduct(Class<? extends Dataset> clazz,
                                            Dataset a,
                                            boolean... ignoreInvalids)

      Parameters:
        `clazz` - dataset class
        `a` - dataset
        `ignoreInvalids` - see `IDataset.max(boolean...)`
      Returns:
        typed product of all items in dataset
      Since:
        2.3

    - #### typedProduct

          @Deprecated
          public static Dataset typedProduct(Dataset a,
                                                         int dtype,
                                                         int[] axes,
                                                         boolean... ignoreInvalids)

      Deprecated. Please use the class-based method `typedProduct(Class, Dataset, int[], boolean...)`
      Parameters:
        `a` - dataset
        `dtype` - dataset type
        `axes` - to reduce over
        `ignoreInvalids` - see `IDataset.max(boolean...)`
      Returns:
        typed product of items in axes of dataset
      Since:
        2.2

    - #### typedProduct

          @Deprecated
          public static Dataset typedProduct(Dataset a,
                                                         int dtype,
                                                         int axis,
                                                         boolean... ignoreInvalids)

      Deprecated. Please use the class-based method `typedProduct(Class, Dataset, int, boolean...)`
      Parameters:
        `a` - dataset
        `dtype` - dataset type
        `axis` - to reduce along
        `ignoreInvalids` - see `IDataset.max(boolean...)`
      Returns:
        typed product of items along axis in dataset
      Since:
        2.0

    - #### typedProduct

          public static <T extends Dataset> T typedProduct(Class<T> clazz,
                                                           Dataset a,
                                                           int axis,
                                                           boolean... ignoreInvalids)

      Type Parameters:
        `T` - dataset sub-interface
      Parameters:
        `clazz` - dataset sub-interface
        `a` - dataset
        `axis` - to reduce along
        `ignoreInvalids` - see `IDataset.max(boolean...)`
      Returns:
        typed product of items along axis in dataset
      Since:
        2.3

    - #### typedProduct

          public static <T extends Dataset> T typedProduct(Class<T> clazz,
                                                           Dataset a,
                                                           int[] axes,
                                                           boolean... ignoreInvalids)

      Type Parameters:
        `T` - dataset sub-interface
      Parameters:
        `clazz` - dataset sub-interface
        `a` - dataset
        `axes` - to reduce over
        `ignoreInvalids` - see `IDataset.max(boolean...)`
      Returns:
        typed product of items in axes of dataset
      Since:
        2.3

    - #### cumulativeProduct

          public static Dataset cumulativeProduct(Dataset a,
                                                  boolean... ignoreInvalids)

      Parameters:
        `a` - dataset
        `ignoreInvalids` - see `IDataset.max(boolean...)`
      Returns:
        cumulative product of items in flattened dataset
      Since:
        2.0

    - #### cumulativeProduct

          public static Dataset cumulativeProduct(Dataset a,
                                                  int axis,
                                                  boolean... ignoreInvalids)

      Parameters:
        `a` - dataset
        `axis` - to reduce along
        `ignoreInvalids` - see `Dataset.max(int, boolean...)`
      Returns:
        cumulative product of items along axis in dataset
      Since:
        2.0

    - #### cumulativeSum

          public static Dataset cumulativeSum(Dataset a,
                                              boolean... ignoreInvalids)

      Parameters:
        `a` - dataset
        `ignoreInvalids` - see `IDataset.max(boolean...)`
      Returns:
        cumulative sum of items in flattened dataset
      Since:
        2.0

    - #### cumulativeSum

          public static Dataset cumulativeSum(Dataset a,
                                              int axis,
                                              boolean... ignoreInvalids)

      Parameters:
        `a` - dataset
        `axis` - to reduce along
        `ignoreInvalids` - see `Dataset.max(int, boolean...)`
      Returns:
        cumulative sum of items along axis in dataset
      Since:
        2.0

    - #### averageDeviation

          public static Object averageDeviation(Dataset a)

      Parameters:
        `a` - dataset
      Returns:
        average deviation value of all items the dataset

    - #### residual

          public static double residual(Dataset a,
                                        Dataset b)

      The residual is the sum of squared differences
      Parameters:
        `a` - first dataset
        `b` - second dataset
      Returns:
        residual value

    - #### weightedResidual

          public static double weightedResidual(Dataset a,
                                                Dataset b,
                                                Dataset w)

      The residual is the sum of squared differences
      Parameters:
        `a` - first dataset
        `b` - second dataset
        `w` - weight dataset
      Returns:
        residual value

    - #### outlierValues

          public static double[] outlierValues(Dataset a,
                                               double lo,
                                               double hi,
                                               int length)

      Calculate approximate outlier values. These are defined as the values in the dataset that are approximately below and above the given thresholds - in terms of percentages of dataset size.

      It approximates by limiting the number of items (given by length) used internally by data structures - the larger this is, the more accurate will those outlier values become. The actual thresholds used are returned in the array.

      Also, the low and high values will be made distinct if possible by adjusting the thresholds

      Parameters:
        `a` - dataset
        `lo` - percentage threshold for lower limit
        `hi` - percentage threshold for higher limit
        `length` - maximum number of items used internally, if negative, then unlimited
      Returns:
        double array with low and high values, and low and high percentage thresholds

    - #### outlierValues

          public static double[] outlierValues(Dataset a,
                                               Dataset mask,
                                               boolean value,
                                               double lo,
                                               double hi,
                                               int length)

      Calculate approximate outlier values. These are defined as the values in the dataset that are approximately below and above the given thresholds - in terms of percentages of dataset size.

      It approximates by limiting the number of items (given by length) used internally by data structures - the larger this is, the more accurate will those outlier values become. The actual thresholds used are returned in the array.

      Also, the low and high values will be made distinct if possible by adjusting the thresholds

      Parameters:
        `a` - dataset
        `mask` - can be null
        `value` - value of mask to match to include for calculation
        `lo` - percentage threshold for lower limit
        `hi` - percentage threshold for higher limit
        `length` - maximum number of items used internally, if negative, then unlimited
      Returns:
        double array with low and high values, and low and high percentage thresholds
      Since:
        2.1

    - #### covariance

          public static Dataset covariance(Dataset a)

      See `covariance(Dataset a, Dataset b, boolean rowvar, boolean bias, Integer ddof)` with b = null, rowvar = true, bias = false and ddof = null.
      Parameters:
        `a` - dataset containing multiple variable and observations. Each row represents a variable, each column an observation.
      Returns:
        covariance array of a

    - #### covariance

          public static Dataset covariance(Dataset a,
                                           boolean rowvar,
                                           boolean bias,
                                           Integer ddof)

      See `covariance(Dataset a, Dataset b, boolean rowvar, boolean bias, Integer ddof)` with b = null.
      Parameters:
        `a` - dataset containing multiple variable and observations. Each row represents a variable, each column an observation.
        `rowvar` - When true (default), each row is a variable; when false each column is a variable.
        `bias` - Default normalisation is (N - 1) - N is number of observations. If set true, normalisation is (N).
        `ddof` - Default normalisation is (N - 1). If ddof is set, then normalisation is (N - ddof).
      Returns:
        covariance array of a
      Since:
        2.0

    - #### covariance

          public static Dataset covariance(Dataset a,
                                           Dataset b)

      See `covariance(Dataset a, Dataset b, boolean rowvar, boolean bias, Integer ddof)` with b = null, rowvar = true, bias = false and ddof = null
      Parameters:
        `a` - dataset containing multiple variable and observations. Each row represents a variable, each column an observation.
        `b` - An extra set of variables and observations. Must be of same type as a and have a compatible shape.
      Returns:
        covariance array of a concatenated with b

    - #### covariance

          public static Dataset covariance(Dataset a,
                                           Dataset b,
                                           boolean rowvar,
                                           boolean bias,
                                           Integer ddof)

      Calculate the covariance matrix (array) of a concatenated with b. This method is directly based on the implementation in numpy (cov).
      Parameters:
        `a` - dataset containing multiple variable and observations. Each row represents a variable, each column an observation.
        `b` - An extra set of variables and observations. Must be of same type as a and have a compatible shape.
        `rowvar` - When true (default), each row is a variable; when false each column is a variable.
        `bias` - Default normalisation is (N - 1) - N is number of observations. If set true, normalisation is (N).
        `ddof` - Default normalisation is (N - 1). If ddof is set, then normalisation is (N - ddof).
      Returns:
        covariance array of a concatenated with b
      Since:
        2.0

Copyright © 2014–2022 Eclipse Foundation. All rights reserved.