cl_op

Notedocblock
cl_op(op_dgp, lam, L0, cl_init;
      reps_final, reps_bracket, bracket_step,
      arl_truncation_factor, chart_choice, d, m, ced, ad,
      verbose, cl_tol, seed)

Compute the critical limit cl for an EWMA control chart based on ordinal patterns such that the in-control Average Run Length (ARL) equals L0.

The search proceeds in two phases:

  1. Bracketing: A coarse Monte Carlo estimate (using reps_bracket replications) steps away from cl_init in increments of bracket_step until an interval [a, b] is found where the ARL crosses L0.
  2. Refinement: The ITP root-finding algorithm narrows the bracket to within cl_tol using full Monte Carlo estimates (reps_final replications). Using a fixed seed ensures the ARL function behaves smoothly across evaluations within a single call, which is required for the root finder to work reliably. With large reps_final, the result is accurate regardless of which seed is used. Pass seed=nothing (default) for independent results across calls, or fix the seed for reproducibility.

Arguments

  • op_dgp::Union{ContinuousDGPIC,DiscreteDGPIC}: Data-generating process under the in-control distribution.
  • lam: EWMA smoothing parameter λ ∈ (0, 1].
  • L0: Target in-control ARL.
  • cl_init: Initial guess for the critical limit. Does not need to be precise — a rough value in the right ballpark is sufficient.

Keyword Arguments

  • reps_final=10_000: Replications used during the ITP refinement phase.
  • reps_bracket=1_000: Replications used during the bracketing phase.
  • bracket_step=0.01: Step size for the bracketing search.
  • arl_truncation_factor=50: Individual simulation runs are capped at arl_truncation_factor * L0 steps during bracketing.
  • chart_choice: Control chart statistic to use. Required.
  • d::Union{Int,Vector{Int}}=1: Delay value or vector.
  • m::Int=3: Pattern length.
  • ced::Bool=false: Use conditional expected delay?
  • ad::Int=100: Number of iterations for ced.
  • cl_tol=1e-4: Absolute convergence tolerance on cl for the ITP phase.
  • seed=nothing: Random seed for reproducibility. Fix to an integer (e.g. seed=42) to get the same result across runs.
  • verbose=false: If true, prints progress information at each evaluation.

Returns

  • cl::Float64: The critical limit achieving an in-control ARL of L0.

Example

op_dgp = ContinuousDGPIC(Normal(0, 1))
cl = cl_op(op_dgp, 0.1, 370.0, 2.5; chart_choice=TauTilde(), reps_final=50_000, seed=42)