Library: | spc |
See also: | spccusum2arl spccusum2c spccusum2pmfm spccusum1pmfm |
Quantlet: | spccusum2pmf | |
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 for given i. The data are normally distributed with variance 1. |
Usage: | pLi = spccusum2pmf (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 points 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 at defined points Li. |
!! On the contrary to spccusum2arl this quantlet 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 in {1,10,20,30,40,50,75,100,150,200}: library("spc") Li = #(1,10,20,30,40,50,75,100,150,200) c = spccusum2c(100, 0.5, 50) pLi = spccusum2pmf(0,0.5,c,Li,20) Li~pLi
Contents of _tmp [ 1,] 1 6.2646e-05 6.2646e-05 [ 2,] 10 0.0096076 0.066119 [ 3,] 20 0.0088375 0.1585 [ 4,] 30 0.0079618 0.24198 [ 5,] 40 0.0071719 0.31719 [ 6,] 50 0.0064603 0.38493 [ 7,] 75 0.0049752 0.52633 [ 8,] 100 0.0038315 0.63522 [ 9,] 150 0.0022723 0.78366 [10,] 200 0.0013477 0.87169