avseqmc_progress ObjectInitialize an object of class avseqmc_progress. This object
contains the progress of an earlier sequentially anytime-valid estimated
p-value from a Monte-Carlo simulation as described in Stoepker and Castro
(2024, Definition 6). Subsequent references to equations and sections in
this section of the reference manual pertain to this paper.
The object can be passed to avseqmc() to resume sampling.
init_avseqmc_progress(sample_G, epsilon, ptilde = NULL, n = 0, S = 0)An object of class avseqmc_progress containing the progress of the
sequentially estimated p-value. The object is a list containing the
following elements:
$epsilon: risk of overestimated significance used in the sequential estimation.
$sample_G: function that samples (batches) from the Monte-Carlo distribution $G^*(X)$ as in Equation (5).
$ptilde: sequence of sequential $p$-value estimates. The final value in this sequence is the most recent estimate of the $p$-value.
$Ltilde: sequence of lower bounds of the confidence sequence based on the construction by Robbins (1970). Contains NA values if these were
not computed by default through stopcrit = list("type"="futility","param"=...) or requested using
compute_lower=TRUE.
$n: total number of samples drawn from the MC sampler.
$S: total number of ones observed from the MC sampler.
$B: sequence of number of ones observed at each sampling timepoint (which can be greater than 1 if sample_G samples in batches)
$Bn: sequence of number of samples drawn from MC sampler at each timepoint (which can be greater than 1 if sample_G samples in batches)
If ptilde, n, and S are all empty, the object is initialized but empty
and can be used as a starting point for sequential estimation.
A function (without arguments) that draws one (or a batch of) zero/one samples from the distribution G as in Equation (5), where the function returns a vector of zeroes and ones.
The desired risk of overestimated significance.
Optional: a previously computed anytime-valid p-value estimate
(via the construction in Definition 6, based on Robbins (1970)). If
supplied, n must also be provided. The number of previously observed ones
observed from the Monte-Carlo sampler sample_G (S) is inferred from
ptilde and n unless given explicitly. If ptilde is rounded, supplying
S is recommended to avoid numerical inaccuracies in inferring it.
Optional: The number of Monte-Carlo samples used to compute the
supplied ptilde. Must be given if ptilde or S is provided.
Optional: The number of ones observed from sample_G. Must be given
when n is supplied. Can be used instead of inferring it from ptilde and
n.
Stoepker, I. V., and R. M. Castro. 2024. Inference with Sequential Monte-Carlo Computation of p-Values: Fast and Valid Approaches. https://doi.org/10.48550/arXiv.2409.18908.
Robbins, H. (1970). Statistical Methods Related to the Law of the Iterated Logarithm. The Annals of Mathematical Statistics, 41(5):1397–1409. http://dx.doi.org/10.1214/aoms/1177696786
avseqmc which can be used to resume the anytime-valid
sampling as logged in the constructed object.
# Minimal example to construct an object based on earlier values of n and S
G1 <- function(){runif(1) < 0.04}
R1 <- init_avseqmc_progress(sample_G = G1,
epsilon = 0.001,
n = 1000,
S = 44)
Run the code above in your browser using DataLab