Class DiscreteStatistics

java.lang.Object
pal.statistics.DiscreteStatistics

public class DiscreteStatistics extends Object
simple discrete statistics (mean, variance, cumulative probability, quantiles etc.)
Version:
$Id: DiscreteStatistics.java,v 1.5 2001/07/13 14:39:13 korbinian Exp $
Author:
Korbinian Strimmer
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static double
    cdf(double z, double[] x)
    compute the cumulative probability Pr(x <= z) for a given z and a distribution of x
    static double
    cdf(double z, double[] x, int[] indices)
    compute the cumulative probability Pr(x <= z) for a given z and a distribution of x
    static double
    mean(double[] x)
    compute mean
    static double
    quantile(double q, double[] x)
    compute the q-th quantile for a distribution of x (= inverse cdf)
    static double
    quantile(double q, double[] x, int[] indices)
    compute the q-th quantile for a distribution of x (= inverse cdf)
    static double
    skewness(double[] x)
    compute fisher skewness
    static double
    stdev(double[] x)
    compute standard deviation
    static double
    variance(double[] x)
    compute variance (ML estimator)
    static double
    variance(double[] x, double mean)
    compute variance (ML estimator)
    static double
    varianceSampleMean(double[] x)
    compute variance of sample mean (ML estimator)
    static double
    varianceSampleMean(double[] x, double mean)
    compute variance of sample mean (ML estimator)

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • DiscreteStatistics

      public DiscreteStatistics()
  • Method Details

    • mean

      public static double mean(double[] x)
      compute mean
      Parameters:
      x - list of numbers
      Returns:
      mean
    • variance

      public static double variance(double[] x, double mean)
      compute variance (ML estimator)
      Parameters:
      x - list of numbers
      mean - assumed mean of x
      Returns:
      variance of x (ML estimator)
    • skewness

      public static double skewness(double[] x)
      compute fisher skewness
      Parameters:
      x - list of numbers
      Returns:
      skewness of x
    • stdev

      public static double stdev(double[] x)
      compute standard deviation
      Parameters:
      x - list of numbers
      Returns:
      standard deviation of x
    • variance

      public static double variance(double[] x)
      compute variance (ML estimator)
      Parameters:
      x - list of numbers
      Returns:
      variance of x (ML estimator)
    • varianceSampleMean

      public static double varianceSampleMean(double[] x, double mean)
      compute variance of sample mean (ML estimator)
      Parameters:
      x - list of numbers
      mean - assumed mean of x
      Returns:
      variance of x (ML estimator)
    • varianceSampleMean

      public static double varianceSampleMean(double[] x)
      compute variance of sample mean (ML estimator)
      Parameters:
      x - list of numbers
      Returns:
      variance of x (ML estimator)
    • quantile

      public static double quantile(double q, double[] x, int[] indices)
      compute the q-th quantile for a distribution of x (= inverse cdf)
      Parameters:
      q - quantile (0 < q <= 1)
      x - discrete distribution (an unordered list of numbers)
      indices - index sorting x
      Returns:
      q-th quantile
    • quantile

      public static double quantile(double q, double[] x)
      compute the q-th quantile for a distribution of x (= inverse cdf)
      Parameters:
      q - quantile (0 <= q <= 1)
      x - discrete distribution (an unordered list of numbers)
      Returns:
      q-th quantile
    • cdf

      public static double cdf(double z, double[] x, int[] indices)
      compute the cumulative probability Pr(x <= z) for a given z and a distribution of x
      Parameters:
      z - threshold value
      x - discrete distribution (an unordered list of numbers)
      indices - index sorting x
      Returns:
      cumulative probability
    • cdf

      public static double cdf(double z, double[] x)
      compute the cumulative probability Pr(x <= z) for a given z and a distribution of x
      Parameters:
      z - threshold value
      x - discrete distribution (an unordered list of numbers)
      Returns:
      cumulative probability