ARL_Clplus: ARL Estimation in CUSUM Control Charts with Gamma...

View source: R/LGICARL_CUSUM_Up.R

ARL_ClplusR Documentation

ARL Estimation in CUSUM Control Charts with Gamma Distribution and Cautious Learning for upward detection

Description

This function calculates the Average Run Length (ARL) of a CUSUM control chart based on the Gamma distribution, incorporating a cautious learning scheme for the progressive update of parameters and optimization of performance in upward detection.

The function allows for the evaluation of the CUSUM chart’s behavior under different parameterization scenarios, ensuring efficient detection of process changes.

Following the methodology presented in the work of Madrid-Alvarez, García-Díaz, and Tercero-Gómez (2024), this implementation utilizes Monte Carlo simulations in C++ for efficient execution, ensuring a dynamic adjustment of parameters based on the evolution of the process.

The values of H_plus, H_delta, K_l, delay, and tau can be referenced in the tables from the article:

Madrid-Alvarez, H. M., García-Díaz, J. C., & Tercero-Gómez, V. G. (2024). A CUSUM control chart for the Gamma distribution with cautious parameter learning. Quality Engineering, 1-23.

Usage Scenarios:

Scenario 1: Known alpha and estimated beta

  • The alpha parameter is assumed to be fixed and known in advance.

  • beta is estimated from a dataset or defined by the user.

  • The user must provide alpha and an initial estimate of beta (beta0_est).

Scenario 2: Both alpha and beta are estimated

  • Both alpha and beta are estimated from a dataset or external data source.

  • The user must calculate alpha0_est and beta0_est before running the function.

  • beta0_est is dynamically updated during the simulation when a predefined condition is met.

Features:

  • Implements Monte Carlo simulations optimized in C++ for ARL estimation.

  • Allows dynamic updating of beta0_est to improve the model's adaptability.

  • Compatible with scenarios where alpha is known or estimated.

  • Ensures stable and reliable performance in detecting changes in processes modeled with Gamma distributions.

  • Recommended values for H_plus, H_delta, K_l, delay, and tau can be found in the reference article.

Usage

ARL_Clplus(
  alpha,
  beta,
  alpha0_est,
  beta0_est,
  known_alpha,
  beta_ratio,
  H_delta,
  H_plus,
  n_I,
  replicates,
  K_l,
  delay,
  tau
)

Arguments

alpha

Shape parameter of the Gamma distribution.

beta

Scale parameter of the Gamma distribution.

alpha0_est

Initial estimate of the shape parameter alpha. If known_alpha is TRUE, this value will be equal to alpha.

beta0_est

Initial estimate of the scale parameter beta. This value is updated dynamically during the simulation.

known_alpha

TRUE if alpha0_est is fixed, FALSE if it must be estimated.

beta_ratio

Ratio between beta and its posterior estimate.

H_delta

Increment of the upper control limit in the CUSUM chart.

H_plus

Initial control limit of the CUSUM chart.

n_I

Sample size in Phase I.

replicates

Number of Monte Carlo simulations.

K_l

Secondary control threshold for parameter updating.

delay

Number of observations before updating beta0_est.

tau

Time point at which beta changes. A value of 1 is recommended for IC states.

Value

A numeric value corresponding to the ARL estimate for the upward CUSUM control chart with cautious learning.

Examples

# Option 1: Provide parameters directly
ARL_Clplus(
  alpha = 1,
  beta = 1,
  alpha0_est = 1,  # alpha = known_alpha
  beta0_est = 1.1,   # Estimated Beta
  known_alpha = TRUE,
  beta_ratio = 2,
  H_delta = 4.2433,
  H_plus = 8.7434,
  n_I = 200,
  replicates = 100,
  K_l = 2,
  delay = 25,
  tau = 1
)

# Option 2: Use generated data
set.seed(123)
datos_faseI <- rgamma(n = 200, shape = 1, scale = 1)
alpha0_est <- mean(datos_faseI)^2 / var(datos_faseI)  # Alpha estimation
beta0_est <- mean(datos_faseI) / alpha0_est  # Beta estimation

ARL_Clplus(
  alpha = 1,
  beta = 1,
  alpha0_est = alpha0_est,
  beta0_est = beta0_est,
  known_alpha = FALSE,
  beta_ratio = 2,
  H_delta = 4.2433,
  H_plus = 8.7434,
  n_I = 200,
  replicates = 1000,
  K_l = 2,
  delay = 25,
  tau = 1
)

LGCU documentation built on April 12, 2025, 1:59 a.m.