C# Class LitDev.LDStatistics

Show file Open project: litdev1/LitDev

Public Methods

Method Description
Differentiate ( Primitive array ) : Primitive

Calculate the derivative of a 1D data array.

DistBinomial ( Primitive n, Primitive p ) : Primitive

Create an array with a Binomial distribution. This is like the probablity of getting k heads from 20 (n) coin tosses, with a probablity for each toss getting a heads of 0.5 (p).

DistNormal ( Primitive distMean, Primitive distSTD, Primitive size ) : Primitive

Create an array with a Normal distribution.

DistTriangular ( Primitive rangeMin, Primitive rangeMax, Primitive size ) : Primitive

Create an array with a Triangular distribution.

DistUniform ( Primitive rangeMin, Primitive rangeMax, Primitive size ) : Primitive

Create an array with a Uniform distribution.

Frequency ( Primitive array, Primitive bins, Primitive normalised ) : Primitive

Calculate a frequency distribution from array of data.

Integrate ( Primitive array ) : Primitive

Calculate the integral of a 1D data array.

InterpolateX ( Primitive array, Primitive y ) : Primitive

Interpolate a 1D data array to find the value of x(y). The values of y should be monotonically increasing with x.

InterpolateY ( Primitive array, Primitive x ) : Primitive

Interpolate a 1D data array to find the value of y(x). The values of x should be monotonically increasing.

SetArray ( Primitive array ) : Primitive

Set a 1D array of numbers to perform some statistics on. This command must be called before any statistics are calculated.

Private Methods

Method Description
binomial ( int n, int k ) : double
factorial ( int n ) : double
formData ( string array ) : void
interpolateX ( double y ) : double
interpolateY ( double x ) : double
setData ( string array ) : void
setPoints ( string array ) : void

Method Details

Differentiate() public static method

Calculate the derivative of a 1D data array.
public static Differentiate ( Primitive array ) : Primitive
array Primitive The array to differentiate (array[x]=y).
return Primitive

DistBinomial() public static method

Create an array with a Binomial distribution. This is like the probablity of getting k heads from 20 (n) coin tosses, with a probablity for each toss getting a heads of 0.5 (p).
public static DistBinomial ( Primitive n, Primitive p ) : Primitive
n Primitive The number of tries.
p Primitive The probablity of success for each try.
return Primitive

DistNormal() public static method

Create an array with a Normal distribution.
public static DistNormal ( Primitive distMean, Primitive distSTD, Primitive size ) : Primitive
distMean Primitive The mean of the distribution.
distSTD Primitive The standard deviation of the distribution.
size Primitive The number of points.
return Primitive

DistTriangular() public static method

Create an array with a Triangular distribution.
public static DistTriangular ( Primitive rangeMin, Primitive rangeMax, Primitive size ) : Primitive
rangeMin Primitive The minimum value.
rangeMax Primitive The maximum value.
size Primitive The number of points.
return Primitive

DistUniform() public static method

Create an array with a Uniform distribution.
public static DistUniform ( Primitive rangeMin, Primitive rangeMax, Primitive size ) : Primitive
rangeMin Primitive The minimum value.
rangeMax Primitive The maximum value.
size Primitive The number of points.
return Primitive

Frequency() public static method

Calculate a frequency distribution from array of data.
public static Frequency ( Primitive array, Primitive bins, Primitive normalised ) : Primitive
array Primitive The array to create the frequency distribution from.
bins Primitive The number of bins spanning the data.
normalised Primitive Is the frequency normalised to integrate to 1 ("True" or "False").
return Primitive

Integrate() public static method

Calculate the integral of a 1D data array.
public static Integrate ( Primitive array ) : Primitive
array Primitive The array to integrate (array[x]=y).
return Primitive

InterpolateX() public static method

Interpolate a 1D data array to find the value of x(y). The values of y should be monotonically increasing with x.
public static InterpolateX ( Primitive array, Primitive y ) : Primitive
array Primitive The array to interpolate (array[x]=y).
y Primitive The value of y (may be an array of y values).
return Primitive

InterpolateY() public static method

Interpolate a 1D data array to find the value of y(x). The values of x should be monotonically increasing.
public static InterpolateY ( Primitive array, Primitive x ) : Primitive
array Primitive The array to interpolate (array[x]=y).
x Primitive The value of x (may be an array of x values).
return Primitive

SetArray() public static method

Set a 1D array of numbers to perform some statistics on. This command must be called before any statistics are calculated.
public static SetArray ( Primitive array ) : Primitive
array Primitive /// The array to perform statistics on. ///
return Primitive