jhplot.stat
Class Statistics
- java.lang.Object
-
- jhplot.stat.Statistics
-
public class Statistics extends java.lang.Object
A static class for statistical calculations.
-
-
Constructor Summary
Constructors Constructor and Description Statistics()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method and Description static double[][]
correlation(double[][] v)
Correlationstatic double[][]
correlation(double[][] v1, double[][] v2)
Correlation coefficient, covariance(v1, v2) / Math.sqrt(variance(v1) * variance(v2)static double
correlation(double[] v1, double[] v2)
Correlation coefficient, covariance(v1, v2) / Math.sqrt(variance(v1) * variance(v2)static double[][]
covariance(double[][] v)
Covariancestatic double[][]
covariance(double[][] v1, double[][] v2)
Covariancestatic double
covariance(double[] v1, double[] v2)
Covariancevoid
doc()
Show online documentation.static double
FProbability(double F, int df1, int df2)
Computes probability of F-ratio.static double
gamma(double x)
Returns the Gamma function of the argument.static double
incompleteBeta(double aa, double bb, double xx)
Returns the Incomplete Beta Function evaluated from zero to xx.static double
incompleteBetaFraction1(double a, double b, double x)
Continued fraction expansion #1 for incomplete beta integral.static double
incompleteBetaFraction2(double a, double b, double x)
Continued fraction expansion #2 for incomplete beta integral.static double
lnGamma(double x)
Returns natural logarithm of gamma function.static double
mean(double[] v)
Get mean valuestatic double[]
mean(double[][] v)
Get meanstatic double
p1evl(double x, double[] coef, int N)
Evaluates the given polynomial of degree N at x.static double
polevl(double x, double[] coef, int N)
Evaluates the given polynomial of degree N at x.static double
powerSeries(double a, double b, double x)
Power series for incomplete beta integral.static double
stddeviation(double[] v)
Standard deviationstatic double[]
stddeviation(double[][] v)
Standard deviationstatic double
stirlingFormula(double x)
Returns the Gamma function computed by Stirling's formula.static double
variance(double[] v)
Variancestatic double[]
variance(double[][] v)
Variance
-
-
-
Method Detail
-
mean
public static double mean(double[] v)
Get mean value- Parameters:
v
- vector
-
mean
public static double[] mean(double[][] v)
Get mean- Parameters:
v
- 2D array- Returns:
-
stddeviation
public static double stddeviation(double[] v)
Standard deviation- Parameters:
v
- vector- Returns:
-
variance
public static double variance(double[] v)
Variance- Parameters:
v
-- Returns:
- vector
-
stddeviation
public static double[] stddeviation(double[][] v)
Standard deviation- Parameters:
v
-- Returns:
-
variance
public static double[] variance(double[][] v)
Variance- Parameters:
v
- vector- Returns:
-
covariance
public static double covariance(double[] v1, double[] v2)
Covariance- Parameters:
v1
- first vectorv2
- second vector- Returns:
-
covariance
public static double[][] covariance(double[][] v1, double[][] v2)
Covariance- Parameters:
v1
- first 2D arrayv2
- second 2D array- Returns:
-
covariance
public static double[][] covariance(double[][] v)
Covariance- Parameters:
v
-- Returns:
-
correlation
public static double correlation(double[] v1, double[] v2)
Correlation coefficient, covariance(v1, v2) / Math.sqrt(variance(v1) * variance(v2)- Parameters:
v1
- first vectorv2
- second vector- Returns:
-
correlation
public static double[][] correlation(double[][] v1, double[][] v2)
Correlation coefficient, covariance(v1, v2) / Math.sqrt(variance(v1) * variance(v2)- Parameters:
v1
- first vectorv2
- second vector- Returns:
-
correlation
public static double[][] correlation(double[][] v)
Correlation- Parameters:
v
-- Returns:
-
FProbability
public static double FProbability(double F, int df1, int df2)
Computes probability of F-ratio.- Parameters:
F
- the F-ratiodf1
- the first number of degrees of freedomdf2
- the second number of degrees of freedom- Returns:
- the probability of the F-ratio.
-
incompleteBeta
public static double incompleteBeta(double aa, double bb, double xx)
Returns the Incomplete Beta Function evaluated from zero to xx.- Parameters:
aa
- the alpha parameter of the beta distribution.bb
- the beta parameter of the beta distribution.xx
- the integration end point.
-
powerSeries
public static double powerSeries(double a, double b, double x)
Power series for incomplete beta integral. Use when b*x is small and x not too close to 1.
-
lnGamma
public static double lnGamma(double x)
Returns natural logarithm of gamma function.- Parameters:
x
- the value- Returns:
- natural logarithm of gamma function
-
p1evl
public static double p1evl(double x, double[] coef, int N)
Evaluates the given polynomial of degree N at x. Evaluates polynomial when coefficient of N is 1.0. Otherwise same as polevl().2 N y = C + C x + C x +...+ C x 0 1 2 N Coefficients are stored in reverse order: coef[0] = C , ..., coef[N] = C . N 0
The function p1evl() assumes that coef[N] = 1.0 and is omitted from the array. Its calling arguments are otherwise the same as polevl().In the interest of speed, there are no checks for out of bounds arithmetic.
- Parameters:
x
- argument to the polynomial.coef
- the coefficients of the polynomial.N
- the degree of the polynomial.
-
gamma
public static double gamma(double x)
Returns the Gamma function of the argument.
-
stirlingFormula
public static double stirlingFormula(double x)
Returns the Gamma function computed by Stirling's formula. The polynomial STIR is valid for 33 <= x <= 172.
-
polevl
public static double polevl(double x, double[] coef, int N)
Evaluates the given polynomial of degree N at x.2 N y = C + C x + C x +...+ C x 0 1 2 N Coefficients are stored in reverse order: coef[0] = C , ..., coef[N] = C . N 0
In the interest of speed, there are no checks for out of bounds arithmetic.- Parameters:
x
- argument to the polynomial.coef
- the coefficients of the polynomial.N
- the degree of the polynomial.
-
incompleteBetaFraction1
public static double incompleteBetaFraction1(double a, double b, double x)
Continued fraction expansion #1 for incomplete beta integral.
-
incompleteBetaFraction2
public static double incompleteBetaFraction2(double a, double b, double x)
Continued fraction expansion #2 for incomplete beta integral.
-
doc
public void doc()
Show online documentation.
-
-
DMelt 3.0 © DataMelt by jWork.ORG