plot_mcc function

Constructs a control chart for the marginal distribution of a categorical series

Constructs a control chart for the marginal distribution of a categorical series

plot_mcc constructs a control chart for the marginal distribution of a categorical series UTF-8

plot_mcc( series, c, sigma, lambda = 0.99, k = 3.3, min_max = FALSE, plot = TRUE, title = "Control chart (marginal)", ... )

Arguments

  • series: An object of type tsibble (see R package tsibble), whose column named Value contains the values of the corresponding CTS. This column must be of class factor and its levels must be determined by the range of the CTS.
  • c: The hypothetical marginal distribution.
  • sigma: A matrix containing the variances for each category (columns) and each time t (rows).
  • lambda: The constant lambda to construct the EWMA estimator.
  • k: The constant k to construct the k sigma limits.
  • min_max: Logical. If min_max = FALSE (default), the standard control chart for the marginal distribution is plotted. Otherwise, the reduced control chart is plotted, i.e., only the minimum and maximum values of the standardized statistics (with respect to the set of categories) are considered.
  • plot: Logical. If plot = TRUE (default), returns the control chart. Otherwise, returns the standardized statistics or their maximum and minimum value for each time t.
  • title: The title of the graph.
  • ...: Additional parameters for the function.

Returns

If plot = TRUE (default), represents the control chart for the marginal distribution. Otherwise, the function returns a matrix with the values of the standardized statistics for each time t

Details

Constructs a control chart of a CTS with range V={1,,r}\mathcal{V}=\{1, \ldots, r\} based on the marginal distribution. The chart relies on the standardized statistic Tt,i=π^t,i(λ)pikσt,iT_{t, i}=\frac{\hat{\pi}_{t, i}^{(\lambda)}-p_i}{k \cdot \sigma_{t, i}}, where the π^t,i(λ)\hat{\pi}_{t, i}^{(\lambda)}, i=1,,ri=1,\ldots,r, are the components of the EWMA estimator of the marginal distribution, pip_i is the marginal probability of category ii, σt,i\sigma_{t,i} is the variance of π^t,i(λ)\hat{\pi}_{t, i}^{(\lambda)} and kk

is a constant set by the user. If min_max = FALSE, then only the statistics Ttmin=miniVTt,iT_t^{\min }=\min_{i \in \mathcal{V}} T_{t, i} and Ttmax=maxiVTt,iT_t^{\max }=\max_{i \in \mathcal{V}} T_{t, i} are plotted. An out-of-control alarm is signalled if the statistics are below -1 or above 1.

Examples

sequence_1 <- SyntheticData1[which(SyntheticData1$Series==1),] cycle_cc <- plot_ccc(series = sequence_1, mu_t = c(1, 1.5, 1), lcl_t = rep(10, 600), ucl_t = rep(10, 600)) cycle_md <- plot_mcc(series = sequence_1, c = c(0.3, 0.3, 0.4), sigma = matrix(rep(c(1, 1, 1), 600), nrow = 600)) # Representing # a control chart for the marginal distribution cycle_md <- plot_mcc(series = sequence_1, c = c(0.3, 0.3, 0.4), sigma = matrix(rep(c(1, 1, 1), 600), nrow = 600), plot = FALSE) # Computing the # corresponding standardized statistic

References

Rdpack::insert_ref(key="weiss2008visual",package="ctsfeatures")

Author(s)

Ángel López-Oriona, José A. Vilar

  • Maintainer: Angel Lopez-Oriona
  • License: GPL-2
  • Last published: 2024-01-29

Useful links