Title: | Multivariate Normal Mean Monitoring Through Critical-to-X Control Chart |
---|---|
Description: | A comprehensive set of functions designed for multivariate mean monitoring using the Critical-to-X Control Chart. These functions enable the determination of optimal control limits based on a specified in-control Average Run Length (ARL), the calculation of out-of-control ARL for a given control limit, and post-signal analysis to identify the specific variable responsible for a detected shift in the mean. This suite of tools provides robust support for precise and effective process monitoring and analysis. |
Authors: | Dr. Burcu Aytaçoğlu [aut] ([email protected]), Dr. Diana Barraza-Barraza [aut, cre] ([email protected]), Dr. Víctor G. Tercero-Gómez [aut] ([email protected]), Dr. A. Eduardo Cordero-Franco [aut] ([email protected]) |
Maintainer: | Dr. Diana Barraza-Barraza <[email protected]> |
License: | GPL (>= 2) |
Version: | 0.2.0 |
Built: | 2024-11-09 19:25:15 UTC |
Source: | CRAN |
Returns a matrix with values for C^2_1 and C^2_k|C^2_k-1,C^2_k-2, ..., C^2_1, k=2,3, 4... for all possible permutations among k variables
C2.allPerms(z, W, R)
C2.allPerms(z, W, R)
z |
observation vector, kx1 |
W |
matrix of variables weigths, kxk |
R |
correlation matrix, kxk |
Data frame where, the first k columns correspond to variable that entred the model first, second... k-th. The following (k+1) to 2*k columns contain the conditional contribution of the variable. The last column contains the sum of all contributions, meaning C^2_k
Dr. Burcu Aytaçoğlu ([email protected]) Dr. Diana Barraza-Barraza ([email protected]), Dr. Víctor G. Tercero-Gómez ([email protected]), Dr. A. Eduardo Cordero-Franco ([email protected]),
Paper
k<-3 sigma0 = matrix(diag(rep(1,k)),ncol = k) mu0 = matrix(c(0,0,0), ncol = 1) Weights = diag(c(0.5, 0.25,0.25)) library(mvtnorm) set.seed(1000) X = matrix(ncol= 1, data = rmvnorm(n = 1, mean = mu0, sigma = sigma0)) Z = (X - mu0)/sqrt(as.numeric(diag(sigma0))) Corr<-get.R(Sigma0 = sigma0) C2.allPerms(z = Z, W = Weights, R = Corr)
k<-3 sigma0 = matrix(diag(rep(1,k)),ncol = k) mu0 = matrix(c(0,0,0), ncol = 1) Weights = diag(c(0.5, 0.25,0.25)) library(mvtnorm) set.seed(1000) X = matrix(ncol= 1, data = rmvnorm(n = 1, mean = mu0, sigma = sigma0)) Z = (X - mu0)/sqrt(as.numeric(diag(sigma0))) Corr<-get.R(Sigma0 = sigma0) C2.allPerms(z = Z, W = Weights, R = Corr)
Returns contribution of variable z.var to C^2, even if there are no previous variables in the model
C2.Contribution(z, mean0, W, R, x.var, z.var = NULL)
C2.Contribution(z, mean0, W, R, x.var, z.var = NULL)
z |
observation vector, kx1, where z[x.var, ] correspond to variables already in the model |
mean0 |
Mean vector for multivariate random vector under the null hypothesis. Dimensions: kx1 |
W |
matrix of variables weigths, kxk |
R |
correlation matrix, kxk |
x.var |
vector indicating variables already present in the model. length: k-1 |
z.var |
scalar indicating variables to be included. Defaults to NULL, indicating there are no previous variables in the model |
C2.k.extra, scalar containing the contribution of variable z to C_k
Dr. Burcu Aytaçoğlu ([email protected]) Dr. Diana Barraza-Barraza ([email protected]), Dr. Víctor G. Tercero-Gómez ([email protected]), Dr. A. Eduardo Cordero-Franco ([email protected]),
Paper
k<-3 sigma0 = matrix(diag(rep(1,k)),ncol = k) mu0 = matrix(c(0,0,0), ncol = 1) Weights = diag(c(0.5, 0.25,0.25)) library(mvtnorm) set.seed(1000) X = matrix(ncol= 1, data = rmvnorm(n = 1, mean = mu0, sigma = sigma0)) Z = (X - mu0)/sqrt(as.numeric(diag(sigma0))) Corr<-get.R(Sigma0 = sigma0) C2.Contribution(z = Z, W = Weights, R = Corr, x.var = 1:2, z.var = 3)
k<-3 sigma0 = matrix(diag(rep(1,k)),ncol = k) mu0 = matrix(c(0,0,0), ncol = 1) Weights = diag(c(0.5, 0.25,0.25)) library(mvtnorm) set.seed(1000) X = matrix(ncol= 1, data = rmvnorm(n = 1, mean = mu0, sigma = sigma0)) Z = (X - mu0)/sqrt(as.numeric(diag(sigma0))) Corr<-get.R(Sigma0 = sigma0) C2.Contribution(z = Z, W = Weights, R = Corr, x.var = 1:2, z.var = 3)
Calculates the conditional decision limit for z, given x already in model, using the exact distribution for the conditional contribution of z to C_k
C2.DecisionLimit(z, mu.C, R.C, A, x.var, alpha)
C2.DecisionLimit(z, mu.C, R.C, A, x.var, alpha)
z |
observation vector, kx1, where z[x.var, ] correspond to variables already in the model |
mu.C |
scalar, conditional mean for z given x |
R.C |
scalar, conditional covariance for z given x |
A |
list containing matrix decomposition of A, preferably, obtained from function decomposeA |
x.var |
vector indicating variables already present in the model. length: k-1 |
alpha |
confidence level for decision limit |
Proposition Distribution of a C^2 contribution from Paper Criticality Assessment for Enhanced Multivariate Process Monitoring
conditionalCL, conditional decision limit for z's contribution to C_k
Dr. Burcu Aytaçoğlu ([email protected]) Dr. Diana Barraza-Barraza ([email protected]), Dr. Víctor G. Tercero-Gómez ([email protected]), Dr. A. Eduardo Cordero-Franco ([email protected]),
Paper
k<-3 sigma0 = matrix(diag(rep(1,k)),ncol = k) mu0 = matrix(c(0,0,0), ncol = 1) Weights = diag(c(0.5, 0.25,0.25)) library(mvtnorm) set.seed(1000) X = matrix(ncol= 1, data = rmvnorm(n = 1, mean = mu0, sigma = sigma0)) Z = (X - mu0)/sqrt(as.numeric(diag(sigma0))) Corr<-get.R(Sigma0 = sigma0) A<-decomposeA(W = Weights, R = Corr, x.var = 1:2, z.var = 3) Par<-zConditionalParameters(mean0 = mu0, R0 = Corr, z = Z, x.var = 1:2, z.var = 3) C2.DecisionLimit(z = Z, mu.C = Par$muC, R.C = Par$RC, A = A, x.var = 1:2, alpha = 0.95)
k<-3 sigma0 = matrix(diag(rep(1,k)),ncol = k) mu0 = matrix(c(0,0,0), ncol = 1) Weights = diag(c(0.5, 0.25,0.25)) library(mvtnorm) set.seed(1000) X = matrix(ncol= 1, data = rmvnorm(n = 1, mean = mu0, sigma = sigma0)) Z = (X - mu0)/sqrt(as.numeric(diag(sigma0))) Corr<-get.R(Sigma0 = sigma0) A<-decomposeA(W = Weights, R = Corr, x.var = 1:2, z.var = 3) Par<-zConditionalParameters(mean0 = mu0, R0 = Corr, z = Z, x.var = 1:2, z.var = 3) C2.DecisionLimit(z = Z, mu.C = Par$muC, R.C = Par$RC, A = A, x.var = 1:2, alpha = 0.95)
Decomposition of matrix A, required in Proposition 4.3. Decomoposition given by equation 41
decomposeA(W, R, x.var, z.var)
decomposeA(W, R, x.var, z.var)
W |
diagonal matrix containing the corresponding weigth for each monitored variable. Dimensions kxk |
R |
correlation matrix for monitores variables, kxk |
x.var |
vector indicating variables already present in the model. length: k-1. |
z.var |
scalar indicating variables to be included. |
Note that length(z.var) + length(x.var) = k
Returns decomposition of matrix A according to Equation 41 in paper.
Dr. Burcu Aytaçoğlu ([email protected]) Dr. Diana Barraza-Barraza ([email protected]), Dr. Víctor G. Tercero-Gómez ([email protected]), Dr. A. Eduardo Cordero-Franco ([email protected]),
Paper
k<-6 # variables B<-matrix(runif(n = k*k),ncol= k)### creating random matrix for sigma0 sigma0 <- B%*%t(B) R<-get.R(sigma0) Weights = diag(rep(1/k,k)) decomposeA(W = Weights, R = R, x.var = 1:5, z.var = 6)
k<-6 # variables B<-matrix(runif(n = k*k),ncol= k)### creating random matrix for sigma0 sigma0 <- B%*%t(B) R<-get.R(sigma0) Weights = diag(rep(1/k,k)) decomposeA(W = Weights, R = R, x.var = 1:5, z.var = 6)
Returns a correlation matrix from a variance-covariance matrix
get.R(Sigma0)
get.R(Sigma0)
Sigma0 |
variance-covariance matrix of dimensions kxk |
R |
correlation matrix correspondig to Sigma0 |
Dr. Burcu Aytaçoğlu ([email protected]) Dr. Diana Barraza-Barraza ([email protected]), Dr. Víctor G. Tercero-Gómez ([email protected]), Dr. A. Eduardo Cordero-Franco ([email protected]),
Paper
k<-6 # variables B<-matrix(runif(n = k*k),ncol= k)### creating random matrix for sigma sigma = B%*%t(B) get.R(Sigma0=sigma)
k<-6 # variables B<-matrix(runif(n = k*k),ncol= k)### creating random matrix for sigma sigma = B%*%t(B) get.R(Sigma0=sigma)
Simulates s instances of C^2_k given 1 to k-1 variables are already in the model. Obtains the quantile indicated by alpha
SimulatedDistributionC2(z, R.C, mu.C, W, R, A, x.var, z.var, alpha, s)
SimulatedDistributionC2(z, R.C, mu.C, W, R, A, x.var, z.var, alpha, s)
z |
observation vector, kx1 |
R.C |
scalar, conditional covariance for z given x |
mu.C |
scalar, conditional mean for z given x |
W |
matrix of variables weigths, kxk |
R |
correlation matrix, kxk |
A |
list containing matrix decomposition of A, preferably, obtained from function decomposeA |
x.var |
vector indicating variables already present in the model. length: k-1 |
z.var |
scalar indicating variable to be included |
alpha |
quantile(s) of the distribution |
s |
scalar indicating amount of simulations |
Quantile(s) of the simulated distribution
Dr. Burcu Aytaçoğlu ([email protected]) Dr. Diana Barraza-Barraza ([email protected]), Dr. Víctor G. Tercero-Gómez ([email protected]), Dr. A. Eduardo Cordero-Franco ([email protected]),
Paper
k<-3 sigma0 = matrix(diag(rep(1,k)),ncol = k) mu0 = matrix(c(0,0,0), ncol = 1) Weights = diag(c(0.5, 0.25,0.25)) library(mvtnorm) set.seed(1000) X = matrix(ncol= 1, data = rmvnorm(n = 1, mean = mu0, sigma = sigma0)) Z = (X - mu0)/sqrt(as.numeric(diag(sigma0))) Corr<-get.R(Sigma0 = sigma0) A<-decomposeA(W = Weights, R = Corr, x.var = 1:2, z.var = 3) Par<-zConditionalParameters(mean0 = mu0, R0 = Corr, z = Z, x.var = 1:2, z.var = 3) SimulatedDistributionC2(z = Z, R.C = Par$RC, mu.C = Par$muC, W = Weights, R = Corr, A = A, x.var = 1:2, z.var = Z, alpha = 0.95, s = 1000 )
k<-3 sigma0 = matrix(diag(rep(1,k)),ncol = k) mu0 = matrix(c(0,0,0), ncol = 1) Weights = diag(c(0.5, 0.25,0.25)) library(mvtnorm) set.seed(1000) X = matrix(ncol= 1, data = rmvnorm(n = 1, mean = mu0, sigma = sigma0)) Z = (X - mu0)/sqrt(as.numeric(diag(sigma0))) Corr<-get.R(Sigma0 = sigma0) A<-decomposeA(W = Weights, R = Corr, x.var = 1:2, z.var = 3) Par<-zConditionalParameters(mean0 = mu0, R0 = Corr, z = Z, x.var = 1:2, z.var = 3) SimulatedDistributionC2(z = Z, R.C = Par$RC, mu.C = Par$muC, W = Weights, R = Corr, A = A, x.var = 1:2, z.var = Z, alpha = 0.95, s = 1000 )
Computation of the Average Run Length (ARL) for a Weighted Chi-Squared control chart for a given mean vector, delta, correlation matrix, R, control limit, h, and the vector of weights, w. The mean vector, delta, is defined in Propositon 4.2 from Paper Criticality Assessment for Enhanced Multivariate Process Monitoring.
wChisq.arl(delta, R, h, w)
wChisq.arl(delta, R, h, w)
delta |
Vector of values representing the change in the mean for each variable, 1xk |
R |
correlation matrix, kxk |
h |
Control limit of Weighted Chi-Squared Control chart |
w |
vector of weigths, 1xk |
arl |
Average Run Length (ARL) for a Weighted Chi-Squared control chart for a given mean vector |
Dr. Burcu Aytaçoğlu ([email protected]) Dr. Diana Barraza-Barraza ([email protected]), Dr. Víctor G. Tercero-Gómez ([email protected]), Dr. A. Eduardo Cordero-Franco ([email protected]),
Paper
#Table 1 in the Paper Criticality Assessment for Enhanced Multivariate Process Monitoring. delta <- c(0.5, 0.5) # mean vector (change vector) R <- diag(2) # correlation matrix h <- 2.649506 # Control limit w <- c(0.50153, 0.49847) # vector of weights wChisq.arl(delta, R, h, w)
#Table 1 in the Paper Criticality Assessment for Enhanced Multivariate Process Monitoring. delta <- c(0.5, 0.5) # mean vector (change vector) R <- diag(2) # correlation matrix h <- 2.649506 # Control limit w <- c(0.50153, 0.49847) # vector of weights wChisq.arl(delta, R, h, w)
Computation of a control limit of the Weighted Chi-Squared control chart for a given vector of weights, w, correlation matrix, R, and the false alarm rate, alpha.
wChisq.CLim(w,R,alpha)
wChisq.CLim(w,R,alpha)
w |
vector of weigths, 1xk |
R |
correlation matrix, kxk |
alpha |
false alarm rate |
ContLim |
control limit of the Weighted Chi-Squared control chart |
Dr. Burcu Aytaçoğlu ([email protected]) Dr. Diana Barraza-Barraza ([email protected]), Dr. Víctor G. Tercero-Gómez ([email protected]), Dr. A. Eduardo Cordero-Franco ([email protected]),
Paper
# Table 1 in the Paper Criticality Assessment for Enhanced Multivariate Process Monitoring. w <- c(0.29836,0.70164) #vector of weights R <- diag(2) alpha <- 0.005 wChisq.CLim(w,R,alpha) w <- c(0.23912,0.76088) #vector of weights R <- diag(2) R[1,2] <- R[2,1] <- 0.25 alpha <- 0.005 wChisq.CLim(w,R,alpha)
# Table 1 in the Paper Criticality Assessment for Enhanced Multivariate Process Monitoring. w <- c(0.29836,0.70164) #vector of weights R <- diag(2) alpha <- 0.005 wChisq.CLim(w,R,alpha) w <- c(0.23912,0.76088) #vector of weights R <- diag(2) R[1,2] <- R[2,1] <- 0.25 alpha <- 0.005 wChisq.CLim(w,R,alpha)
This function calculates and returns conditional parameters for z, given x are being already considered in the model
zConditionalParameters(mean0, R0, z, x.var, z.var)
zConditionalParameters(mean0, R0, z, x.var, z.var)
mean0 |
Mean vector for multivariate random vector under the null hypothesis. Dimensions: kx1 |
R0 |
Correlations matrix for multivariate random vector under the null hypothesis. Dimensions kxk |
z |
vector of random observation. Dimensions kx1 |
x.var |
Elements of z that are already considered in the model |
z.var |
element of z whose contribution to C_k|C_k-1,C_k-2,...,C_1 is going to be calculated |
A list containing
muC |
conditional mean for z |
RC |
Conditional variance for z |
Dr. Burcu Aytaçoğlu ([email protected]) Dr. Diana Barraza-Barraza ([email protected]), Dr. Víctor G. Tercero-Gómez ([email protected]), Dr. A. Eduardo Cordero-Franco ([email protected]),
Paper
k<-3 sigma0 = matrix(diag(rep(1,k)),ncol = k) mu0 = matrix(c(0,0,0), ncol = 1) Weights = diag(c(0.5, 0.25,0.25)) library(mvtnorm) set.seed(1000) X = matrix(ncol= 1, data = rmvnorm(n = 1, mean = mu0, sigma = sigma0)) Z = (X - mu0)/sqrt(as.numeric(diag(sigma0))) Corr<-get.R(Sigma0 = sigma0) zConditionalParameters(mean0 = mu0, R0 = Corr, z = Z, x.var = 1:2, z.var = 3)
k<-3 sigma0 = matrix(diag(rep(1,k)),ncol = k) mu0 = matrix(c(0,0,0), ncol = 1) Weights = diag(c(0.5, 0.25,0.25)) library(mvtnorm) set.seed(1000) X = matrix(ncol= 1, data = rmvnorm(n = 1, mean = mu0, sigma = sigma0)) Z = (X - mu0)/sqrt(as.numeric(diag(sigma0))) Corr<-get.R(Sigma0 = sigma0) zConditionalParameters(mean0 = mu0, R0 = Corr, z = Z, x.var = 1:2, z.var = 3)