cl_sacf
Notedocblock
cl_sacf(sp_dgp::ICSTS, lam, L0, cl_init, d1::Int, d2::Int;
reps_final, reps_bracket, bracket_step,
arl_truncation_factor, verbose, cl_tol, seed)Compute the critical limit cl for an EWMA control chart based on the spatial autocorrelation function (SACF) such that the in-control ARL equals L0.
The search proceeds in two phases:
- Bracketing: A coarse Monte Carlo estimate (using
reps_bracketreplications) steps away fromcl_initin increments ofbracket_stepuntil an interval[a, b]is found where the ARL crossesL0. - Refinement: The ITP root-finding algorithm narrows the bracket to within
cl_tolusing full Monte Carlo estimates (reps_finalreplications). Using a fixedseedensures the ARL function behaves smoothly across evaluations within a single call. With largereps_final, the result is accurate regardless of which seed is used. Passseed=nothing(default) for independent results across calls, or fix the seed for reproducibility.
Arguments
sp_dgp::ICSTS: 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.d1::Int: The first (row) delay for the spatial process.d2::Int: The second (column) delay for the spatial process.
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 atarl_truncation_factor * L0steps during bracketing.cl_tol=1e-4: Absolute convergence tolerance onclfor the ITP phase.seed=nothing: Random seed for reproducibility.verbose=false: Iftrue, prints progress information at each evaluation.
Returns
cl::Float64: The critical limit achieving an in-control ARL ofL0.
Example
sp_dgp = ICSTS(20, 20, Normal(0, 1))
cl = cl_sacf(sp_dgp, 0.1, 370.0, 0.5, 1, 1; reps_final=50_000, seed=42)