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} based on the marginal distribution. The chart relies on the standardized statistic Tt,i=k⋅σt,iπ^t,i(λ)−pi, where the π^t,i(λ), i=1,…,r, are the components of the EWMA estimator of the marginal distribution, pi is the marginal probability of category i, σt,i is the variance of π^t,i(λ) and k
is a constant set by the user. If min_max = FALSE, then only the statistics Ttmin=mini∈VTt,i and Ttmax=maxi∈VTt,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 distributioncycle_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