--- title: "Statistical Foundations of IQCC" author: "Flavio Barros and contributors" date: "`r Sys.Date()`" output: rmarkdown::html_vignette vignette: > %\VignetteIndexEntry{Statistical Foundations of IQCC} %\VignetteEngine{knitr::rmarkdown} %\VignetteEncoding{UTF-8} --- ```{r setup, include=FALSE} knitr::opts_chunk$set( collapse = TRUE, comment = "#>", fig.width = 7, fig.height = 5 ) library(IQCC) ``` # Overview IQCC focuses on control charts whose classical normal limits may be poorly calibrated because the monitored statistic is discrete, skewed, bounded, or strongly non-normal. The package combines three ideas: 1. compute limits on the original measurement scale; 2. evaluate actual false-alarm probabilities whenever possible; 3. validate formulas against independent calculations and published examples. # Binomial p chart For \[ X\sim\operatorname{Binomial}(n,p),\qquad \hat p=X/n, \] \[ E(\hat p)=p,\qquad \operatorname{Var}(\hat p)=\frac{p(1-p)}{n}. \] The normal limits use \[ p\pm z\sqrt{\frac{p(1-p)}{n}}. \] The first Cornish-Fisher correction adds \[ \frac{(z^2-1)(1-2p)}{6n} \] to the normal quantile on the original p scale. ```{r pchart-example} pchart_table <- do.call( rbind, lapply(c("normal", "cf1", "cf2"), function(method) { lim <- pchart_limits(p = 0.015, n = 20, type = method) risk <- pchart_alpha_risk( p = 0.015, n = 20, lcl = lim$lcl, ucl = lim$ucl ) data.frame( method = method, lcl = lim$lcl, center = lim$center, ucl = lim$ucl, alpha = risk, arl0 = ifelse(risk == 0, Inf, 1 / risk) ) }) ) pchart_table ``` For unequal subgroup sizes, IQCC estimates the in-control proportion using the pooled estimator \[ \hat p_0=\frac{\sum_i X_i}{\sum_i n_i}. \] # Poisson u chart Let \[ X\sim\operatorname{Poisson}(\lambda n),\qquad U=X/n. \] Then \[ E(U)=\lambda,\qquad \operatorname{Var}(U)=\frac{\lambda}{n}. \] ```{r uchart-example} u_table <- do.call( rbind, lapply(c("normal", "cf1", "cf2"), function(method) { lim <- uchart_limits(lambda = 0.15, n = 20, type = method) risk <- uchart_alpha_risk( lambda = 0.15, n = 20, lcl = lim$lcl, ucl = lim$ucl ) data.frame( method = method, lcl = lim$lcl, center = lim$center, ucl = lim$ucl, alpha = risk, arl0 = ifelse(risk == 0, Inf, 1 / risk) ) }) ) u_table ``` # Double-sampling np chart Let \[ D_1\sim\operatorname{Binomial}(n_1,p),\qquad D_2\sim\operatorname{Binomial}(n_2,p), \] independently. Define \[ a=\lfloor WL\rfloor,\qquad b=\lfloor UCL_1\rfloor+1,\qquad c=\lfloor UCL_2\rfloor. \] The decision rule is: - accept at stage 1 when \(D_1\leq a\); - signal at stage 1 when \(D_1\geq b\); - continue when \(a\n") ``` # Validation strategy IQCC combines algebraic property tests, independently coded numerical oracles, and reproduction of published numerical examples. This is particularly important because a plausible formula may still use a different tail convention, integer threshold, or parameter-estimation rule than the intended method. # References - Joekes, S. and Barbosa, E. P. (2013). An improved attribute control chart for monitoring non-conforming proportion in high quality processes. *Control Engineering Practice*, 21, 407-412. - Joekes, S., Smrekar, M. and Barbosa, E. P. (2015). Extending a double sampling control chart for non-conforming proportion in high quality processes to the case of small samples. *Statistical Methodology*, 23, 35-49. - Barbosa, E. P., Gneri, M. A. and Meneguetti, A. *Improving Shewhart-type Generalized Variance Control Charts for Multivariate Process Variability Monitoring using Cornish-Fisher Quantile Correction, Meijer-G Function and Other Tools*.