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

## org.statcato.statistics
Class BasicStatistics

    java.lang.Object
      org.statcato.statistics.BasicStatistics

    public class BasicStatistics

extends java.lang.Object

A collection of basic statistical functions.

Since:
  1.0
Version:
  %I%, %G%
Author:
  Margaret Yau

Constructor Summary
`BasicStatistics()`

Method Summary
`static java.util.Vector<java.lang.Double>` | `changeRange(java.util.Vector<java.lang.Double> numbers, double a, double b)` Adjusts a vector of numbers to fit in a specific range [a, b].
`static java.lang.Double` | `coefficientOfVariance(java.util.Vector<java.lang.Double> numbers)` Returns the coefficient of variance (standard deviation / mean * 100).
`static java.util.Vector<java.lang.Double>` | `customStandardize(java.util.Vector<java.lang.Double> numbers, double num1, double num2)` Standardizes a vector of numbers of subtracting one number and then dividing by another number for each number in the vector.
`static java.lang.Double` | `firstQuartile(java.util.Vector<java.lang.Double> numbers)` Returns the first quartile of a vector of numbers as a Double object.
`static java.lang.Double` | `interquartileRange(java.util.Vector<java.lang.Double> numbers)` Returns the interquartile range (third quartile - first quartile).
`static java.lang.Double` | `kurtosis(java.util.Vector<java.lang.Double> numbers)` Returns the unbiased kurtosis of a vector of numbers (centered at 0).
`static java.lang.Double` | `kurtosisBiased(java.util.Vector<java.lang.Double> numbers)` Returns the biased kurtosis of a vector of numbers (centered at 0).
`static java.lang.Double` | `kurtosisBiasedCentered3(java.util.Vector<java.lang.Double> numbers)` Returns the biased kurtosis of a vector of numbers (centered at 3).
`static java.lang.Double` | `kurtosisCentered3(java.util.Vector<java.lang.Double> numbers)` Returns the kurtosis of a vector of numbers (centered at 3)
`static int` | `max(int[] numbers)` Returns the maximum of an array of integers (assume array length > 0).
`static java.lang.Double` | `max(java.util.Vector<java.lang.Double> numbers)` Returns the maximum of a vector of doubles
`static java.lang.Double` | `mean(java.util.Vector<java.lang.Double> numbers)` Returns the mean of a vector of numbers.
`static java.lang.Double` | `median(java.util.Vector<java.lang.Double> numbers)` Returns the median of a vector of numbers.
`static int` | `min(int[] numbers)` Returns the minimum of an array of integers (assume array length > 0).
`static java.lang.Double` | `min(java.util.Vector<java.lang.Double> numbers)` Returns the minimum of a vector of numbers.
`static java.lang.Object[]` | `mode(java.util.Vector<java.lang.Double> numbers)` Finds the mode of a vector of numbers and returns a vector of the mode(s) along with the number of occurences for the mode(s).
`static java.lang.Double` | `moment(java.util.Vector<java.lang.Double> numbers, int k)` Returns the kth moment about the mean = sum[(x - mean)^k].
`static java.lang.Double` | `MSSD(java.util.Vector<java.lang.Double> numbers)` Returns the mean of successive squared differences (MSSD).
`static int` | `Nmissing(java.util.Vector<java.lang.Double> numbers)` Returns the number of missing numbers in the input vector.
`static int` | `Nnonmissing(java.util.Vector<java.lang.Double> numbers)` Returns the number of nonmissing numbers in the input vector.
`static int` | `Ntotal(java.util.Vector<java.lang.Double> numbers)` Returns the total number of numbers in the input vector.
`static int` | `numberOfNegativeSigns(java.util.Vector<java.lang.Double> values, double k)` Returns the number of the values in the given vector that are less than the given median.
`static int` | `numberOfPositiveSigns(java.util.Vector<java.lang.Double> values, double k)` Returns the number of the values in the given vector that are greater than the given median.
`static java.lang.Double` | `percentile(java.util.Vector<java.lang.Double> numbers, double i)` Returns the i'th percentile of a vector of numbers as a Double object.
`static java.lang.Double` | `range(java.util.Vector<java.lang.Double> numbers)` Returns the range of a vector of numbers.
`static java.util.Vector<java.lang.Double>` | `removeOutliers(java.util.Vector<java.lang.Double> values)` Removes the outliers from a vector of double values and returns a vector of the outliers.
`static double` | `RyanJoinerNormalityCV(int n, double significance)` Returns the critical value used in the Ryan-Joiner normality test.
`static java.lang.Double` | `SEmean(java.util.Vector<java.lang.Double> numbers)` Return the standard error of the mean (s/sqrt(n)) of a vector of numbers.
`static java.lang.Double` | `skewness(java.util.Vector<java.lang.Double> numbers)` Returns the unbiased skewness of a vector of numbers.
`static java.lang.Double` | `skewnessBiased(java.util.Vector<java.lang.Double> numbers)` Returns the biased skewness of a vector of numbers.
`static java.util.Vector<java.lang.Double>` | `standardize(java.util.Vector<java.lang.Double> numbers)` Standardizes a vector of numbers by subtracting the mean and then dividing by the standard deviation for each number in the vector.
`static java.lang.Double` | `stdev(java.util.Vector<java.lang.Double> numbers)` Returns the standard deviation of a vector of numbers.
`static double` | `sum(java.util.Vector<java.lang.Double> numbers)` Returns the sum of a vector of numbers.
`static double` | `sumOfSquares(java.util.Vector<java.lang.Double> numbers)` Returns the sum of squares of a vector of numbers.
`static java.lang.Double` | `thirdQuartile(java.util.Vector<java.lang.Double> numbers)` Returns the third quartile of a vector of numbers as a Double object.
`static java.lang.Double` | `trimmedMean(java.util.Vector<java.lang.Double> numbers, double percent)` Returns the trimmed mean of a vector doubles.
`static java.lang.Double` | `variance(java.util.Vector<java.lang.Double> numbers)` Returns the variance of a vector of numbers.

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

