JMSLTM Numerical Library 6.1

com.imsl.chart.qc
Class CuSumStatus

java.lang.Object
  extended by com.imsl.chart.AbstractChartNode
      extended by com.imsl.chart.ChartNode
          extended by com.imsl.chart.Data
              extended by com.imsl.chart.qc.ShewhartControlChart
                  extended by com.imsl.chart.qc.CuSumStatus
All Implemented Interfaces:
Serializable, Cloneable

public class CuSumStatus
extends ShewhartControlChart

CuSumStatus is a cumulative sum status chart. CuSumStatus plots the tabular CuSum results.

The one-sided upper and lower cusums, C^{+} and C^{-} are computed. These are plotted as two bar charts. The C^{+} are plotted as a bar chart above the x-axis and C^{-} is below the axis. By default, in-control bars are green and out-of-control bars are red.

Control limit lines are drawn at pm h, where h is the value of the getAbsoluteH. This can be set either to an absolute number, using setAbsoluteH, or relative to the standard deviation of the data, using setRelativeH.

See Also:
CuSum, Example, Serialized Form

Field Summary
 
Fields inherited from class com.imsl.chart.qc.ShewhartControlChart
d2, d3
 
Fields inherited from class com.imsl.chart.ChartNode
AXIS_X_TOP, AXIS_Y_RIGHT, BAR_TYPE_HORIZONTAL, BAR_TYPE_VERTICAL, DASH_PATTERN_DASH, DASH_PATTERN_DASH_DOT, DASH_PATTERN_DOT, DASH_PATTERN_SOLID, DATA_TYPE_FILL, DATA_TYPE_LINE, DATA_TYPE_MARKER, DATA_TYPE_PICTURE, DATA_TYPE_TUBE, DENDROGRAM_TYPE_HORIZONTAL, DENDROGRAM_TYPE_VERTICAL, FILL_TYPE_GRADIENT, FILL_TYPE_NONE, FILL_TYPE_PAINT, FILL_TYPE_SOLID, LABEL_TYPE_PERCENT, MARKER_TYPE_ASTERISK, MARKER_TYPE_CIRCLE_CIRCLE, MARKER_TYPE_CIRCLE_PLUS, MARKER_TYPE_CIRCLE_X, MARKER_TYPE_DIAMOND_PLUS, MARKER_TYPE_FILLED_CIRCLE, MARKER_TYPE_FILLED_DIAMOND, MARKER_TYPE_FILLED_SQUARE, MARKER_TYPE_FILLED_TRIANGLE, MARKER_TYPE_HOLLOW_CIRCLE, MARKER_TYPE_HOLLOW_DIAMOND, MARKER_TYPE_HOLLOW_SQUARE, MARKER_TYPE_HOLLOW_TRIANGLE, MARKER_TYPE_OCTAGON_PLUS, MARKER_TYPE_OCTAGON_X, MARKER_TYPE_PLUS, MARKER_TYPE_SQUARE_PLUS, MARKER_TYPE_SQUARE_X, MARKER_TYPE_X, TEXT_X_CENTER, TEXT_X_LEFT, TEXT_X_RIGHT, TEXT_Y_BOTTOM, TEXT_Y_CENTER, TEXT_Y_TOP
 
Fields inherited from class com.imsl.chart.AbstractChartNode
AUTOSCALE_DATA, AUTOSCALE_DENSITY, AUTOSCALE_NUMBER, AUTOSCALE_OFF, AUTOSCALE_WINDOW, AXIS_X, AXIS_Y, AXIS_Z, LABEL_TYPE_NONE, LABEL_TYPE_TITLE, LABEL_TYPE_X, LABEL_TYPE_Y, LABEL_TYPE_Z, TRANSFORM_CUSTOM, TRANSFORM_LINEAR, TRANSFORM_LOG
 
Constructor Summary
CuSumStatus(AxisXY axis, double[] data, double expectedMean, double slackValue)
          Creates a CuSumStatus chart.
 
