CESE 1.4.7

com.simulogic.dataview.analysis
Class ChannelStats

java.lang.Object
  extended by com.simulogic.dataview.analysis.ChannelStats

public class ChannelStats
extends java.lang.Object

Class that performes a number of statistical/analysis routines on channel(s).

Descriptive statistics methods portions copyright (C) 1999 CERN - European Organization for Nuclear Research.


Field Summary
static int LEFT_SLOPE
          Left (from the peak) slope switch for the find slope routine
static int RIGHT_SLOPE
          Right (from the peak) slope switch for the find slope routine
 
Constructor Summary
ChannelStats()
           
 
Method Summary
static double autoCorrelation(double[] data, int lag, double mean, double variance)
          Returns the auto-correlation of a data sequence.
static double correlation(double[] data1, double standardDev1, double[] data2, double standardDev2)
          Returns the correlation of two data sequences.
static double covariance(double[] data1, double[] data2)
          Returns the covariance of two data sequences.
static double durbinWatson(double[] data)
          Durbin-Watson computation.
static int getAbsolutePeakIndex(double xMin, double xMax, DataChannel xChannel, DataChannel yChannel)
          Returns the absolute p array index of a data sequence
static double getAbsoluteSlope(double xMin, double xMax, DataChannel xChannel, DataChannel yChannel)
          Returns the maximum slope abs(delta(data)/delta(time)) index
static double getCurveArea(double xMin, double xMax, DataChannel xChannel, DataChannel yChannel)
          Returns the area under the curve of a data sequence
static int getIndexAtX(double x, DataChannel xChannel)
          Returns the index of x channel that corresponds to the given x value
static int getMaxSlopeIndex(double xMin, double xMax, int pi, int direction, DataChannel xChannel, DataChannel yChannel)
          Returns the maximum slope abs(delta(data)/delta(time)) index
static double getMean(double xMin, double xMax, DataChannel xChannel, DataChannel yChannel)
          Returns the mean of a data sequence.
static double getN(double xMin, double xMax, DataChannel xChannel, DataChannel yChannel)
          Returns the number of data points between xMin and xMax for the given x channel / y channel pair
static int getNegativePeakIndex(double xMin, double xMax, DataChannel xChannel, DataChannel yChannel)
          Returns the negative p array index of a data sequence
static int getPositivePeakIndex(double xMin, double xMax, DataChannel xChannel, DataChannel yChannel)
          Returns the positive p array index of a data sequence
static int getSlopeLevelIndex(double xMin, double xMax, int pi, int direction, double level, DataChannel xChannel, DataChannel yChannel)
          Returns the index of a slope level (in %) of a data sequence
static double getValueAtX(double x, DataChannel xChannel, DataChannel yChannel)
          Returns the value of y channel that corresponds to the given x value
static double getVariance(double xMin, double xMax, DataChannel xChannel, DataChannel yChannel)
          Returns the variance of a data sequence.
static double meanDeviation(double[] data, double mean)
          Returns the mean deviation of a dataset.
static double rms(int size, double sumOfSquares)
          Returns the RMS (Root-Mean-Square) of a data sequence.
static double sampleVariance(double[] data, double mean)
          Returns the sample variance of a data sequence.
static void standardize(double[] data, double mean, double standardDeviation)
          Modifies a data sequence to be standardized.
static double sumOfPowerDeviations(double[] data, int k, double c)
          Returns Sum( (data[i]-c)k ); optimized for common parameters like c == 0.0 and/or k == -2 ..
static double sumOfPowerDeviations(double[] data, int k, double c, int from, int to)
          Returns Sum( (data[i]-c)k ) for all i = from ..
static double sumOfSquares(double[] data)
          Returns the sum of squares of a data sequence.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LEFT_SLOPE

public static final int LEFT_SLOPE
Left (from the peak) slope switch for the find slope routine

See Also:
Constant Field Values

RIGHT_SLOPE

public static final int RIGHT_SLOPE
Right (from the peak) slope switch for the find slope routine

See Also:
Constant Field Values
Constructor Detail

ChannelStats

