Statistics
jhplot.stat

Class Statistics



  • public class Statisticsextends Object
    A static class for statistical calculations.
    • Constructor Summary

      Constructors 
      Constructor and Description
      Statistics() 
    • Method Summary

      Methods 
      Modifier and TypeMethod and Description
      static double[][]correlation(double[][] v)
      Correlation
      static double[][]correlation(double[][] v1, double[][] v2)
      Correlation coefficient, covariance(v1, v2) / Math.sqrt(variance(v1) * variance(v2)
      static doublecorrelation(double[] v1, double[] v2)
      Correlation coefficient, covariance(v1, v2) / Math.sqrt(variance(v1) * variance(v2)
      static double[][]covariance(double[][] v)
      Covariance
      static double[][]covariance(double[][] v1, double[][] v2)
      Covariance
      static doublecovariance(double[] v1, double[] v2)
      Covariance
      voiddoc()
      Show online documentation.
      static doubleFProbability(double F, int df1, int df2)
      Computes probability of F-ratio.
      static doublegamma(double x)
      Returns the Gamma function of the argument.
      static doubleincompleteBeta(double aa, double bb, double xx)
      Returns the Incomplete Beta Function evaluated from zero to xx.
      static doubleincompleteBetaFraction1(double a, double b, double x)
      Continued fraction expansion #1 for incomplete beta integral.
      static doubleincompleteBetaFraction2(double a, double b, double x)
      Continued fraction expansion #2 for incomplete beta integral.
      static doublelnGamma(double x)
      Returns natural logarithm of gamma function.
      static doublemean(double[] v)
      Get mean value
      static double[]mean(double[][] v)
      Get mean
      static doublep1evl(double x, double[] coef, int N)
      Evaluates the given polynomial of degree N at x.
      static doublepolevl(double x, double[] coef, int N)
      Evaluates the given polynomial of degree N at x.
      static doublepowerSeries(double a, double b, double x)
      Power series for incomplete beta integral.
      static doublestddeviation(double[] v)
      Standard deviation
      static double[]stddeviation(double[][] v)
      Standard deviation
      static doublestirlingFormula(double x)
      Returns the Gamma function computed by Stirling's formula.
      static doublevariance(double[] v)
      Variance
      static double[]variance(double[][] v)
      Variance
    • Constructor Detail

      • Statistics

        public Statistics()
    • Method Detail

      • mean

        public static double mean(double[] v)
        Get mean value
        Parameters:
        v - vector
      • mean

        public static double[] mean(double[][] v)
        Get mean
        Parameters:
        v - 2D array
        Returns:
      • stddeviation

        public static double stddeviation(double[] v)
        Standard deviation
        Parameters:
        v - vector
        Returns:
      • variance

        public static double variance(double[] v)
        Variance
        Parameters:
        v -
        Returns:
        vector
      • stddeviation

        public static double[] stddeviation(double[][] v)
        Standard deviation
        Parameters:
        v -
        Returns:
      • variance

        public static double[] variance(double[][] v)
        Variance
        Parameters:
        v - vector
        Returns:
      • covariance

        public static double covariance(double[] v1,                double[] v2)
        Covariance
        Parameters:
        v1 - first vector
        v2 - second vector
        Returns:
      • covariance

        public static double[][] covariance(double[][] v1,                    double[][] v2)
        Covariance
        Parameters:
        v1 - first 2D array
        v2 - second 2D array
        Returns:
      • covariance

        public static double[][] covariance(double[][] v)
        Covariance
        Parameters:
        v -
        Returns:
      • correlation

        public static double correlation(double[] v1,                 double[] v2)
        Correlation coefficient, covariance(v1, v2) / Math.sqrt(variance(v1) * variance(v2)
        Parameters:
        v1 - first vector
        v2 - second vector
        Returns:
      • correlation

        public static double[][] correlation(double[][] v1,                     double[][] v2)
        Correlation coefficient, covariance(v1, v2) / Math.sqrt(variance(v1) * variance(v2)
        Parameters:
        v1 - first vector
        v2 - second vector
        Returns:
      • correlation

        public static double[][] correlation(double[][] v)
        Correlation
        Parameters:
        v -
        Returns:
      • FProbability

        public static double FProbability(double F,                  int df1,                  int df2)
        Computes probability of F-ratio.
        Parameters:
        F - the F-ratio
        df1 - the first number of degrees of freedom
        df2 - the second number of degrees of freedom
        Returns:
        the probability of the F-ratio.
      • incompleteBeta

        public static double incompleteBeta(double aa,                    double bb,                    double xx)
        Returns the Incomplete Beta Function evaluated from zero to xx.
        Parameters:
        aa - the alpha parameter of the beta distribution.
        bb - the beta parameter of the beta distribution.
        xx - the integration end point.
      • powerSeries

        public static double powerSeries(double a,                 double b,                 double x)
        Power series for incomplete beta integral. Use when b*x is small and x not too close to 1.
      • lnGamma

        public static double lnGamma(double x)
        Returns natural logarithm of gamma function.
        Parameters:
        x - the value
        Returns:
        natural logarithm of gamma function
      • p1evl

        public static double p1evl(double x,           double[] coef,           int N)
        Evaluates the given polynomial of degree N at x. Evaluates polynomial when coefficient of N is 1.0. Otherwise same as polevl().
                             2          N y  =  C  + C x + C x  +...+ C x        0    1     2          N  Coefficients are stored in reverse order:  coef[0] = C  , ..., coef[N] = C  .            N                   0 
        The function p1evl() assumes that coef[N] = 1.0 and is omitted from the array. Its calling arguments are otherwise the same as polevl().

        In the interest of speed, there are no checks for out of bounds arithmetic.

        Parameters:
        x - argument to the polynomial.
        coef - the coefficients of the polynomial.
        N - the degree of the polynomial.
      • gamma

        public static double gamma(double x)
        Returns the Gamma function of the argument.
      • stirlingFormula

        public static double stirlingFormula(double x)
        Returns the Gamma function computed by Stirling's formula. The polynomial STIR is valid for 33 <= x <= 172.
      • polevl

        public static double polevl(double x,            double[] coef,            int N)
        Evaluates the given polynomial of degree N at x.
                             2          N y  =  C  + C x + C x  +...+ C x        0    1     2          N  Coefficients are stored in reverse order:  coef[0] = C  , ..., coef[N] = C  .            N                   0 
        In the interest of speed, there are no checks for out of bounds arithmetic.
        Parameters:
        x - argument to the polynomial.
        coef - the coefficients of the polynomial.
        N - the degree of the polynomial.
      • incompleteBetaFraction1

        public static double incompleteBetaFraction1(double a,                             double b,                             double x)
        Continued fraction expansion #1 for incomplete beta integral.
      • incompleteBetaFraction2

        public static double incompleteBetaFraction2(double a,                             double b,                             double x)
        Continued fraction expansion #2 for incomplete beta integral.
      • doc

        public void doc()
        Show online documentation.

SCaVis 2.1 © jWork.ORG