Method Summary
 Data addDataMarkers()
          Adds the original data to the chart on a newly created axis.
 Data addDataMarkers(AxisXY axisDataMarkers)
          Adds the original data to the chart.
 AxisXY createDataAxis()
          Creates a new axis to hold a cummulative line.
 double getAbsoluteH()
          Returns the value for H used for setting limits.
 Bar getBarMinus()
          Returns the value of the attribute "BarMinus" containing the C^{-} bars.
 Bar getBarPlus()
          Returns the value of the attribute "BarPlus" containing the C^{+} bars.
 double[] getCMinus()
          Returns the C^{-} values.
 double[] getCPlus()
          Returns the C^{+} values.
 Data getDataMarkers()
          Returns the "DataMarkers" attribute containing the data markers.
 AxisXY getDataMarkersAxis()
          Returns the "DataMarkersAxis" attribute containing the axis associated with the data markers.
 double getExpectedMean()
          Returns the expected (target) mean value.
 double getInitialCMinus()
          Returns the initial value of C^{-}.
 double getInitialCPlus()
          Returns the initial value of C^{+}.
 int[] getNMinus()
          Returns N^{-}, the number of consecutive periods that the cusums C_i^{-} have been nonzero.
 int[] getNPlus()
          Returns N^{+}, the number of consecutive periods that the cusums C_i^{+} have been nonzero.
 double getRelativeH()
          Returns the value for relative h.
 double getSigma()
          Returns the standard deviation of the data.
 double getSlackValue()
          Returns the slack value.
 void prePaint()
          Setup chart with current settings.
 void print()
          Prints the tabular CuSum results.
 void setAbsoluteH(double H)
          Sets the value for h used for setting limits.
 void setExpectedMean(double expectedMean)
          Sets the expected mean of all of the data from all of the samples.
 void setInitialCMinus(double initialCMinus)
          Sets the initial value of C^{-}.
 void setInitialCPlus(double initialCPlus)
          Sets the initial value of C^{+}.
 void setRelativeH(double h)
          Sets the value for relative h.
 void setSigma(double sigma)
          Sets the standard deviation of the data.
 void setX(double[] x)
          Sets the x-coordinates of the bars.
 
Methods inherited from class com.imsl.chart.qc.ShewhartControlChart
addCenterLine, addControlLimit, addLowerControlLimit, addUpperControlLimit, addWecoLimits, dataRange, getCenter, getCenterLine, getControlData, getLowerControlLimit, getMeanSampleSize, getSampleSize, getUpperControlLimit, paint, removeControlLimit, setCenter, setData, setData, setSampleSize, setSampleSize
 
Methods inherited from class com.imsl.chart.Data
formatLabel
 
Methods inherited from class com.imsl.chart.ChartNode
addPickListener, firePickListeners, getALT, getAxis, getBackground, getBarGap, getBarType, getBarWidth, getChart, getChartTitle, getChildren, getClipData, getComponent, getConcatenatedViewport, getDataType, getDoubleBuffering, getExplode, getFillOutlineColor, getFillOutlineType, getFillPaint, getFillType, getGradient, getHREF, getLegend, getLineDashPattern, getMarkerDashPattern, getMarkerThickness, getMarkerType, getParent, getReference, getScreenAxis, getScreenSize, getScreenViewport, getSize, getSkipWeekends, getTextAngle, getTextColor, getTitle, getToolTip, getViewport, isBitSet, removePickListener, setALT, setBarGap, setBarType, setBarWidth, setChartTitle, setClipData, setCustomTransform, setDataType, setDoubleBuffering, setExplode, setFillOutlineColor, setFillOutlineColor, setFillOutlineType, setFillPaint, setFillPaint, setFillPaint, setFillType, setGradient, setGradient, setGradient, setHREF, setImage, setLineDashPattern, setMarkerDashPattern, setMarkerThickness, setMarkerType, setReference, setScreenSize, setSize, setSkipWeekends, setTextAngle, setTextColor, setTextColor, setTitle, setTitle, setToolTip, setViewport, setViewport
 
