# simulation: Estimation errors and conditional run-length simulation In CautiousLearning: Control Charts with Guaranteed In-Control Performance and Cautious Parameters Learning

## Description

Function `ruv` simulates the standardized estimation errors at the starting of the monitoring phase (see Section 2.3 of Capizzi and Masarotto (2019)).

Function `rcrl` simulates, under different in-control or out-control scenarios, the conditional run-length given the standardized estimation errors. When openMP is supported, computation can be distribuited on multiple cores. See `omp`.

## Usage

 ```1 2 3``` ```ruv(n, m) rcrl(n, chart, u, v, tau, delta, omega, maxrl = 1000000L) ```

## Arguments

 `n` number of simulated values. `m` number of in-control observations available at the starting of the monitoring phase. `chart` list with the same elements as those returned by `x.cl`, `ewma.cl` and `cusum.cl`. `u, v` values of the estimation errors (scalars). `tau, delta, omega` when i=tau, observations are distributed as N(mu+delta*sigma, (omega*sigma)^2) random variables. `maxrl` run-length are truncated at i=maxrl.

## Value

 `ruv` numeric matrix of dimension nx2. `rcrl` integer vector of length n.

## Author(s)

Giovanna Capizzi and Guido Masarotto

## References

Capizzi, G. and Masarotto, G. (2019) "Guaranteed In-Control Control Chart Performance with Cautious Parameter Learning", accepted for publication in Journal of Quality Technology, a copy of the paper can be obtained from the authors.

## Examples

 ```1 2 3 4 5 6 7``` ```ruv(5, 100) ## EWMA control chart (nominal ARL=500, ## initial estimates based on 100 in-control observations) chart <- list(chart = "EWMA", lambda = 0.2, limit = c(Linf=3.187, Delta=0.427, A=1.5, B=50, m=100)) rcrl(10, chart, 2, 1, 50, 2, 1) ```

CautiousLearning documentation built on July 18, 2019, 5:04 p.m.