Constructor Detail

### BasicStatistics

    public BasicStatistics()

Method Detail

### customStandardize

    public static java.util.Vector<java.lang.Double> customStandardize(java.util.Vector<java.lang.Double> numbers,
                                                                       double num1,
                                                                       double num2)

  Standardizes a vector of numbers of subtracting one number and then dividing by another number for each number in the vector.

  Parameters:
    `numbers` - vector of doubles
    `num1` - double value to subtract from each number in the vector
    `num2` - double value by which each number in the vector is divided. Assumed to be non-zero.
  Returns:
    a vector of standardized double values

### standardize

    public static java.util.Vector<java.lang.Double> standardize(java.util.Vector<java.lang.Double> numbers)

  Standardizes a vector of numbers by subtracting the mean and then dividing by the standard deviation for each number in the vector.

  Parameters:
    `numbers` - a vector of double values
  Returns:
    vector of standardized double values

### changeRange

    public static java.util.Vector<java.lang.Double> changeRange(java.util.Vector<java.lang.Double> numbers,
                                                                 double a,
                                                                 double b)

  Adjusts a vector of numbers to fit in a specific range [a, b]. A number n is adjusted as a + (n - min)(b - a) / (max - min).

  Parameters:
    `numbers` - a vector of double values
    `a` - minimum value of the range
    `b` - maximum value of the range. Assumed greater than a.
  Returns:
    vector of double values with a range [a, b]

### Nnonmissing

    public static int Nnonmissing(java.util.Vector<java.lang.Double> numbers)

  Returns the number of nonmissing numbers in the input vector.

  Parameters:
    `numbers` - vector of doubles
  Returns:
    number of nonmissing numbers

### Nmissing

    public static int Nmissing(java.util.Vector<java.lang.Double> numbers)

  Returns the number of missing numbers in the input vector.

  Parameters:
    `numbers` - vector of doubles
  Returns:
    number of missing numbers

### Ntotal

    public static int Ntotal(java.util.Vector<java.lang.Double> numbers)

  Returns the total number of numbers in the input vector. Stops counting after the last nonmissing number in the vector.

  Parameters:
    `numbers` - vector of doubles
  Returns:
    total number of numbers in the vector

### mean

    public static java.lang.Double mean(java.util.Vector<java.lang.Double> numbers)

  Returns the mean of a vector of numbers.

  Parameters:
    `numbers` - vector of doubles
  Returns:
    mean of the numbers, or null if the vector is empty

