SciLib.Math.ST
Class Stat

java.lang.Object
  extended by SciLib.Math.ST.Stat

public final class Stat
extends java.lang.Object

This class defines some useful statistical computation.


Constructor Summary
Stat()
           
 
Method Summary
static vector autoCorrelation(vector x)
          Compute the autoCorrelation of the vector x
static vector autoCovariance(vector x)
          Compute the autoCovariance of the vector x
static double correlation(vector x, vector y)
          Compute the correlation of two vectors x, y
static double covariance(vector x, vector y)
          Compute the covariance of two vectors x, y
static double deviation(vector x)
          Compute the standard deviation of vector x
static double GaussDist(double mean, double var)
          Compute the one-dimensional Gaussian distribution with mean mu and standard deviation sigma
static double gausspdf(vector x, vector mu, double sigma2)
          Compute the Gaussian distribution of vector x with mean mu and standard deviation sigma
static double mean(vector x)
          Compute the mean of vector x
static void meanCorrected(vector x)
          Transform the vector x so that it has zero mean
static vector normpdf(vector x, double mu, double sigma)
          Compute the normal probability function of vector x with mean mu and standard deviation sigma
static vector randomVector(int size, double a, double b)
          Compute a vector of random numbers between a and b
static double variance(vector x)
          Compute the variance of vector x
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Stat

public Stat()
Method Detail

autoCorrelation

public static vector autoCorrelation(vector x)
Compute the autoCorrelation of the vector x

Parameters:
x - A vector
Returns:
A vector

autoCovariance

public static vector autoCovariance(vector x)
Compute the autoCovariance of the vector x

Parameters:
x - A vector
Returns:
A vector

correlation

public static double correlation(vector x,
                                 vector y)
Compute the correlation of two vectors x, y

Parameters:
x - A vector
y - A vector
Returns:
A double value

covariance

public static double covariance(vector x,
                                vector y)
Compute the covariance of two vectors x, y

Parameters:
x - A vector
y - A vector
Returns:
A double value

deviation

public static double deviation(vector x)
Compute the standard deviation of vector x

Parameters:
x - A vector
Returns:
A double value

mean

public static double mean(vector x)
Compute the mean of vector x

Parameters:
x - A vector
Returns:
A double value

meanCorrected

public static void meanCorrected(vector x)
Transform the vector x so that it has zero mean

Parameters:
x - A vector

randomVector

public static vector randomVector(int size,
                                  double a,
                                  double b)
Compute a vector of random numbers between a and b

Parameters:
size - An integer value, the size of the vector
a - A double value
b - A double value
Returns:
A vector

variance

public static double variance(vector x)
Compute the variance of vector x

Parameters:
x - A vector
Returns:
A double value

normpdf

public static vector normpdf(vector x,
                             double mu,
                             double sigma)
Compute the normal probability function of vector x with mean mu and standard deviation sigma

Parameters:
x - A vector
mu - A double value, the mean
sigma - A double value, the variance
Returns:
A vector

GaussDist

public static double GaussDist(double mean,
                               double var)
Compute the one-dimensional Gaussian distribution with mean mu and standard deviation sigma

Parameters:
mean - the mean, a double
var - the variance, a double
Returns:
A double value

gausspdf

public static double gausspdf(vector x,
                              vector mu,
                              double sigma2)
Compute the Gaussian distribution of vector x with mean mu and standard deviation sigma

Parameters:
x - A vector
mu - A vector, the mean
sigma2 - A double value, the variance
Returns:
A double value