com.kutsyy.util
Class Stat

java.lang.Object
  |
  +--com.kutsyy.util.Stat

public final class Stat
extends Object

Some additional Math/Stat functions (I could not name this class Math)
Created by Vadim Kutsyy

Author:
Vadim Kutsyy

Constructor Summary
Stat()
           
 
Method Summary
private static double calerf(double x, int jint)
           
static double[][] cov(double[][] x)
          Compute covariance matrix of colums of x
static double erf(double x)
           
static double erfc(double x)
           
static double mean(double[] a)
          Mean of the vector
static double[] mean(double[][] x)
          Mean of row of the matrix x
static double median(double[] a)
          Median of the vector
static double[] percentile(double[] p, double[] a)
          Find percetiles of given (unsorted) vector
static double percentile(double p, double[] a)
          Find quontale of given (unsorted) percentile
static double sum(double[] a)
          Sum of the vector
static double sumsq(double[] a)
          Sum of squares of the vector
static double var(double[] a)
          Variance of the vector
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait
 

Constructor Detail

Stat

public Stat()
Method Detail

cov

public static double[][] cov(double[][] x)
Compute covariance matrix of colums of x
Parameters:
x - double[][] - x
Returns:
double[][] - covariance matrix

erf

public static double erf(double x)

erfc

public static double erfc(double x)

mean

public static double[] mean(double[][] x)
Mean of row of the matrix x
Parameters:
x - double[][] - x
Returns:
double[] - mean(x)

mean

public static double mean(double[] a)
Mean of the vector
Parameters:
a - double[] - a
Returns:
double - mean(a)

median

public static double median(double[] a)
Median of the vector
Parameters:
a - double[] - a
Returns:
double - median(a)

percentile

public static double[] percentile(double[] p,
                                  double[] a)
Find percetiles of given (unsorted) vector
Parameters:
p - double[] - percentile at with quaniles needed
a - double[] - vector
Returns:
double[] - quantiles

percentile

public static double percentile(double p,
                                double[] a)
Find quontale of given (unsorted) percentile
Parameters:
p - double - percentile at with quanile needed
a - double[] - vector
Returns:
double - quantile

sum

public static double sum(double[] a)
Sum of the vector
Parameters:
a - double[] - a
Returns:
double - sum(a)

sumsq

public static double sumsq(double[] a)
Sum of squares of the vector
Parameters:
a - double[] - a
Returns:
double - sumsq(a)

var

public static double var(double[] a)
Variance of the vector
Parameters:
a - double[] - a
Returns:
double - var(a)

calerf

private static double calerf(double x,
                             int jint)