Note: See Computing Average Run Lengths for EWMA Chart in the SAS/QC Sample Library.
The EWMAARL DATA step function computes the average run length for an exponentially weighted moving average (EWMA) scheme (refer to Crowder 1987a,b for details). You can use this function to design a scheme by first calculating average run lengths for a range of values for the weight and then choosing the weight that yields a desired average run length.
The following statements compute the average run lengths for shifts between 0.5 and 2 and weights between 0.25 and 1. The
data set ARLs
is displayed in Output 9.5.1.
data ARLs; do shift=.5 to 2 by .5; do Weight=.25 to 1 by .25; arl=ewmaarl(shift,Weight,3.0); output; end; end; run;
Note that when the weight is 1.0, the EWMAARL function returns the average run length for a Shewhart chart for means. For more details, see EWMAARL Function.
In addition to using the EWMAARL function to design a EWMA scheme with desired average run length properties, you can use it to evaluate an existing scheme. For example, suppose you have an EWMA chart with control limits using a weight parameter of 0.3. The following DATA step computes the average run lengths for various shifts using this scheme:
data ARLinfo; do shift=0 to 2 by .25; arl = ewmaarl(shift,0.3,3.0); output; end; run;
The data set ARLinfo
is displayed in Output 9.5.2.