Methods inherited from class com.imsl.chart.AbstractChartNode
clone, clone, clone, clone, getAbstractParent, getAttribute, getAutoscaleInput, getAutoscaleMinimumTimeInterval, getAutoscaleOutput, getBooleanAttribute, getChildList, getColorAttribute, getCustomTransform, getDensity, getDoubleAttribute, getFillColor, getFont, getFontName, getFontSize, getFontStyle, getImage, getIntegerAttribute, getLabelType, getLightColor, getLineColor, getLineWidth, getLocale, getMarkerColor, getMarkerSize, getName, getNumber, getPaint, getStringAttribute, getTextFormat, getTickLength, getTransform, getX, getY, isAncestorOf, isAttributeSet, isAttributeSetAtThisNode, parseColor, remove, setAttribute, setAutoscaleInput, setAutoscaleMinimumTimeInterval, setAutoscaleOutput, setDensity, setFillColor, setFillColor, setFont, setFontName, setFontSize, setFontStyle, setImage, setLabelType, setLightColor, setLightColor, setLineColor, setLineColor, setLineWidth, setLocale, setMarkerColor, setMarkerColor, setMarkerSize, setName, setNumber, setPaint, setTextFormat, setTextFormat, setTickLength, setTransform, setX, setY, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

CuSumStatus

public CuSumStatus(AxisXY axis,
                   double[] data,
                   double expectedMean,
                   double slackValue)
Creates a CuSumStatus chart.

Parameters:
axis - the AxisXY parent of this node
data - is an array of measurements of a continuous variable.
expectedMean - is the expected (or target) mean.
slackValue - is the slack value. This is also called K, or the reference value or the allowance.
Method Detail

addDataMarkers

public Data addDataMarkers()
Adds the original data to the chart on a newly created axis. The new axis is stored as attribute "DataMarkersAxis" and the new Data node is stored as attribute "DataMarkers".

Returns:
the Data object containing the markers.

addDataMarkers

public Data addDataMarkers(AxisXY axisDataMarkers)
Adds the original data to the chart. The axis is stored as attribute "DataMarkersAxis" and the new Data node is stored as attribute "DataMarkers".

Parameters:
axisDataMarkers - is the axis for the data markers.
Returns:
the Data object containing the markers.

createDataAxis

public AxisXY createDataAxis()
Creates a new axis to hold a cummulative line. The created axis is drawn on the right side. Its x-axis is not drawn, since it would overlap with the primary chart axis. The x-axis is set to have the same window size as the orignal axis and its autoscaling attribute is turned off.

Returns:
the newly created axis.

getAbsoluteH

public double getAbsoluteH()
Returns the value for H used for setting limits. There is no attribute "AbsoluteH". This method computes its value using the value of the attribute "RelativeH".

Returns:
the value for H.

getBarMinus

public Bar getBarMinus()
Returns the value of the attribute "BarMinus" containing the C^{-} bars. To access the C^{-} bars for where the process is in control, apply the method getBarSet(0,0) to the Bar object returned by this method. For the bars for where the process is not in control, apply the method getBarSet(1,0) to the Bar object returned by this method.

Returns:
the Bar object for the negative CuSum bars.

getBarPlus

public Bar getBarPlus()
Returns the value of the attribute "BarPlus" containing the C^{+} bars. To access the C^{+} bars for where the process is in control, apply the method getBarSet(0,0) to the Bar object returned by this method. For the bars for where the process is not in control, apply the method getBarSet(1,0) to the Bar object returned by this method.

Returns:
the Bar object for the positive CuSum bars.

getCMinus

public double[] getCMinus()
Returns the C^{-} values.

Returns:
an array containing the C^{-} values.

getCPlus

public double[] getCPlus()
Returns the C^{+} values.

Returns:
an array containing the C^{+} values.

getDataMarkers