public ChannelStats()
Method Detail

getIndexAtX

public static final int getIndexAtX(double x,
                                    DataChannel xChannel)
Returns the index of x channel that corresponds to the given x value

Parameters:
x - x value
xChannel - x channel
Returns:
returns the correspondent index in data array

getValueAtX

public static final double getValueAtX(double x,
                                       DataChannel xChannel,
                                       DataChannel yChannel)
Returns the value of y channel that corresponds to the given x value

Parameters:
x - x value
xChannel - x channel
yChannel - y channel
Returns:
returns the correspondent y value

getN

public static final double getN(double xMin,
                                double xMax,
                                DataChannel xChannel,
                                DataChannel yChannel)
Returns the number of data points between xMin and xMax for the given x channel / y channel pair

Parameters:
xMin - minimal limit for x
xMax - maximal limit for x
xChannel - x channel
yChannel - y channel
Returns:
number of data points between xMin and xMax

getMean

public static final double getMean(double xMin,
                                   double xMax,
                                   DataChannel xChannel,
                                   DataChannel yChannel)
Returns the mean of a data sequence. That is sum / size

Parameters:
xMin - minimal limit for x
xMax - maximal limit for x
xChannel - x channel
yChannel - y channel
Returns:
double

getVariance

public static final double getVariance(double xMin,
                                       double xMax,
                                       DataChannel xChannel,
                                       DataChannel yChannel)
Returns the variance of a data sequence. That is (sumOfSquares - mean*sum) / size with mean = sum/size

Parameters:
xMin - minimal limit for x
xMax - maximal limit for x
xChannel - x channel
yChannel - y channel
Returns:
double

getNegativePeakIndex

public static final int getNegativePeakIndex(double xMin,
                                             double xMax,
                                             DataChannel xChannel,
                                             DataChannel yChannel)
Returns the negative p array index of a data sequence

Parameters:
xMin - minimal limit for x
xMax - maximal limit for x
xChannel - x channel
yChannel - y channel
Returns:
int

getPositivePeakIndex

public static final int getPositivePeakIndex(double xMin,
                                             double xMax,
                                             DataChannel xChannel,
                                             DataChannel yChannel)
Returns the positive p array index of a data sequence

Parameters:
xMin - minimal limit for x
xMax - maximal limit for x
xChannel - x channel
yChannel - y channel
Returns:
int

getAbsolutePeakIndex

public static final int getAbsolutePeakIndex(double xMin,
                                             double xMax,
                                             DataChannel xChannel,
                                             DataChannel yChannel)
Returns the absolute p array index of a data sequence

Parameters:
xMin - minimal limit for x
xMax - maximal limit for x
xChannel - x channel
yChannel - y channel
Returns:
int

getCurveArea

public static final double getCurveArea(double xMin,
                                        double xMax,
                                        DataChannel xChannel,
                                        DataChannel yChannel)
Returns the area under the curve of a data sequence

This method assumes that xchannel values are monotonically rising with index. All values that do not satisfy x[n]<x[n+1] criterion are discarded.

Parameters:
xMin - minimal limit for x
xMax - maximal limit for x
xChannel - x channel
yChannel - y channel
Returns:
double

getMaxSlopeIndex

public static final int getMaxSlopeIndex(double xMin,
                                         double xMax,
                                         int pi,
                                         int direction,
                                         DataChannel xChannel,
                                         DataChannel yChannel)
Returns the maximum slope abs(delta(data)/delta(time)) index

This method assumes that xchannel values are monotonically rising with index. All values that do not satisfy x[n]<x[n+1] criterion are discarded.

Parameters:
xMin - minimal limit for x
xMax - maximal limit for x
pi - index of the peak value to start the search
direction - search direction (to left or to right from the peak)
xChannel - x channel
yChannel - y channel
Returns:
int

getSlopeLevelIndex

public static final int getSlopeLevelIndex(double xMin,
                                           double xMax,
                                           int pi,
                                           int direction,
                                           double level,
                                           DataChannel xChannel,
                                           DataChannel yChannel)
Returns the index of a slope level (in %) of a data sequence

