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 |
Optional: The number of Monte-Carlo samples used to compute the
supplied |
S |
Optional: The number of ones observed from |
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:
-
$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 throughstopcrit = list("type"="futility","param"=...)
or requested usingcompute_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 ifsample_G
samples in batches) -
$Bn
: sequence of number of samples drawn from MC sampler at each timepoint (which can be greater than 1 ifsample_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.
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)