Learn R Programming

spc (version 0.7.1)

xewma.q.prerun: Compute RL quantiles of EWMA control charts in case of estimated parameters

Description

Computation of quantiles of the Run Length (RL) for EWMA control charts monitoring normal mean if the in-control mean, standard deviation, or both are estimated by a pre run.

Usage

xewma.q.prerun(l, c, mu, p, zr=0, hs=0, sided="two", limits="fix", q=1, size=100,
df=NULL, estimated="mu", qm.mu=30, qm.sigma=30, truncate=1e-10, bound=1e-10)

xewma.q.crit.prerun(l, L0, mu, p, zr=0, hs=0, sided="two", limits="fix", size=100, df=NULL, estimated="mu", qm.mu=30, qm.sigma=30, truncate=1e-10, bound=1e-10, c.error=1e-10, p.error=1e-9, OUTPUT=FALSE)

Value

Returns a single value which resembles the RL quantile of order q.

Arguments

l

smoothing parameter lambda of the EWMA control chart.

c

critical value (similar to alarm limit) of the EWMA control chart.

mu

true mean shift.

p

quantile level.

zr

reflection border for the one-sided chart.

hs

so-called headstart (give fast initial response).

sided

distinguish between one- and two-sided EWMA control chart by choosing "one" and "two", respectively.

limits

distinguish between different control limits behavior.

q

change point position. For \(q=1\) and \(\mu=\mu_0\) and \(\mu=\mu_1\), the usual zero-state ARLs for the in-control and out-of-control case, respectively, are calculated. For \(q>1\) and \(\mu!=0\) conditional delays, that is, \(E_q(L-q+1|L\geq)\), will be determined. Note that mu0=0 is implicitely fixed.

size

pre run sample size.

df

Degrees of freedom of the pre run variance estimator. Typically it is simply size - 1. If the pre run is collected in batches, then also other values are needed.

estimated

name the parameter to be estimated within the "mu", "sigma", "both".

qm.mu

number of quadrature nodes for convoluting the mean uncertainty.

qm.sigma

number of quadrature nodes for convoluting the standard deviation uncertainty.

truncate

size of truncated tail.

bound

control when the geometric tail kicks in; the larger the quicker and less accurate; bound should be larger than 0 and less than 0.001.

L0

in-control quantile value.

c.error

error bound for two succeeding values of the critical value during applying the secant rule.

p.error

error bound for the quantile level p during applying the secant rule.

OUTPUT

activate or deactivate additional output.

Author

Sven Knoth

Details

Essentially, the ARL function xewma.q is convoluted with the distribution of the sample mean, standard deviation or both. For details see Jones/Champ/Rigdon (2001) and Knoth (2014?).

References

L. A. Jones, C. W. Champ, S. E. Rigdon (2001), The performance of exponentially weighted moving average charts with estimated parameters, Technometrics 43, 156-167.

S. Knoth (2003), EWMA schemes with non-homogeneous transition kernels, Sequential Analysis 22, 241-255.

S. Knoth (2004), Fast initial response features for EWMA Control Charts, Statistical Papers 46, 47-64.

S. Knoth (2014?), tbd, tbd, tbd-tbd.

K.-H. Waldmann (1986), Bounds for the distribution of the run length of geometric moving average charts, Appl. Statist. 35, 151-158.

See Also

xewma.q for the usual RL quantiles computation of EWMA control charts.

Examples

Run this code
## Jones/Champ/Rigdon (2001)

c4m <- function(m, n) sqrt(2)*gamma( (m*(n-1)+1)/2 )/sqrt( m*(n-1) )/gamma( m*(n-1)/2 )

n <- 5 # sample size
m <- 20 # pre run with 20 samples of size n = 5
C4m <- c4m(m, n) # needed for bias correction

# Table 1, 3rd column
lambda <- 0.2
L <- 2.636

xewma.Q <- Vectorize("xewma.q", "mu")
xewma.Q.prerun <- Vectorize("xewma.q.prerun", "mu")

mu <- c(0, .25, .5, 1, 1.5, 2)
Q1  <- ceiling(xewma.Q(lambda, L, mu, 0.1, sided="two"))
Q2  <- ceiling(xewma.Q(lambda, L, mu, 0.5, sided="two"))
Q3  <- ceiling(xewma.Q(lambda, L, mu, 0.9, sided="two"))

cbind(mu, Q1, Q2, Q3)

if (FALSE) {
p.Q1 <- xewma.Q.prerun(lambda, L/C4m, mu, 0.1, sided="two", 
size=m, df=m*(n-1), estimated="both")
p.Q2 <- xewma.Q.prerun(lambda, L/C4m, mu, 0.5, sided="two",
size=m, df=m*(n-1), estimated="both")
p.Q3 <- xewma.Q.prerun(lambda, L/C4m, mu, 0.9, sided="two",
size=m, df=m*(n-1), estimated="both")

cbind(mu, p.Q1, p.Q2, p.Q3)
}

## original values are
#    mu Q1  Q2  Q3 p.Q1 p.Q2 p.Q3
#  0.00 25 140 456   13   73  345
#  0.25 12  56 174    9   46  253
#  0.50  7  20  56    6   20  101
#  1.00  4   7  15    3    7   18
#  1.50  3   4   7    2    4    8
#  2.00  2   3   5    2    3    5

Run the code above in your browser using DataLab