Library: | spc |
See also: | spccusum2arl spccusum2c spccusum2pmf spccusum1pmfm |
Quantlet: | spccusum2pmfm | |
Description: | Computes the probability mass function (PMF, P(L=i)) and the cumulative distribution function (CDF, P(L<=i)) of the two-sided CUSUM chart run length up to a given i. The data are normally distributed with variance 1. |
Usage: | pLi = spccusum2pmfm (mu, k, c, Li, r) | |
Input: | ||
mu | scalar, expected value of the user-defined random variable | |
k | scalar, reference value. It must be positive and be expressed as a multiple of the standard error. | |
c | scalar, critical value | |
Li | scalar, ARL of a SPC scheme starting in point Li | |
r | scalar, matrix dimension of the approximating two-dimensional Markov chain. | |
Output: | ||
pLi | n x 1 vector containing the values of the probability mass function and the corresponding cumulative distribution function up to a defined point Li. |
!! On the contrary to spccusum2arl this routine is based on a two-dimensional Markov chain, i.e. values of r larger than 30 lead to large computational amount !!
; PMF and CDF of the two-sided CUSUM run length with ; in-control ARL = 100, reference value k = 0.5 and ; matrix dimension 50 and 20(of the approximating two-dimensional ; Markov chain) for i=1 to i=10: library("spc") c = spccusum2c(100, 0.5, 50) pLi = spccusum2pmfm(0,0.5,c,10,20) pLi
Contents of pLi [ 1,] 6.2646e-05 6.2646e-05 [ 2,] 0.001477 0.0015397 [ 3,] 0.0040532 0.0055929 [ 4,] 0.0062739 0.011867 [ 5,] 0.0077653 0.019632 [ 6,] 0.0086693 0.028301 [ 7,] 0.0091827 0.037484 [ 8,] 0.0094527 0.046937 [ 9,] 0.0095747 0.056511 [10,] 0.0096076 0.066119