OpenAPI 1.0

com.aquafold.openapi.math
Interface AQStat


public interface AQStat


Method Summary
 double[] ANOVA(double[][] x)
          Calculates one way ANOVA for incoming series of arrays [link]
 boolean ANOVATest(double[][] x, double significanceLevel)
          Performs one way ANOVA Test for incoming series of arrays [link]
 double[] bins(double[] x, int binNumber)
          Sorts incoming data into user defined number of uniformly spaced bins [link]
 double Chi2(double[] expected, long[] observed)
          Performs a Pearson's Chi2 test on incoming array.
 double[][] correlation(double[][] x)
          Calculates correlation matrix of incoming double precision MxN array.
 double correlation(double[] x, double[] y)
          Calculates the Pearson's correlation coefficient from 2 data sets, and the associated t-test and p-values.
 double[][] covariance(double[][] x)
          Calculates covariance matrix of incoming double precision MxN array [link]
 double covariance(double[] x, double[] y)
          Calculates the covariance coefficient from 2 data sets [link]
 double cumNormalDist(double z)
          Calculates value of cumulative normal distribution at z [link]
 double[][] frequency(double[] x)
          Calculates values to be displayed in frequency table.
 String frequencyTable(double[] x)
          Calculates frequency table for incoming array.
 double geometricMean(double[] in)
          Calculates geometric mean of incoming array.
 double harmonicMean(double[] in)
          Calculates harmonic mean of incoming array.
 double interquartilerange(double[] in)
          Calculates difference between 25th and 75th quartile of incoming array.
 double kruskalWallis(double[][] x)
          Performs Kruskal-Wallis one way ANOVA.
 double kurtosis(double[] in)
          Calculates kurtosis of incoming array.
 double[] mannWhitneyU(double[] x, double[] y)
          Performs Mann-Whitney U test.
 double max(double[] in)
          Calculates maximum value in incoming array.
 double mean(double[] in)
          Calculates the arithmetic mean of incoming array.
 double median(double[] in)
          Calculates median value in incoming array.
 double min(double[] in)
          Calculates minimum value in incoming array.
 double mode(double[] in)
          Calculates mode of incoming array.
 double pairedTTest(double[] x, double[] y)
          Performs a paired sample t-test of the null hypothesis that data in the vector x are a random sample from a normal distribution with mean 0 and unknown variance, against the alternative that the mean is not 0.
 double percentile(double[] in, double k)
          Calculates value of kth percentile of incoming array [link]
 double range(double[] in)
          Calculates range of incoming array.
 double rSquared(double[] x, double[] y)
          Calculates coefficient of determination (R2).
 double signedRank(double[] x, double M)
          Performs a signed rank test (Wilcoxon signed rank) of the null hypothesis that data in the vector x comes from a continuous, symmetric distribution with median M, against the alternative that the distribution does not have median M.
 double signedRank(double[] x, double[] y)
          Performs a paired, signed rank test (Wilcoxon signed rank) of the null hypothesis that data in the vector x-y come from a continuous, symmetric distribution with equal medians, against the alternative that the distribution does not have equal medians.
 double skew(double[] in)
          Calculates skew (symmetry) of incoming array.
 double spearman(double[] x, double[] y)
          Calculates the Spearman rank correlation coefficient from 2 data sets [link]
 double sse(double[] in)
          Calculates the sum squared error of incoming array.
 double std(double[] in)
          Calculates standard deviation of incoming array.
 double tTest(double[] x)
          Performs a single sample t-test of the null hypothesis that data in the vector x are a random sample from a normal distribution with mean 0 and unknown variance, against the alternative that the mean is not 0.
 double tTest(double[] x, double m)
          Performs a single sample t-test of the null hypothesis that data in the vector x are a random sample from a normal distribution with mean m and unknown variance, against the alternative that the mean is not m.
 double tTest(double[] x, double[] y)
          performs a t-test of the null hypothesis that data in the vectors x and y are independent random samples from normal distributions with equal means and equal but unknown variances, against the alternative that the means are not equal.
 double variance(double[] in)
          Calculates variance of incoming array.
 double[] zscore(double[] in)
          Calculates z-scores of incoming array.
 double ztest(double[] x, double mu, double sigma)
          Performs a z-test of the null hypothesis that data in the vector x are a random sample from a normal distribution with mean m and standard deviation sigma, against the alternative that the mean is not m.
 