### sum

    public static double sum(java.util.Vector<java.lang.Double> numbers)

  Returns the sum of a vector of numbers.

  Parameters:
    `numbers` - vector of doubles
  Returns:
    sum

### stdev

    public static java.lang.Double stdev(java.util.Vector<java.lang.Double> numbers)

  Returns the standard deviation of a vector of numbers.

  Parameters:
    `numbers` - vector of doubles
  Returns:
    standard deviation, or null if the vector has less than two numbers

### variance

    public static java.lang.Double variance(java.util.Vector<java.lang.Double> numbers)

  Returns the variance of a vector of numbers.

  Parameters:
    `numbers` -
  Returns:
    variance, or null if the vector has less than two numbers

### moment

    public static java.lang.Double moment(java.util.Vector<java.lang.Double> numbers,
                                          int k)

  Returns the kth moment about the mean = sum[(x - mean)^k].

  Parameters:
    `numbers` - vector of doubles
    `k` - order
  Returns:
    kth moment

### min

    public static java.lang.Double min(java.util.Vector<java.lang.Double> numbers)

  Returns the minimum of a vector of numbers.

  Parameters:
    `numbers` - vector of doubles
  Returns:
    minimum value, or null if the vector is empty

### min

    public static int min(int[] numbers)

  Returns the minimum of an array of integers (assume array length > 0).

  Parameters:
    `numbers` - array of integers, assumed non-empty
  Returns:
    minimum

### max

    public static java.lang.Double max(java.util.Vector<java.lang.Double> numbers)

  Returns the maximum of a vector of doubles

  Parameters:
    `numbers` - vector of doubles
  Returns:
    maximum value, or null if the vector is empty

### max

    public static int max(int[] numbers)

  Returns the maximum of an array of integers (assume array length > 0).

  Parameters:
    `numbers` - array of integers, assumed non-empty
  Returns:
    maximum

### range

    public static java.lang.Double range(java.util.Vector<java.lang.Double> numbers)

  Returns the range of a vector of numbers.

  Parameters:
    `numbers` - vector of doubles
  Returns:
    range, or null if the vector is empty

### median

    public static java.lang.Double median(java.util.Vector<java.lang.Double> numbers)

  Returns the median of a vector of numbers.

  Parameters:
    `numbers` - vector of doubles
  Returns:
    median, or null if the vector is empty

### sumOfSquares

    public static double sumOfSquares(java.util.Vector<java.lang.Double> numbers)

  Returns the sum of squares of a vector of numbers.

  Parameters:
    `numbers` - vector of number
  Returns:
    sum of squares

### SEmean

    public static java.lang.Double SEmean(java.util.Vector<java.lang.Double> numbers)

  Return the standard error of the mean (s/sqrt(n)) of a vector of numbers.

  Parameters:
    `numbers` - vector of doubles
  Returns:
    standard error of the mean, or null if the vector has less than two numbers

### coefficientOfVariance

    public static java.lang.Double coefficientOfVariance(java.util.Vector<java.lang.Double> numbers)

  Returns the coefficient of variance (standard deviation / mean * 100).

  Parameters:
    `numbers` - vector of number
  Returns:
    coefficient of variance, or null if the vector has less than two numbers

### firstQuartile

    public static java.lang.Double firstQuartile(java.util.Vector<java.lang.Double> numbers)

  Returns the first quartile of a vector of numbers as a Double object. Returns null if the first quartile is undefined

  Parameters:
    `numbers` - vector of numbers
  Returns:
    first quartile, or null if it is undefined

### thirdQuartile

    public static java.lang.Double thirdQuartile(java.util.Vector<java.lang.Double> numbers)

  Returns the third quartile of a vector of numbers as a Double object. Returns null if the third quartile is undefined

  Parameters:
    `numbers` - vector of numbers
  Returns:
    third quartile, or null if it is undefined

### percentile

    public static java.lang.Double percentile(java.util.Vector<java.lang.Double> numbers,
                                              double i)

  Returns the i'th percentile of a vector of numbers as a Double object. Returns null if the i'th percentile is undefined

  Parameters:
    `numbers` - vector of numbers
  Returns:
    i'th percentile, or null if it is undefined

