StatControlCharts.EWMAChart Method

Overload List

#SignatureDescription
1procedure EWMAChart(const Data: TMtx; const DrawVec: TVec; out CL: Double; UCL: TVec; LCL: TVec; r: Double; Confidence: Double);Calculates the Exponential Weighted Moving Average (EWMA) control chart.
2procedure EWMAChart(const Data: TMtx; const DrawVec: TVec; out CL: Double; out UCL: Double; out LCL: Double; r: Double; Confidence: Double);Constructs EWMA Control Chart.

Overload 1: procedure EWMAChart(const Data: TMtx; const DrawVec: TVec; out CL: Double; UCL: TVec; LCL: TVec; r: Double; Confidence: Double);

Calculates the Exponential Weighted Moving Average (EWMA) control chart.

#NameDescription
1DataData of grouped responses. Each row contais a response at specific time. It's asumed the rows are in time order.
2rWeighting constant that weights past and current information. If, for example, r=0.3, 70% of the weight will be given to past information and 30% to current information. Typically a r between 0.1 and 0.4 provides a reasonable balance between past and current information and 0.2 is very common in actual practice.
3Confidence
4DrawVecReturns the calculated EWMA chart points.
5CLReturns EWMA chart center line.
6LCLReturns EWMA chart lower control limits. In this case UCL and LCL are constant (asymptote) limits.
7UCLReturns EWMA chart upper control limits. In this case UCL and LCL are constant (asymptote) limits.

Result: stored in self (calling object)

Remarks:

In this case UCL and LCL are not constant, but use an exact formula to calculate control limits for each point. It's worth noting that UCL and LCL values rapidly approach the asymptote value.

See Also: !:TQCSeries, QCSeries

Overload 2: procedure EWMAChart(const Data: TMtx; const DrawVec: TVec; out CL: Double; out UCL: Double; out LCL: Double; r: Double; Confidence: Double);

Constructs EWMA Control Chart.

#NameTypeDescription
1DataTMtx
2DrawVecTVec
3CLDouble
4UCLDouble
5LCLDouble
6rDoublescalar
7ConfidenceDoublescalar

Result: stored in self (calling object)

Remarks:

Calculates the Exponential Weighted Moving Average (EWMA) control chart. In this case UCL and LCL are constant (asymptote) limits. This chart is also known as exponentially smoothed or geometric moving average chart. It evaluates the process level using an exponentially smoothed moving average. Here, by the term exponentially, we mean the procedure by which individual observations or subgroups are given progressively less importance or weight. When compared to the XChart, the EWMA chart is more sensitive to smaller shifts in the process level.

The exponentially weighted moving average is defined as

XHat[t] = r*XHat[t] + (1-r)XHat[t-1] ,

where r is a constant and XHat[t] are EWMA chart points. The starting value for the first sample at time t = 1 = XHat[0] is grand mean value.

Examples
uses MtxExpr, Math387, StatControlCharts, MtxVecTee, StatSeries;
procedure Example;
var CL: double;
UCL, LCL, DrawVec: Vector;
Data: Matrix
Confidence: double;
begin
    Data.LoadFromFile('ewma_data.mtx');
    EWMAChart(Data,DrawVec,CL,UCL,LCL,0.25,0.95);
    DrawValues(DrawVec,Series1);
    // Series2 and Series3 are line series used for displaying control limits
    DrawValues(UCL,Series2);
    DrawValues(LCL,Series3);
end;