File: xshewhartrunsrules.arl.R

package info (click to toggle)
r-cran-spc 1%3A0.7.1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,888 kB
  • sloc: ansic: 22,279; makefile: 2
file content (21 lines) | stat: -rw-r--r-- 403 bytes parent folder | download | duplicates (7)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21

xshewhartrunsrules.arl <- function(mu, c=1, type="12") {

# Shewhart chart
  if (type=="1") {
    p0  <- pnorm(  3*c, mean=mu ) - pnorm( -3*c, mean=mu)
    arls <- 1/(1-p0)
  }

# ditto with runs rules
  if (type!="1") {
    Q <- xshewhartrunsrules.matrix(mu, c=c, type=type)
    dimQ <- nrow(Q)
    one <- rep(1, dimQ)
    I   <- diag(1, dimQ)
    arls <- solve(I-Q, one)
  }

  arl <- arls[1]
  arl
}