EwmaParams#
- class mqr.spc.EwmaParams(mu_0: float, sigma: float, lmda: float, L: float, steady_state: bool = False, name: str = 'EWMA')#
EWMA control parameters.
Use this class to construct EWMA charts for the mean of a sample. In addition to construction using class attributes, EwmaParams can be constructed from historical data.
- Attributes:
- mu_ofloat
Desired process mean.
- sigmafloat
Process standard deviation.
- lmdafloat
Decay rate.
- Lfloat
Width of the control limits, in multiples of the standard deviation of the smoothed mean.
- steady_statebool, optional
Whether the process has already decayed to the steady state control limits.
- namestr, optional
Name of the control method.
Methods
asdict
()Returns a dict representation of this class.
from_data
(samples, lmda, L[, steady_state])Constructs an instance of EwmaParams from reference samples.
from_stddev
(mu_0, s_bar, nobs, lmda, L[, ...])Constructs EwmaParams from an average sample stddev.
lcl
(nobs)Calculates the lower control limits for samples with sizes in nobs.
statistic
(samples)Exponentially weighted average of the samples.
target
()Desired process mean.
ucl
(nobs)Calculates the upper control limits for samples with sizes in nobs.
Notes
This monitoring strategy tracks a statistic based on either an observation or a sample. When the sample size is 1, the statistic is the EWMA of those samples. When the sample size is > 1, the statistic is the EWMA of the mean of those samples.
The parameter sigma is an estimate of the standard deviation of the process, but the control limits are calculated from the standard error of the mean. When the sample size is 1, the standard error of the mean equals the standard deviation of the process.
When the EwmaParams are created from data, nobs in the historical data need not match the sample size used to create the tracked statistic. The control limits will be scaled appropriately for the given sample size.