codesimian
Class Statistics

java.lang.Object
  extended by codesimian.Statistics

public class Statistics
extends java.lang.Object

Statistical functions for bell curves. (more later)


Constructor Summary
Statistics()
           
 
Method Summary
static double[] approximateBellCurve(int arraySize)
          Returns a sorted double[] with (always the same numbers in the same program execution) pseudorandom GAUSSIAN values, ave 0 std dev 1.
static void aveZeroDevOne(double[] d)
          calculates the average and standard deviation of d[] and changes its values to have average 0 and deviation 1.
static double bellCurveHeight(double x)
          Returns the EXACT (except for roundoff) height of a bell curve at position x (any number), with average 0 and standard deviation 1.
static double gaussianToPercentile(double gaussianNumber)
          Returns the approximate percentile (0.0 - 1.0) of gaussianNumber on a bell curve, the fraction of the area under the curve is toward negative.
static double percentileToGaussian(double percentileFraction)
          Approximate average 0.0 and standard deviation 1.0.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Statistics

public Statistics()
Method Detail

approximateBellCurve

public static double[] approximateBellCurve(int arraySize)
Returns a sorted double[] with (always the same numbers in the same program execution) pseudorandom GAUSSIAN values, ave 0 std dev 1.


percentileToGaussian

public static double percentileToGaussian(double percentileFraction)
Approximate average 0.0 and standard deviation 1.0. On an approximate bell curve, starts at -infinity and goes up until percentileFraction amount of area under the curve has been traversed. Returns the value there. About 68% of returned doubles are between -1 and 1. Less often, an exponentially large value is returned.


gaussianToPercentile

public static double gaussianToPercentile(double gaussianNumber)
Returns the approximate percentile (0.0 - 1.0) of gaussianNumber on a bell curve, the fraction of the area under the curve is toward negative. The opposite of gaussian(). percentileToGaussian(gaussianToPercentile(X)) approximately equals X.


bellCurveHeight

public static double bellCurveHeight(double x)
Returns the EXACT (except for roundoff) height of a bell curve at position x (any number), with average 0 and standard deviation 1. This is not an approximated integral like the other bell curve functions, which use piecewise approximations instead. The area under my exact curve sums to 1.0. The top of the curve is less than 1.


aveZeroDevOne

public static void aveZeroDevOne(double[] d)
calculates the average and standard deviation of d[] and changes its values to have average 0 and deviation 1.