Method Detail

mean

double mean(double[] in)
Calculates the arithmetic mean of incoming array. [link]

Parameters:
in - A double precision array.
Returns:
double precision value
Throws:
IllegalArgumentException - if the incoming array is empty

range

double range(double[] in)
Calculates range of incoming array. Differece between min and max values. [link]

Parameters:
in - a double precision array.
Returns:
double precision value
Throws:
IllegalArgumentException - if the incoming array is empty

std

double std(double[] in)
Calculates standard deviation of incoming array. Measures variability of incoming data. [link]

Parameters:
in - a double precision array.
Returns:
double precision value
Throws:
IllegalArgumentException - if the incoming array is empty

variance

double variance(double[] in)
Calculates variance of incoming array. Measures variability of incoming data. [link]

Parameters:
in - a double precision array.
Returns:
double precision value
Throws:
IllegalArgumentException - if the incoming array is empty

kurtosis

double kurtosis(double[] in)
Calculates kurtosis of incoming array. Degree to which data departs from a normal distribution, in terms of "peakedness." A normal distribution has kurtosis of 1. [link]

Parameters:
in - a double precision array.
Returns:
double precision value
Throws:
IllegalArgumentException - if the incoming array is empty

skew

double skew(double[] in)
Calculates skew (symmetry) of incoming array. Degree to which data is centered about the mean. [link]

Parameters:
in - a double precision array.
Returns:
double precision value
Throws:
IllegalArgumentException - if the incoming array is empty

median

double median(double[] in)
Calculates median value in incoming array. [link]

Parameters:
in - a double precision array.
Returns:
double precision value
Throws:
IllegalArgumentException - if the incoming array is empty

mode

double mode(double[] in)
Calculates mode of incoming array. Most commonly occurring value. [link]

Parameters:
in - a double precision array.
Returns:
double precision value
Throws:
IllegalArgumentException - if the incoming array is empty

max

double max(double[] in)
Calculates maximum value in incoming array.

Parameters:
in - a double precision array.
Returns:
double precision value
Throws:
IllegalArgumentException - if the incoming array is empty

min

double min(double[] in)
Calculates minimum value in incoming array.

Parameters:
in - a double precision array.
Returns:
double precision value
Throws:
IllegalArgumentException - if the incoming array is empty

sse

double sse(double[] in)
Calculates the sum squared error of incoming array. [link]

Parameters:
in - a double precision array.
Returns:
double precision value
Throws:
IllegalArgumentException - if the incoming array is empty

harmonicMean

double harmonicMean(double[] in)
Calculates harmonic mean of incoming array. The reciprocal of the average of the reciprocals of incoming data points. [link]

Parameters:
in - a double precision array.
Returns:
double precision value
Throws:
IllegalArgumentException - if the incoming array is empty

geometricMean

double geometricMean(double[] in)
Calculates geometric mean of incoming array. [link]

Parameters:
in - a double precision array.
Returns:
double precision value
Throws:
IllegalArgumentException - if the incoming array is empty

zscore

double[] zscore(double[] in)
Calculates z-scores of incoming array. Indicates number of standard deviations away from mean a value is. [link]

Parameters:
in - a double precision array.
Returns:
double precision array
Throws:
IllegalArgumentException - if the incoming array is empty

interquartilerange

double interquartilerange(double[] in)
Calculates difference between 25th and 75th quartile of incoming array. [link]

