jstats
Class Variance

java.lang.Object
  extended byjstats.Variance

public class Variance
extends java.lang.Object

Author:
justin To change the template for this generated type comment go to Window>Preferences>Java>Code Generation>Code and Comments

Constructor Summary
Variance()
           
 
Method Summary
static double chebyshev(double sd)
           
static double coefficientOfVariation(double[] values)
          Computes the coefficient of variation.
static double coefficientOfVariation(double sd, double mean)
          Computes the coefficient of variation.
static double pearsonianSkewness(double[] values)
          Computes the skewness factor from a sample of data.
static double pearsonianSkewness(double mean, double median, double sd)
          Determines relationship between the mean and the median.
static double populationStandardDeviation(double[] values)
           
static double populationStandardUnit(double[] values, int index)
           
static double populationStandardUnit(double value, double mean, double sd)
           
static double populationVarience(double[] values)
           
static double regressionSumSquares(double[] x, double[] y)
           
static double sampleStandardDeviation(double[] values)
          Computes the sample standard deviation.
static double sampleStandardUnit(double[] values, int index)
          Computes sample standard unit for the value at 'index' in an array of doubles.
static double sampleStandardUnit(double value, double mean, double sd)
          Computes the sample standard unit(aka sample z-score) from a list of doubles.
static double sampleVariance(double[] values)
          Computes sample variance.
static double standardError(double[] x, double[] y)
           
static double sumDeviations(double[] values)
          Computes the sum of deviations (or Sxx).
static double totalSumSquares(double[] y)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Variance

public Variance()
Method Detail

chebyshev

public static double chebyshev(double sd)

coefficientOfVariation

public static double coefficientOfVariation(double sd,
                                            double mean)
                                     throws StatisticException
Computes the coefficient of variation. Note that 'sd' and 'mean' must come from the same data.

Parameters:
sd - The standard deviation of a set of data.
mean - The mean of a set of data.
Throws:
StatisticException

coefficientOfVariation

public static double coefficientOfVariation(double[] values)
                                     throws StatisticException
Computes the coefficient of variation. Used to express standard deviation independent of units of measure.

Parameters:
values - An array of doubles containing a sample from a population.
Returns:
coefficient of variation from a sample
Throws:
StatisticException

pearsonianSkewness

public static double pearsonianSkewness(double mean,
                                        double median,
                                        double sd)
                                 throws StatisticException
Determines relationship between the mean and the median. This reflects how the data differs from the normal bell shaped distribution. Note that 'mean', 'median' and 'sd' all must be computed from the same sample.

Parameters:
mean - The mean of the sample.
median - The median of the sample.
sd - The standard deviation of the sample.
Returns:
the measure of skewness
Throws:
StatisticException

pearsonianSkewness

public static double pearsonianSkewness(double[] values)
                                 throws StatisticException
Computes the skewness factor from a sample of data.

Parameters:
values - A list of doubles containing a sample of data.
Returns:
the measure of skewness
Throws:
StatisticException

populationStandardDeviation

public static double populationStandardDeviation(double[] values)
                                          throws StatisticException
Throws:
StatisticException

populationStandardUnit

public static double populationStandardUnit(double value,
                                            double mean,
                                            double sd)
                                     throws StatisticException
Throws:
StatisticException

populationStandardUnit

public static double populationStandardUnit(double[] values,
                                            int index)
                                     throws StatisticException
Throws:
StatisticException

populationVarience

public static double populationVarience(double[] values)
                                 throws StatisticException
Throws:
StatisticException

sampleStandardDeviation

public static double sampleStandardDeviation(double[] values)
                                      throws StatisticException
Computes the sample standard deviation. Used to have no idea

Throws:
StatisticException

sampleStandardUnit

public static double sampleStandardUnit(double value,
                                        double mean,
                                        double sd)
Computes the sample standard unit(aka sample z-score) from a list of doubles. Used to compute 'value' in terms of standard units. Note that 'value', 'mean' and 'sd' must be all from the same sample data.

Parameters:
value - A double in the sample for which
mean - The mean of the sample.
sd - The standard deviation of the sample.
Returns:
'value' in terms of standard units

sampleStandardUnit

public static double sampleStandardUnit(double[] values,
                                        int index)
                                 throws StatisticException
Computes sample standard unit for the value at 'index' in an array of doubles.

Parameters:
values - An array of doubles.
index - An integer that indexes into array 'values', at which the standard unit will be computed.
Throws:
StatisticException

sampleVariance

public static double sampleVariance(double[] values)
                             throws StatisticException
Computes sample variance. Do not use for population varience.

Parameters:
values - A list of doubles that does not represent a full population -- but a sample instead.
Returns:
sample varience
Throws:
StatisticException

sumDeviations

public static double sumDeviations(double[] values)
                            throws StatisticException
Computes the sum of deviations (or Sxx).

Parameters:
values - An array of doubles which constitute a sample from a larger population.
Returns:
sum of squares(Sxx) aka sum of deviations
Throws:
StatisticException

regressionSumSquares

public static double regressionSumSquares(double[] x,
                                          double[] y)
                                   throws StatisticException
Throws:
StatisticException

totalSumSquares

public static double totalSumSquares(double[] y)
                              throws StatisticException
Throws:
StatisticException

standardError

public static double standardError(double[] x,
                                   double[] y)
                            throws StatisticException
Throws:
StatisticException