public Data getDataMarkers()
Returns the "DataMarkers" attribute containing the data markers.

Returns:
the data markers Data object.

getDataMarkersAxis

public AxisXY getDataMarkersAxis()
Returns the "DataMarkersAxis" attribute containing the axis associated with the data markers. This is normally the right-side axis.

Returns:
AxisXY associated with the data markers.

getExpectedMean

public double getExpectedMean()
Returns the expected (target) mean value.

Returns:
the expected (target) mean value.

getInitialCMinus

public double getInitialCMinus()
Returns the initial value of C^{-}. This is used to initiate a fast initial response (headstart). Typically, this would be set to H/2 for a 50% headstart. Its default value is zero.

Returns:
initialCMinus is the initial value for C^{-}.

getInitialCPlus

public double getInitialCPlus()
Returns the initial value of C^{+}. This is used to initiate a fast initial response (headstart). Typically, this would be set to H/2 for a 50% headstart. Its default value is zero.

Returns:
initialCPlus is the initial value for C^{+}.

getNMinus

public int[] getNMinus()
Returns N^{-}, the number of consecutive periods that the cusums C_i^{-} have been nonzero.

Returns:
an array containing the N^{-} values.

getNPlus

public int[] getNPlus()
Returns N^{+}, the number of consecutive periods that the cusums C_i^{+} have been nonzero.

Returns:
an array containing the N^{+} values.

getRelativeH

public double getRelativeH()
Returns the value for relative h. This is the value of the attribute "RelativeH". Its default value is 3.0.

Returns:
the relative h value.

getSigma

public double getSigma()
Returns the standard deviation of the data.

Returns:
a double containing the standard deviation.

getSlackValue

public double getSlackValue()
Returns the slack value. This is also called K, or the reference value or the allowance.

Returns:
the slack value.

prePaint

public void prePaint()
Setup chart with current settings.

Overrides:
prePaint in class ChartNode

print

public void print()
Prints the tabular CuSum results. This prints the input data, C^{+}, N^{+}, C^{-}, and N^{-}.


setAbsoluteH

public void setAbsoluteH(double H)
Sets the value for h used for setting limits. The relative h and absolute H are related by H = hsigma. There is no attribute "AbsoluteH". This method sets the attribute "RelativeH".

Parameters:
H - the value for absolute H.

setExpectedMean

public void setExpectedMean(double expectedMean)
Sets the expected mean of all of the data from all of the samples. The value of the ExpectedMean attribute is either the expected mean value or the target mean. This defaults to the mean of the xbar data given to the constructor.

Parameters:
expectedMean - is the expected mean of all of the data.

setInitialCMinus

public void setInitialCMinus(double initialCMinus)
Sets the initial value of C^{-}. This is used to to initiate a fast initial response (headstart). Typically, this would be set to H/2 for a 50% headstart.

Parameters:
initialCMinus - is the initial value for C^{-}.

setInitialCPlus

public void setInitialCPlus(double initialCPlus)
Sets the initial value of C^{+}. This is used to initiate a fast initial response (headstart). Typically, this would be set to H/2 for a 50% headstart.

Parameters:
initialCPlus - is the initial value for C^{+}.

setRelativeH

public void setRelativeH(double h)
Sets the value for relative h. This sets the value of the attribute "RelativeH".

Parameters:
h - the value for h.

setSigma

public void setSigma(double sigma)
Sets the standard deviation of the data. The default is the sample standard deviation of the data used to construct the chart.

Parameters:
sigma - is the value to be used for the standard deviation.

setX

public void setX(double[] x)
Sets the x-coordinates of the bars. This also sets the "BarWidth" attribute to (x[1]-x[0])/2.

Overrides:
setX in class ShewhartControlChart
Parameters:
x - is an array containing the x-coordinates. Its length must equal the length of the data array used to construct this object.

JMSLTM Numerical Library 6.1

Copyright © 1970-2010 Visual Numerics, Inc.
Built July 30 2010.