Parameters:
in - a double precision array.
Returns:
double precision value
Throws:
IllegalArgumentException - if the incoming array is empty

percentile

double percentile(double[] in,
                  double k)
Calculates value of kth percentile of incoming array [link]

Parameters:
in - a double precision array.
k - a double value between 0 and 100
Returns:
double precision value
Throws:
IllegalArgumentException - if the incoming array is empty

frequency

double[][] frequency(double[] x)
Calculates values to be displayed in frequency table. [link]

Parameters:
x - a double precision array.
Returns:
double precision array with 2 columns
  • out[0] = List of unique values in incoming array
  • out[1] = Number of occurrences of each unique value
Throws:
IllegalArgumentException - if the incoming array is empty

frequencyTable

String frequencyTable(double[] x)
Calculates frequency table for incoming array. [link]

Parameters:
x - a double precision array.
Returns:
String
  • List of unique values in incoming array
  • Number of occurrences of each unique value
  • Relative percentage of each unique value
  • Cumulative percentage of each unique value
Throws:
IllegalArgumentException - if the incoming array is empty

rSquared

double rSquared(double[] x,
                double[] y)
Calculates coefficient of determination (R2). Indicates proportion of variance of one variable that can be predicted from a second variable. [link]

tTest

double tTest(double[] x)
Performs a single sample t-test of the null hypothesis that data in the vector x are a random sample from a normal distribution with mean 0 and unknown variance, against the alternative that the mean is not 0. [link]

Parameters:
x - a double precision array.
Returns:
double precision value
Throws:
IllegalArgumentException - if the incoming array is empty

tTest

double tTest(double[] x,
             double m)
Performs a single sample t-test of the null hypothesis that data in the vector x are a random sample from a normal distribution with mean m and unknown variance, against the alternative that the mean is not m. I.e. T tests determine whether data sets are likely to have come from populations having the same mean, assuming normal distribution. [link]

Parameters:
x - a double precision array.
m - a double value
Returns:
double precision value
Throws:
IllegalArgumentException - if the incoming array is empty

pairedTTest

double pairedTTest(double[] x,
                   double[] y)
Performs a paired sample t-test of the null hypothesis that data in the vector x are a random sample from a normal distribution with mean 0 and unknown variance, against the alternative that the mean is not 0. [link]

Parameters:
x - a double precision array.
y - a double precision array
Returns:
double precision value
Throws:
IllegalArgumentException - if the incoming array is empty

tTest

double tTest(double[] x,
             double[] y)
performs a t-test of the null hypothesis that data in the vectors x and y are independent random samples from normal distributions with equal means and equal but unknown variances, against the alternative that the means are not equal. [link]

Parameters:
x - a double precision array.
y - a double precision array.
Returns:
double precision value
Throws:
IllegalArgumentException - if the incoming array is empty

ztest

double ztest(double[] x,
             double mu,
             double sigma)
Performs a z-test of the null hypothesis that data in the vector x are a random sample from a normal distribution with mean m and standard deviation sigma, against the alternative that the mean is not m. [link]

Parameters:
x - a double precision array.
mu - a double precision value
sigma - a double precision value
Returns:
double precision value
Throws:
IllegalArgumentException - if the incoming array is empty

signedRank

double signedRank(double[] x,
                  double M)
Performs a signed rank test (Wilcoxon signed rank) of the null hypothesis that data in the vector x comes from a continuous, symmetric distribution with median M, against the alternative that the distribution does not have median M. [link]

Parameters:
x - a double precision array.
M - a double precision value
Returns:
double precision value
Throws:
IllegalArgumentException - if the incoming array is empty

signedRank

double signedRank(double[] x,
                  double[] y)
Performs a paired, signed rank test (Wilcoxon signed rank) of the null hypothesis that data in the vector x-y come from a continuous, symmetric distribution with equal medians, against the alternative that the distribution does not have equal medians. [link]

Parameters:
x - a double precision array.
y - a double precision array.
Returns:
double precision value
Throws:
IllegalArgumentException - if the incoming array is empty

