inpro.features
Class TimeShiftingAnalysis

java.lang.Object
  extended by inpro.features.TimeShiftingAnalysis
All Implemented Interfaces:
edu.cmu.sphinx.instrumentation.Resetable

public class TimeShiftingAnalysis
extends java.lang.Object
implements edu.cmu.sphinx.instrumentation.Resetable

class to perform linear regression and mean calculation; ideal for incrementally added data points. old data points can be discarded automatically using setMaxLag()

Author:
timo

Nested Class Summary
private static class TimeShiftingAnalysis.DataPoint
           
 
Field Summary
protected  int currentTime
           
protected  java.util.LinkedList<TimeShiftingAnalysis.DataPoint> dataPoints
           
protected  boolean dirty
           
protected  int down
           
protected  double intercept
           
protected  double max
           
protected  int maxLag
           
protected  double maxPos
           
protected  double mean
           
protected  double meanDifference
           
protected  double min
           
protected  double minPos
           
protected  double mse
           
protected  int peaks
           
protected  double range
           
protected  int same
           
protected  double slope
           
protected  double stddev
           
protected  int up
           
 
Constructor Summary
TimeShiftingAnalysis()
           
TimeShiftingAnalysis(int maxLag)
           
 
Method Summary
 void add(int t, double x)
           
protected  void doRegression()
           
 int getDownCount()
           
 double getIntercept()
           
 double getLatestValue()
           
 double getMax()
           
 double getMaxPosition()
           
 double getMean()
           
 double getMeanStepDifference()
           
 double getMin()
           
 double getMinPosition()
           
 double getMSE()
           
 int getPeakCount()
           
 double getRange()
           
 int getSameCount()
           
 double getSlope()
           
 int getUpCount()
           
 double getWesseling()
           
 boolean hasValidData()
           
static void main(java.lang.String[] args)
           
 double predictValueAt(int t)
           
private  void removeOldPoints()
           
 void reset()
           
 void setMaxLag(int maxLag)
          set the maximum lag of the time shifting analysis
 void shiftTime(int t)
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

dataPoints

protected java.util.LinkedList<TimeShiftingAnalysis.DataPoint> dataPoints

maxLag

protected int maxLag

currentTime

protected int currentTime

dirty

protected boolean dirty

slope

protected double slope

intercept

protected double intercept

mean

protected double mean

stddev

protected double stddev

range

protected double range

mse

protected double mse

meanDifference

protected double meanDifference

minPos

protected double minPos

maxPos

protected double maxPos

max

protected double max

min

protected double min

up

protected int up

down

protected int down

same

protected int same

peaks

protected int peaks
Constructor Detail

TimeShiftingAnalysis

public TimeShiftingAnalysis(int maxLag)

TimeShiftingAnalysis

public TimeShiftingAnalysis()
Method Detail

add

public void add(int t,
                double x)

shiftTime

public void shiftTime(int t)

removeOldPoints

private void removeOldPoints()

setMaxLag

public void setMaxLag(int maxLag)
set the maximum lag of the time shifting analysis

Parameters:
maxLag - maximum lag of the oldest considered data point 0: consider all data points

doRegression

protected void doRegression()

getSlope

public double getSlope()

getIntercept

public double getIntercept()

getMean

public double getMean()

getRange

public double getRange()

getMSE

public double getMSE()

getMeanStepDifference

public double getMeanStepDifference()

getMinPosition

public double getMinPosition()

getMaxPosition

public double getMaxPosition()

getMin

public double getMin()

getMax

public double getMax()

predictValueAt

public double predictValueAt(int t)

getLatestValue

public double getLatestValue()

getWesseling

public double getWesseling()

getUpCount

public int getUpCount()

getDownCount

public int getDownCount()

getSameCount

public int getSameCount()

getPeakCount

public int getPeakCount()

hasValidData

public boolean hasValidData()

reset

public void reset()
Specified by:
reset in interface edu.cmu.sphinx.instrumentation.Resetable

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

main

public static void main(java.lang.String[] args)