lt.monarch.chart.spc.math
Class IMRValuesCalculator

java.lang.Object
  extended by lt.monarch.chart.spc.math.ValuesCalculator
      extended by lt.monarch.chart.spc.math.ControlValuesCalculator
          extended by lt.monarch.chart.spc.math.IMRValuesCalculator
Direct Known Subclasses:
IndividualXValuesCalculator, MovingRangeValuesCalculator

public abstract class IMRValuesCalculator
extends ControlValuesCalculator

Calculates values for Individual - X and Moving Range chart. Values are calculated using formulas: http://www.singleton-labs.com/doc/mcharts/guide/#guide/chart-types/4.3.1.html


Field Summary
Modifier and Type Field and Description
protected  java.lang.Double histLcl
           
protected  java.lang.Double histUcl
           
 
Fields inherited from class lt.monarch.chart.spc.math.ValuesCalculator
nullName
 
Constructor Summary
Modifier Constructor and Description
protected IMRValuesCalculator()
          Constructs IMR chart values calculator.
protected IMRValuesCalculator(java.lang.Double lcl, java.lang.Double ucl)
          Constructs IMR chart values calculator.
 
Method Summary
Modifier and Type Method and Description
protected  java.util.List<java.lang.Object> getData(ChartDataModel dataModel)
          Converts data model to the array list
protected  double getMovingRange(ChartDataModel dataModel, int j)
          Calculates a moving range.
protected  boolean isNormalDistribution(ChartDataModel dataModel)
          Checks if data is distributed according normal distribution.
protected  double movingRange(ChartDataModel dataModel)
          Calculates moving range.
protected  double processSigma(ChartDataModel dataModel)
          Calculates process sigma.
 
Methods inherited from class lt.monarch.chart.spc.math.ControlValuesCalculator
averageRange, getCenter, getCenter, getChartLine, getChartLine, getLabels, getLCL, getLCL, getN, getRange, getUCL, getUCL, sigmaX
 
Methods inherited from class lt.monarch.chart.spc.math.ValuesCalculator
average, fill, fill, fillColumn, fillColumn, fillConstant, fillConstant, getAverage, getc4, getColumn, getd2, getd3, getD3, getD4, getDouble, getE, getF, getG, getH, isEmpty, isNconstant, validateDataModel, validateDataModel, validateDataModel
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

histUcl

protected java.lang.Double histUcl

histLcl

protected java.lang.Double histLcl
Constructor Detail

IMRValuesCalculator

protected IMRValuesCalculator()
Constructs IMR chart values calculator. LCL and UCL values are calculated from the data.


IMRValuesCalculator

protected IMRValuesCalculator(java.lang.Double lcl,
                              java.lang.Double ucl)
Constructs IMR chart values calculator. LCL and UCL values given as a parameters (calculated from historical data). Given LCL and UCL values are used for calculating other chart parameters.

Parameters:
lcl - lower control limit value
ucl - upper control limit value
Method Detail

movingRange

protected double movingRange(ChartDataModel dataModel)
                      throws DataFormatException
Calculates moving range.

Parameters:
dataModel - source data model
Returns:
moving range value.
Throws:
DataFormatException - when the input data are invalid.

getMovingRange

protected double getMovingRange(ChartDataModel dataModel,
                                int j)
                         throws DataFormatException
Calculates a moving range. MR = |Xj - Xj-1| Xj - moving range for one step.

Parameters:
dataModel - measurement samples in the data model.
j - step number.
Returns:
moving rage for a step.
Throws:
DataFormatException

processSigma

protected double processSigma(ChartDataModel dataModel)
                       throws DataFormatException
Calculates process sigma.

Parameters:
dataModel - measurement samples in the data model.
Returns:
process sigma
Throws:
DataFormatException - when the input data are incorrect.

isNormalDistribution

protected boolean isNormalDistribution(ChartDataModel dataModel)
Checks if data is distributed according normal distribution. Performs Swilk-Shapiro test.

Parameters:
dataModel - source data model.
Returns:
if the data are distributed according normal distribution.

getData

protected java.util.List<java.lang.Object> getData(ChartDataModel dataModel)
Converts data model to the array list

Parameters:
dataModel - input data model.
Returns:
data model values packed in to the array list.