jpiv2
Class Statistics

java.lang.Object
  extended by jpiv2.Statistics

public class Statistics
extends java.lang.Object

Some convenient methods for calculating statistical data. All methods are declared static, so that it is not necessary to create a specific instance of this class.


Constructor Summary
Statistics()
           
 
Method Summary
static double[] comparePivDataSets(PivData referenceData, PivData testData, boolean useBorder)
          Calculates the root mean square error (standard deviation) based on differences with reference data (not the average of the data itself).
static double getAverage(double[] val)
          Gets the arithmetic average of an array of double values.
static float getAverage(float[] val)
          Gets the arithmetic average of an array of float values.
static float getAverage(float[][] val)
          Gets the arithmetic average of a double array of float values.
static double getLinearRegressionGradient(double[] x, double[] y)
          Gets the gradient b of the linear regression through the given points x, y.
static double getMax(double[] val)
          Gets the maximum value of an array of double values.
static double getMedian(double[] val)
          Gets the median of an array of double values.
static double getMin(double[] val)
          Gets the minimum value of an array of double values.
static double[] getResidualsOfMedian(double[] val)
          Gets the residuals r of the median x_m of an array of double values x_i ( r_i = |x_i - x_m| ).
static double getStandardDeviation(double[] val)
          Gets the standard deviation of an array of double values.
 
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

getMin

public static double getMin(double[] val)
Gets the minimum value of an array of double values.

Parameters:
val - The data
Returns:
The minimum value

getMax

public static double getMax(double[] val)
Gets the maximum value of an array of double values.

Parameters:
val - The data
Returns:
The maximum value

getMedian

public static double getMedian(double[] val)
Gets the median of an array of double values.

Parameters:
val - The data
Returns:
The median value. If the number of data elements is even the artithmetic mean of the two median values is returned.

getResidualsOfMedian

public static double[] getResidualsOfMedian(double[] val)
Gets the residuals r of the median x_m of an array of double values x_i ( r_i = |x_i - x_m| ).

Parameters:
val - The data x_i.
Returns:
The residuals r_i of the median value.

getAverage

public static double getAverage(double[] val)
Gets the arithmetic average of an array of double values.

Parameters:
val - The data
Returns:
The arithmetic average of the data.

getAverage

public static float getAverage(float[] val)
Gets the arithmetic average of an array of float values.

Parameters:
val - The data
Returns:
The arithmetic average of the data.

getAverage

public static float getAverage(float[][] val)
Gets the arithmetic average of a double array of float values.

Parameters:
val - The data
Returns:
The arithmetic average of the data.

getStandardDeviation

public static double getStandardDeviation(double[] val)
Gets the standard deviation of an array of double values.

Parameters:
val - The data
Returns:
The standard deviation of the data.

getLinearRegressionGradient

public static double getLinearRegressionGradient(double[] x,
                                                 double[] y)
Gets the gradient b of the linear regression through the given points x, y.

Parameters:
x - The independent values.
y - The measured values.
Returns:
The gradient b of the regression curve y = a + bx.

comparePivDataSets

public static double[] comparePivDataSets(PivData referenceData,
                                          PivData testData,
                                          boolean useBorder)
Calculates the root mean square error (standard deviation) based on differences with reference data (not the average of the data itself). Values in the reference data that are exactly zero are skipped.

Parameters:
referenceData - the reference data
testData - the test data
useBorder - ignores border values if false
Returns:
An array that contains the standard deviation of the third (dx), fourth (dy) and fifth (flag) data colum.