correlation

double correlation(double[] x,
                   double[] y)
Calculates the Pearson's correlation coefficient from 2 data sets, and the associated t-test and p-values. 1 indicates proportionality. -1 indicates negative proportionality. 0 indicates no correlation. [link]

Parameters:
x - a double precision array.
y - a double precision array.
Returns:
double precision value
Throws:
IllegalArgumentException - if the incoming array is empty

correlation

double[][] correlation(double[][] x)
Calculates correlation matrix of incoming double precision MxN array. [link]

Parameters:
x - an MxN double precision array.
  • columns = variables
  • rows = observations
Returns:
NxN double precision array
Throws:
IllegalArgumentException - if the incoming array is empty

covariance

double covariance(double[] x,
                  double[] y)
Calculates the covariance coefficient from 2 data sets [link]

Parameters:
x - a double precision array.
y - a double precision array.
Returns:
double precision value
Throws:
IllegalArgumentException - if the incoming array is empty

covariance

double[][] covariance(double[][] x)
Calculates covariance matrix of incoming double precision MxN array [link]

Parameters:
x - an MxN double precision array.
  • columns = variables
  • rows = observations
Returns:
NxN double precision array
Throws:
IllegalArgumentException - if the incoming array is empty

spearman

double spearman(double[] x,
                double[] y)
Calculates the Spearman rank correlation coefficient from 2 data sets [link]

Parameters:
x - a double precision array.
y - a double precision array.
Returns:
double precision value
Throws:
IllegalArgumentException - if the incoming array is empty

kruskalWallis

double kruskalWallis(double[][] x)
Performs Kruskal-Wallis one way ANOVA. Kruskal Wallis ANOVA is a non-parametric method for testing equality of population medians among groups. It is an extension of the Mann Whitney U test to 3 or more groups. [link]

Parameters:
x - an MxN double precision array, M data arrays of length N.
Returns:
double precision value
Throws:
IllegalArgumentException - if the incoming array is empty

ANOVA

double[] ANOVA(double[][] x)
Calculates one way ANOVA for incoming series of arrays [link]

Parameters:
x - a double precision array, M (number of data sets) X N (length of each set)
Returns:
double precision array

ANOVATest

boolean ANOVATest(double[][] x,
                  double significanceLevel)
Performs one way ANOVA Test for incoming series of arrays [link]

Parameters:
x - a double precision array, M (number of data sets) X N (length of each set)
significanceLevel - a double precision value (0Returns:
Boolean
  • False if no significant difference among means of incoming arrays (null hypothesis)

Chi2

double Chi2(double[] expected,
            long[] observed)
Performs a Pearson's Chi2 test on incoming array. Calcuates p-value. [link]

Parameters:
expected - a double precision array.
observed - a long array
Returns:
double precision value
Throws:
IllegalArgumentException - if the incoming array is empty

bins

double[] bins(double[] x,
              int binNumber)
Sorts incoming data into user defined number of uniformly spaced bins [link]

Parameters:
x - a double precision array.
binNumber - an integer
Returns:
double precision array
Throws:
IllegalArgumentException - if the incoming array is empty

mannWhitneyU

double[] mannWhitneyU(double[] x,
                      double[] y)
Performs Mann-Whitney U test. It's non-parametric test for assessing whether two independent samples of observations come from the same distribution. [link]

Parameters:
x - a double precision array.
y - a double precision array.
Returns:
2XN double precision array
  • U value
  • z value
Throws:
IllegalArgumentException - if the incoming array is empty

cumNormalDist

double cumNormalDist(double z)
Calculates value of cumulative normal distribution at z [link]

Parameters:
z - a double precision array.
Returns:
double precision value
Throws:
IllegalArgumentException - if the incoming array is empty

OpenAPI 1.0


Copyright © 2010 AquaFold, Inc. All Rights Reserved. Use is subject to license terms.