This method assumes that xchannel values are monotonically rising with index. All values that do not satisfy x[n]<x[n+1] criterion are discarded.

Parameters:
xMin - minimal limit for x
xMax - maximal limit for x
pi - index of the peak value to start the search
direction - search direction (to left or to right from the peak)
level - level of the peak value to find (%)
xChannel - x channel
yChannel - y channel
Returns:
double

getAbsoluteSlope

public static final double getAbsoluteSlope(double xMin,
                                            double xMax,
                                            DataChannel xChannel,
                                            DataChannel yChannel)
Returns the maximum slope abs(delta(data)/delta(time)) index

Parameters:
xMin - minimal limit for x
xMax - maximal limit for x
xChannel - x channel
yChannel - y channel
Returns:
slope

autoCorrelation

public static final double autoCorrelation(double[] data,
                                           int lag,
                                           double mean,
                                           double variance)
Returns the auto-correlation of a data sequence.

Parameters:
data - data array
lag - lag
mean - mean
variance - variance
Returns:
autocorrelation

correlation

public static final double correlation(double[] data1,
                                       double standardDev1,
                                       double[] data2,
                                       double standardDev2)
Returns the correlation of two data sequences. That is covariance(data1,data2)/(standardDev1*standardDev2).

Parameters:
data1 -
standardDev1 -
data2 -
standardDev2 -
Returns:
correlation

covariance

public static final double covariance(double[] data1,
                                      double[] data2)
Returns the covariance of two data sequences.

Parameters:
data1 -
data2 -
Returns:
covariance

durbinWatson

public static final double durbinWatson(double[] data)
Durbin-Watson computation.

Parameters:
data - data array
Returns:
Durbin-Watson

meanDeviation

public static final double meanDeviation(double[] data,
                                         double mean)
Returns the mean deviation of a dataset. That is Sum (Math.abs(data[i]-mean)) / data.size()).

Parameters:
data -
mean -
Returns:
mean deviation

rms

public static final double rms(int size,
                               double sumOfSquares)
Returns the RMS (Root-Mean-Square) of a data sequence. That is Math.sqrt(Sum( data[i]*data[i] ) / data.size()). The RMS of data sequence is the square-root of the mean of the squares of the elements in the data sequence. It is a measure of the average "size" of the elements of a data sequence.

Parameters:
sumOfSquares - sumOfSquares(data) == Sum( data[i]*data[i] ) of the data sequence.
size - the number of elements in the data sequence.
Returns:
rms

sampleVariance

public static final double sampleVariance(double[] data,
                                          double mean)
Returns the sample variance of a data sequence. That is Sum ( (data[i]-mean)^2 ) / (data.size()-1).

Parameters:
data -
mean -
Returns:
sample variance

standardize

public static final void standardize(double[] data,
                                     double mean,
                                     double standardDeviation)
Modifies a data sequence to be standardized. Changes each element data[i] as follows: data[i] = (data[i]-mean)/standardDeviation.

Parameters:
data -
mean -
standardDeviation -

sumOfPowerDeviations

public static double sumOfPowerDeviations(double[] data,
                                          int k,
                                          double c)
Returns Sum( (data[i]-c)k ); optimized for common parameters like c == 0.0 and/or k == -2 .. 4.

Parameters:
data - data array
k -
c -
Returns:
sum of power deviations

sumOfPowerDeviations

public static double sumOfPowerDeviations(double[] data,
                                          int k,
                                          double c,
                                          int from,
                                          int to)
Returns Sum( (data[i]-c)k ) for all i = from .. to; optimized for common parameters like c == 0.0 and/or k == -2 .. 5.

Parameters:
data - data array
k -
c -
from -
to -
Returns:
sum of power deviations

sumOfSquares

public static double sumOfSquares(double[] data)
Returns the sum of squares of a data sequence. That is Sum ( data[i]*data[i] ).

Parameters:
data - data array
Returns:
sum of squares

CESE 1.4.7

Copyright (c) 1999 - 2007 Cell Electrophysiology Simulation Environment (CESE). All rights reserved.