### interquartileRange

    public static java.lang.Double interquartileRange(java.util.Vector<java.lang.Double> numbers)

  Returns the interquartile range (third quartile - first quartile).

  Parameters:
    `numbers` - vector of numbers
  Returns:
    interquartile range, or null if it is undefined

### mode

    public static java.lang.Object[] mode(java.util.Vector<java.lang.Double> numbers)

  Finds the mode of a vector of numbers and returns a vector of the mode(s) along with the number of occurences for the mode(s).

  Parameters:
    `numbers` - vector of double values
  Returns:
    an array of Object, where the first element is a vector of double values representing the mode(s) and the second element is an Integer representing the number of occurences of the mode(s)

### trimmedMean

    public static java.lang.Double trimmedMean(java.util.Vector<java.lang.Double> numbers,
                                               double percent)

  Returns the trimmed mean of a vector doubles. The trimmed mean is found by removing the smallest and largest given percent of the values and then computing the mean of the remaining values.

  Parameters:
    `numbers` - vector of double values
    `percent` - percent of smallest and largest values to remove
  Returns:
    trimmed mean, or null is undefined

### skewness

    public static java.lang.Double skewness(java.util.Vector<java.lang.Double> numbers)

  Returns the unbiased skewness of a vector of numbers.

  Parameters:
    `numbers` - vector of double values
  Returns:
    skewness, or null if the vector has less than three elements

### skewnessBiased

    public static java.lang.Double skewnessBiased(java.util.Vector<java.lang.Double> numbers)

  Returns the biased skewness of a vector of numbers.

  Parameters:
    `numbers` - vector of double values
  Returns:
    skewness, or null if the vector has less than two elements

### kurtosis

    public static java.lang.Double kurtosis(java.util.Vector<java.lang.Double> numbers)

  Returns the unbiased kurtosis of a vector of numbers (centered at 0).

  Parameters:
    `numbers` - vector of double values
  Returns:
    kurtosis, or null if the vector has less than four elements

### kurtosisCentered3

    public static java.lang.Double kurtosisCentered3(java.util.Vector<java.lang.Double> numbers)

  Returns the kurtosis of a vector of numbers (centered at 3)

  Parameters:
    `numbers` - vector of double values
  Returns:
    kurtosis, or null if the vector has less than four elements

### kurtosisBiased

    public static java.lang.Double kurtosisBiased(java.util.Vector<java.lang.Double> numbers)

  Returns the biased kurtosis of a vector of numbers (centered at 0).

  Parameters:
    `numbers` - vector of double values
  Returns:
    kurtosis, or null if the vector has less than four elements

### kurtosisBiasedCentered3

    public static java.lang.Double kurtosisBiasedCentered3(java.util.Vector<java.lang.Double> numbers)

  Returns the biased kurtosis of a vector of numbers (centered at 3).

  Parameters:
    `numbers` - vector of double values
  Returns:
    kurtosis, or null if the vector has less than four elements

### MSSD

    public static java.lang.Double MSSD(java.util.Vector<java.lang.Double> numbers)

  Returns the mean of successive squared differences (MSSD).

  Parameters:
    `numbers` - vector of double values
  Returns:
    MSSD, or null if the vector has less than two numbers

### RyanJoinerNormalityCV

    public static double RyanJoinerNormalityCV(int n,
                                               double significance)

  Returns the critical value used in the Ryan-Joiner normality test.

  Parameters:
    `n` - sample size
    `significance` - significance level
  Returns:
    critical value

### removeOutliers

    public static java.util.Vector<java.lang.Double> removeOutliers(java.util.Vector<java.lang.Double> values)

  Removes the outliers from a vector of double values and returns a vector of the outliers.

  Parameters:
    `values` - a vector of double values
  Returns:
    a vector of outliers

### numberOfNegativeSigns

    public static int numberOfNegativeSigns(java.util.Vector<java.lang.Double> values,
                                            double k)

  Returns the number of the values in the given vector that are less than the given median.

  Parameters:
    `values` - vector of double values
    `k` - median
  Returns:
    number of negative signs

### numberOfPositiveSigns

    public static int numberOfPositiveSigns(java.util.Vector<java.lang.Double> values,
                                            double k)

  Returns the number of the values in the given vector that are greater than the given median.

  Parameters:
    `values` - vector of double values
    `k` - median
  Returns:
    number of positive signs

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