Overload List
| # | Signature | Description |
|---|---|---|
| 1 | void EWMAChart(TMtx Data, TVec DrawVec, ref Double CL, TVec UCL, TVec LCL, Double r, Double Confidence) | Calculates the Exponential Weighted Moving Average (EWMA) control chart. |
| 2 | void EWMAChart(TMtx Data, TVec DrawVec, ref Double CL, ref Double UCL, ref Double LCL, Double r, Double Confidence) | Constructs EWMA Control Chart. |
Overload 1: void EWMAChart(TMtx Data, TVec DrawVec, ref Double CL, TVec UCL, TVec LCL, Double r, Double Confidence)
Calculates the Exponential Weighted Moving Average (EWMA) control chart.
| # | Name | Description |
|---|---|---|
| 1 | Data | Data of grouped responses. Each row contais a response at specific time. It's asumed the rows are in time order. |
| 2 | r | Weighting 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. |
| 3 | Confidence | |
| 4 | DrawVec | Returns the calculated EWMA chart points. |
| 5 | CL | Returns EWMA chart center line. |
| 6 | LCL | Returns EWMA chart lower control limits. In this case UCL and LCL are constant (asymptote) limits. |
| 7 | UCL | Returns EWMA chart upper control limits. In this case UCL and LCL are constant (asymptote) limits. |
Result: stored in self (calling object)
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.
using Dew.Math;
using Dew.Math.Units;
using Dew.Stats.Units;
namespace Dew.Examples
{
private void Example(Steema.TeeChart.Styles.Line Series1, Steema.TeeChart.Styles.Line Series2,
Steema.TeeChart.Styles.Line Series3)
{
Matrix data = new Matrix(0,0);
Vector lcl = new Vector(0);
Vector ucl = new Vector(0);
double cl;
data.LoadFromFile("ewma_data.vec");
StatControlCharts.EWMAChart(data,drawvec,out cl,ucl,lcl,0.25,0.95);
MtxVecTee.DrawValues(drawvec,Series1,0,1,false);
// Series2 and Series3 are used for displaying control limits.
MtxVecTee.DrawValues(lcl,Series2,0,1,false);
MtxVecTee.DrawValues(ucl,Series3,0,1,false);
}
}
Overload 2: void EWMAChart(TMtx Data, TVec DrawVec, ref Double CL, ref Double UCL, ref Double LCL, Double r, Double Confidence)
Constructs EWMA Control Chart.
| # | Name | Type | Description |
|---|---|---|---|
| 1 | Data | TMtx | source TMtx |
| 2 | DrawVec | TVec | source TVec |
| 3 | CL | Double (ref) | output |
| 4 | UCL | Double (ref) | output |
| 5 | LCL | Double (ref) | output |
| 6 | r | Double | scalar |
| 7 | Confidence | Double | scalar |
Result: stored in self (calling object)
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.