init_avseqmc_progress {avseqmc}R Documentation

Initialize an avseqmc_progress Object

Description

Initialize 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.

Usage

init_avseqmc_progress(sample_G, epsilon, ptilde = NULL, n = 0, S = 0)

Arguments

sample_G

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.

epsilon

The desired risk of overestimated significance.

ptilde

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.

n

Optional: The number of Monte-Carlo samples used to compute the supplied ptilde. Must be given if ptilde or S is provided.

S

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.

Value

An object of class avseqmc_progress containing the progress of the sequentially estimated p-value. The object is a list containing the following elements:

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.

References

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

See Also

avseqmc which can be used to resume the anytime-valid sampling as logged in the constructed object.

Examples

# 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)


[Package avseqmc version 1.0.1 Index]