irt_iterations: Compute Required Monte Carlo Replications

View source: R/irt_iterations.R

irt_iterationsR Documentation

Compute Required Monte Carlo Replications

Description

Uses the Burton (2003) formula to determine the minimum number of simulation replications needed to achieve a desired level of Monte Carlo precision.

Usage

irt_iterations(sigma, delta, alpha = 0.05)

Arguments

sigma

Positive numeric. The empirical standard error of the estimand across replications (or a pilot estimate thereof).

delta

Positive numeric. The acceptable Monte Carlo error (half-width of the MC confidence interval for the estimand).

alpha

Numeric in (0, 1). Two-sided significance level. Default 0.05 (i.e., 95 percent MC confidence).

Details

The formula is:

R = \lceil (z_{\alpha/2} \cdot \sigma / \delta)^2 \rceil

where \sigma is the empirical standard error of the estimand, \delta is the acceptable Monte Carlo error, and z_{\alpha/2} is the critical value for the desired confidence level.

Value

An integer: the minimum number of replications.

References

Burton, A., Altman, D. G., Royston, P., & Holder, R. L. (2006). The design of simulation studies in medical statistics. Statistics in Medicine, 25(24), 4279–4292. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1002/sim.2673")}

See Also

irt_simulate() for running the simulation with the computed number of replications.

Examples

# How many replications for MC SE of bias < 0.1
# when empirical SE of the estimand is 0.5?
irt_iterations(sigma = 0.5, delta = 0.1)

# Tighter tolerance with 99% MC confidence
irt_iterations(sigma = 0.5, delta = 0.05, alpha = 0.01)


irtsim documentation built on April 24, 2026, 1:07 a.m.