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 double[] aveDev(double[] d)
          returns new double[]{average,standard deviation}
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 aveZeroStdDevOne)
          Returns the approximate percentile (0.0 - 1.0) of gaussianNumber on a bell curve, the fraction of the area under the bell curve is toward negative.
static byte[] nextBytes(int quantity)
          Deprecated. 
static double nextDouble01()
          Deprecated. 
static float nextFloat01()
          Deprecated. 
static int nextInt(int end)
          Deprecated. 
static double percentileToGaussian(double percentileFraction)
          Approximate average 0.0 and standard deviation 1.0.
static double positiveGaussianToPercentile(double positiveGaussianNumber)
           
 
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 aveZeroStdDevOne)
Returns the approximate percentile (0.0 - 1.0) of gaussianNumber on a bell curve, the fraction of the area under the bell curve is toward negative.

percentileToGaussian(gaussianToPercentile(X)) approximately equals X.


positiveGaussianToPercentile

public static double positiveGaussianToPercentile(double positiveGaussianNumber)

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, equal to 1/sqrt(2*pi).


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.


aveDev

public static double[] aveDev(double[] d)
returns new double[]{average,standard deviation}


nextInt

@Deprecated
public static int nextInt(int end)
Deprecated. 


nextDouble01

@Deprecated
public static double nextDouble01()
Deprecated. 


nextFloat01

@Deprecated
public static float nextFloat01()
Deprecated. 


nextBytes

@Deprecated
public static byte[] nextBytes(int quantity)
Deprecated.